Custom fonts not being properly centred

I imported the Orbitron_Medium.ttf front from Google
When I use it in labels, or even directly with g.drawFittedText, with a justification::centred, it is not vertically centred, several pixels higher, as shown in captures.

Can I fix that without tweaking my LookAndFeels?

Using default font:
02

Using Orbitron Medium font:
30

relevant:

1 Like

@jules, I think this is a bug.
JUCE 5.2.0. OSX

No, it’s not a bug.

It’s just a font whose ascent is the same as the top of its capital letters. So obviously if you use a block of text which is all-caps with no descenders, it’s going to look top-heavy. If you look at the bit that says “Real Keyboard” where you have mixed case + descenders, you’ll see that it looks fine.

The only real mistake here is by whoever designed the typeface - normally they’d leave a bit of space at the top for ascenders, but that’s not been done in this case. If you really want to use it, you could probably tweak the font’s ascent yourself in a font editor.

1 Like