setting up semibold font

This commit is contained in:
Gavin Nishizawa 2023-04-10 12:33:16 -07:00
parent 4c35a27791
commit 624b2a9a10
No known key found for this signature in database
GPG key ID: AE3B177777CE55CD

View file

@ -66,6 +66,7 @@ const (
FONT_STYLE_REGULAR FontStyle = "regular"
FONT_STYLE_BOLD FontStyle = "bold"
FONT_STYLE_SEMIBOLD FontStyle = "semibold"
FONT_STYLE_ITALIC FontStyle = "italic"
SourceSansPro FontFamily = "SourceSansPro"
@ -86,6 +87,7 @@ var FontSizes = []int{
var FontStyles = []FontStyle{
FONT_STYLE_REGULAR,
FONT_STYLE_BOLD,
FONT_STYLE_SEMIBOLD,
FONT_STYLE_ITALIC,
}
@ -101,6 +103,9 @@ var sourceSansProRegularBase64 string
//go:embed encoded/SourceSansPro-Bold.txt
var sourceSansProBoldBase64 string
//go:embed encoded/SourceSansPro-Semibold.txt
var sourceSansProSemiboldBase64 string
//go:embed encoded/SourceSansPro-Italic.txt
var sourceSansProItalicBase64 string
@ -135,6 +140,10 @@ func init() {
Family: SourceSansPro,
Style: FONT_STYLE_BOLD,
}: sourceSansProBoldBase64,
{
Family: SourceSansPro,
Style: FONT_STYLE_SEMIBOLD,
}: sourceSansProSemiboldBase64,
{
Family: SourceSansPro,
Style: FONT_STYLE_ITALIC,
@ -211,6 +220,14 @@ func init() {
Family: SourceSansPro,
Style: FONT_STYLE_BOLD,
}] = b
b, err = fontFacesFS.ReadFile("ttf/SourceSansPro-Semibold.ttf")
if err != nil {
panic(err)
}
FontFaces[Font{
Family: SourceSansPro,
Style: FONT_STYLE_SEMIBOLD,
}] = b
b, err = fontFacesFS.ReadFile("ttf/SourceSansPro-Italic.ttf")
if err != nil {
panic(err)