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

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