mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
examples/texti18n: use Jpan as a Japanese script
This commit is contained in:
parent
66410a03cb
commit
58f1415cac
@ -113,6 +113,8 @@ func init() {
|
|||||||
var japaneseOut shaping.Output
|
var japaneseOut shaping.Output
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
const japanese = language.Script(('j' << 24) | ('p' << 16) | ('a' << 8) | 'n')
|
||||||
|
|
||||||
face, err := font.ParseTTF(bytes.NewReader(fonts.MPlus1pRegular_ttf))
|
face, err := font.ParseTTF(bytes.NewReader(fonts.MPlus1pRegular_ttf))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
@ -125,7 +127,7 @@ func init() {
|
|||||||
Direction: di.DirectionTTB,
|
Direction: di.DirectionTTB,
|
||||||
Face: face,
|
Face: face,
|
||||||
Size: fixed.I(24),
|
Size: fixed.I(24),
|
||||||
Script: language.Katakana_Or_Hiragana,
|
Script: japanese,
|
||||||
Language: "ja",
|
Language: "ja",
|
||||||
}
|
}
|
||||||
japaneseOut = (&shaping.HarfbuzzShaper{}).Shape(input)
|
japaneseOut = (&shaping.HarfbuzzShaper{}).Shape(input)
|
||||||
|
Loading…
Reference in New Issue
Block a user