Can't get custom fonts working on Mac OS X

Got a problem with OpenTTD? Find some help here.

Moderator: OpenTTD Developers

Post Reply
User avatar
Dada
Engineer
Engineer
Posts: 40
Joined: 02 Apr 2010 13:01
Location: Rotterdam, The Netherlands

Can't get custom fonts working on Mac OS X

Post by Dada »

Hi there. Anybody know what I'm doing wrong here? I'm trying to use the Japanese town names NewGRF but I can't seem to get the fonts working properly.

My current settings:

Code: Select all

small_font = /Library/Fonts/Arial Unicode.ttf
medium_font = /Library/Fonts/Arial Unicode.ttf, Bold
large_font = /Library/Fonts/Arial Unicode.ttf, Bold
mono_font = /Library/Fonts/Arial Unicode.ttf, Bold
small_size = 12
medium_size = 12
large_size = 16
mono_size = 12
small_aa = true
medium_aa = true
large_aa = true
mono_aa = true
When zoomed in, I see question marks. However, when I zoom out, the font is visible. I'm not sure what I'm doing wrong here that makes the font show up correctly on some zoom levels, but not on others.

Really appreciate any help you can give me. :D
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4763
Joined: 09 Sep 2007 05:03
Location: home

Re: Can't get custom fonts working on Mac OS X

Post by Alberth »

Likely the font does not exist in all zoomed sizes that you request.

Edit: While we see it as a single font in different sizes, printers see each size as as a different font, and this is also how these files are constructed.
So the file contains only fonts that are (in your view) 'small' or 'big' depending on your zoom setting when you see the font. The other kind uses a font that is not available in the file.
Being a retired OpenTTD developer does not mean I know what I am doing.
User avatar
Dada
Engineer
Engineer
Posts: 40
Joined: 02 Apr 2010 13:01
Location: Rotterdam, The Netherlands

Re: Can't get custom fonts working on Mac OS X

Post by Dada »

Thanks for your reply!

I must admit your reply actually had me a bit confused, since you said "printers see each size as a different font." I'm thinking now you probably meant that each individual weight is a different font? Upon closer inspection it turns out that Arial Unicode doesn't have a bold weight so that's why it wasn't working.

I've now changed all my fonts to Hiragino Sans W5 and that works very well.

There's another weird thing, though... after this I switched the interface language to Japanese as well, but then the font changed. No matter what font I set, it uses a different one if I use Japanese. Maybe a built in font?
Here's the English and Japanese screenshots. Note the difference in the window title and the word "NewGRF".
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4763
Joined: 09 Sep 2007 05:03
Location: home

Re: Can't get custom fonts working on Mac OS X

Post by Alberth »

Not builtin in OpenTTD, the sprite font that it has only supports the 4 original Western languages, maybe some library does something smart there, no idea.
Being a retired OpenTTD developer does not mean I know what I am doing.
Post Reply

Return to “OpenTTD Problems”

Who is online

Users browsing this forum: Google [Bot] and 3 guests