Eiyeron / Textbox

A Haxeflixel character-by-character textbox with per-character effects.
MIT License
35 stars 6 forks source link

Kerning is off for the first letters of every word #5

Open Geokureli opened 1 month ago

Geokureli commented 1 month ago

seems the first word of the line is not affected for some unknown reason

Screenshot 2024-09-17 at 11 36 32 AM
Geokureli commented 1 month ago

The issue seems to be coming from these lines, and only effects html5.

 #if js
// Legnth calculation wouldn't work properly if I haven't done this.
if(character.text.isSpace(0))
    textWidth += character.width + characterSpacingHack;
else
    textWidth = innerText.textField.textWidth;
#else
textWidth = innerText.textField.textWidth;
#end

when this if case is removed and it just left with the else, this all seems to work fine