Custom bitmap font causes texts to be upside down

Hello again,

Now I’m testing normal custom bitmap fonts (not SDF) and using a custom font causes text to be upside down or otherwise distorted (this is actually the problem I mentioned in my previous post) and the component dimensions to be calculated incorrectly. I found this statement: temp.resizeTo(-fontSizeValue) here haxeui-heaps/TextDisplayImpl.hx at master · haxeui/haxeui-heaps · GitHub and here haxeui-heaps/TextInputImpl.hx at master · haxeui/haxeui-heaps · GitHub which causes the issue. When I remove the minus sign and change it to temp.resizeTo(fontSizeValue) in both places then text is displayed correctly. But the minus sign seems to be intentional so I’m not sure if removing it won’t cause some other issues.

Stay well.

hmmmm… so thats not needed all the time? That complicates things… :confused:

Can you zip and send the font you are using?

Cheers,
Ian

Here is the font I’m using: font.zip

A side note regarding SDF fonts (sorry for being a little chaotic here): I struggled to get smooth SDF font rendering until I’ve realised that the default colour channel for distanced field encoding in SDFFonts.register is red but Hiero (the first mention on the list of recommended SDF font creation tools on the Heaps website) uses alpha channel for that purpose. So calling SDFFonts.register("...", h2d.Font.SDFChannel.Alpha) results in very nice smooth fonts. Perhaps, this piece of information could be useful to some.

In case of non-SDF fonts I kindly recommend to enable smoothing (either globally like this Screen.instance.scene.defaultSmooth = true or just for individual components using smooth property of the underlying Heaps drawable), both downscaled and upscaled fonts look better then.

Now, back to the topic, here are some screenshots.

How it looks now:

How it looks if I remove the mentioned minus sign:

Sorry for a bit longer post.

Take care.