Custom font not showing in lepoard


#1

Hi,

   I've got a plugin using a custom font. Everything is fine under snow leopard and windows, but under leopard the font isn't showing up correctly.

Any Idea ?

Thanks,
Denis.


#2

What do you mean by “custom font”? An embedded juce font, or a system font that you’ve installed?


#3

Hi,

  A font that i've serialized.

#4

…ok, well serialised fonts are rendered completely in software, so it should make no difference which OS you’re using. If you can get me some code that I could use to reproduce it, I’ll take a look, but it sounds a bit strange!


#5

Quite simple …

[code]
Font loading ( in constructor )
MemoryInputStream mis(EUROSTILET_BIN_DATA,EUROSTILET_BIN_DATA_SIZE,false);
mEurostileTTypeFace = new CustomTypeface(mis);
mEurostileTFont = new Font(mEurostileTTypeFace);

Paint function
//font slection
#ifdef JUCE_MAC
mEurostileTFont->setHeight(16);
#else
mEurostileTFont->setHeight(14);
#endif
mEurostileTFont->setBold(true);
g.setFont(*mEurostileTFont);
// text Display
g.drawText(“some text to draw”)[/code]


#6

Well yes, but I don’t have your typeface to try!


#7

Hi Jules,

    My serialized fnt Binary files is about 6.5 M.... i should have done someting wrong. I tried to serialize the font with FSerialize ( a tool, that may be not uptodate, found in this Forum ). The generated Font is lot smaller ( about 1M ) but works only on windows.. It's driving me mad.
    In short what is the best way to serialize a font ?

    Could be a Tools included with Juce ? I could do that if you give me the green ligth.

Thx,

Denis.


#8

It’d be a good tool to include in the Introjucer, but the tricky part is that OSX doesn’t provide enough info about the glyphs in a font to be able to automatically add all of them to a serialised font, so it would probably only work in Windows. (Unless you had a UI to actually select which glyphs should be added to the serialised font).


#9

Hi Jules,

I’m working with drolland, maybe I can give you more information about this problem.

Our aim is to use a font (EurostileT) in a plugin where both plain and bold versions are to be displayed. So far, we used the bold flag to pass the font to bold version when needed, and go back to plain for other texts.

As the EurostileT file (containing the fonts) does not include a bold version (that is in a separated file), can that be the problem encountered by the serialisation process? Or does the bolding system occur at rendering level?

Cheers.


#10

known bug with fallback font not working on OSX AFAIK


#11

Each custom font has flags to say whether it’s bold, italic, etc, but there’s no way for the system to know that one custom font is a bold version of another one - you’d need to manually select the bold or plain typefaces when you want to use them.


#12

Ok, I will then serialise two fonts:
[list][] One coming from “EurostileTBold.ttf”, with the bold flag set[/]
[] One coming from “EurostileT.ttf” with the bold flag cleared[/][/list]