Skip to content

Commit

Permalink
Custom RGB
Browse files Browse the repository at this point in the history
  • Loading branch information
CaffeeLake committed Oct 16, 2024
1 parent 995c508 commit 2dc4fa5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"fmt"
"image"
"image/color"
"image/draw"
"image/jpeg"
"image/png"
Expand Down Expand Up @@ -71,15 +72,15 @@ func cmd() {
}

img := image.NewRGBA(image.Rect(0, 0, 512, 512))
draw.Draw(img, img.Bounds(), image.White, image.Point{}, draw.Src)
draw.Draw(img, img.Bounds(), &image.Uniform{C: color.RGBA{R: 255, G: 255, B: 255, A: 255}}, image.Point{}, draw.Src)

c := freetype.NewContext()
c.SetDPI(72)
c.SetFont(font)
c.SetFontSize(448)
c.SetClip(img.Bounds())
c.SetDst(img)
c.SetSrc(image.Black)
c.SetSrc(&image.Uniform{C: color.RGBA{R: 0, G: 0, B: 0, A: 255}})
pt := freetype.Pt(32, 417)
_, err := c.DrawString(string(r), pt)
if err != nil {
Expand Down Expand Up @@ -109,7 +110,7 @@ func cmd() {
f.Close()

if config.Captions {
caption := fmt.Sprintf("%s/%s/u%06x.txt", config.Exports, fontname, r)
caption := fmt.Sprintf("%s/%s-u%06x.txt", config.Exports, fontname, r)
f, err = os.Create(caption)
if err != nil {
log.Fatalln(err)
Expand Down

0 comments on commit 2dc4fa5

Please sign in to comment.