mirror of
https://github.com/aljazceru/njump.git
synced 2026-01-31 03:34:37 +01:00
Use NotoSansJP to render OG image
This commit is contained in:
BIN
fonts/NotoSansJP.ttf
Normal file
BIN
fonts/NotoSansJP.ttf
Normal file
Binary file not shown.
5
text.go
5
text.go
@@ -3,11 +3,11 @@ package main
|
||||
import (
|
||||
"image"
|
||||
"image/draw"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/apatters/go-wordwrap"
|
||||
"github.com/lukevers/freetype-go/freetype"
|
||||
"golang.org/x/image/font/gofont/goregular"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -73,7 +73,8 @@ func drawImage(lines []string, style string) (image.Image, error) {
|
||||
|
||||
// create new freetype context to get ready for
|
||||
// adding text.
|
||||
font, _ := freetype.ParseFont(goregular.TTF)
|
||||
fontData, _ := os.ReadFile("fonts/NotoSansJP.ttf")
|
||||
font, _ := freetype.ParseFont(fontData)
|
||||
|
||||
c := freetype.NewContext()
|
||||
c.SetDPI(300)
|
||||
|
||||
Reference in New Issue
Block a user