Font drawing bug


#1

On windows this work correctly. On OSX, the right justification is too far to the left.

This is also incorrect for all music fonts.


    Font f = Font( "Symbol", 48, 0 );
    g.setFont( f );
    g.drawSingleLineText( "A", 100, 110, Justification::left );
    g.drawSingleLineText( "A", 100, 120, Justification::right );

A second issue.

withPointFont is creating fonts 1.26 times too small on OSX as compared to the windows version.


#2

It's in that position because that's how wide that glyph is. Print "AAA" and you can see that the glyph's kerning is set to a massive space. I'm not sure what you expect me to do about that?

And I also can't see any problem with the windows size - the latest juce demo fonts page uses point sizes for the listbox fonts, and they all look the right size AFAICT..


#3

So why is this not happening on the Windows side?

It happens on music and symbol fonts and I believe this started after you made the changes "withPointSize". It was not is the juce 1.5 code.

The character widths are definitely off. I have three characters in my font, basically the same width, and one of them has a width twice the size of the others. I'll look into it and send you the font and the code that proves it.

How do you want me to send you the font so you can see it?


#4

That glyph width is clearly just wierd. If there was something wrong with the way kerning or glyph widths are handles in general, then it'd affect all glyphs in all fonts, but that's obviously not the case. And it can't be related to withPointSize, because the kerning is just proportional to the size, regardless of the metric that was used to choose that size originally.

If you have some sensible test code, I'll take a look, but be careful not to jump to conclusions about what's causing the problem.


#5

I happens on most glyph widths in the symbol font. I have sent you my font and source code. It happens with several glyphs. I know this was not a problem a in the 1.53 code and I may verify that. Just look at the widths in a font editor and then the widths juce is returning. I'll keep looking into it, because this is very important to me that this gets resolved.

Thanks for looking at the problem.