(SOLVED) Android TextField Vertical Alignment Issue

I’m getting a very subtle vertical text alignment issue with Android:

Here’s the static code spitting out what makes my text fields:

public static inline function text(s: String, x: Float, y: Float, pt: Int) {

    var t = new TextField();
    t.text = s;
    t.x = x - t.width / 2;
    t.y = y;
    t.autoSize = TextFieldAutoSize.CENTER;
    t.selectable = false;
    t.setTextFormat(new TextFormat('', pt, Consts.FONT_COLOR, true));

    return t;

Perhaps they are using a different font. Can you embed a font and ensure they loading the same font?

1 Like

It didn’t occur to me until I saw the snapshot closely and noticed, like you did, that there are in fact 2 different fonts defaulting. Thank you–fixed!

1 Like