Fix horizontal positioning by making sure space advance is int

This commit is contained in:
bloeys
2022-07-10 21:43:04 +04:00
parent 254113c12e
commit f21e1ec201
2 changed files with 8 additions and 8 deletions

View File

@ -94,7 +94,7 @@ func (p *program) Init() {
fmt.Printf("DPI: %f, font size: %d\n", dpi, p.FontSize)
w, h := p.win.SDLWin.GetSize()
p.GlyphRend, err = glyphs.NewGlyphRend("./res/fonts/alm-fixed.ttf", &truetype.Options{Size: float64(p.FontSize), DPI: p.Dpi, SubPixelsX: subPixelX, SubPixelsY: subPixelY, Hinting: hinting}, w, h)
p.GlyphRend, err = glyphs.NewGlyphRend("./res/fonts/arabtype-variable.ttf", &truetype.Options{Size: float64(p.FontSize), DPI: p.Dpi, SubPixelsX: subPixelX, SubPixelsY: subPixelY, Hinting: hinting}, w, h)
if err != nil {
panic("Failed to create atlas from font file. Err: " + err.Error())
}
@ -190,7 +190,7 @@ func (p *program) Update() {
var isDrawingBounds = false
var drawManyLines = false
var textToShow = " Hello there يا friend. اسمي عمر wow!"
var textToShow = "Hello there يا friend. اسمي عمر wow!"
var xOff float32 = 0
var yOff float32 = 0