blob: dbadcc6f51923bccb5f11b1b2ea291e8b1c7730a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
package font
import (
"bytes"
"log"
"github.com/hajimehoshi/ebiten/v2/text/v2"
)
// TODO: use a font that supports our tap symbol
var fontSource *text.GoTextFaceSource
var Font24 *text.GoTextFace
var Font18 *text.GoTextFace
var Font12 *text.GoTextFace
func InitFont() {
fontSource, err := text.NewGoTextFaceSource(bytes.NewReader(LatinModernMathOtf))
if err != nil {
log.Fatal(err)
}
Font24 = &text.GoTextFace{
Source: fontSource,
Size: 24,
}
Font18 = &text.GoTextFace{
Source: fontSource,
Size: 18,
}
Font12 = &text.GoTextFace{
Source: fontSource,
Size: 12,
}
}
|