mjrgh / PinballY

A table browser and launcher ("front end") for virtual pinball cabinets.
Other
47 stars 22 forks source link

TT font is not displaying #93

Closed githubmarie closed 4 years ago

githubmarie commented 4 years ago

I installed tt font P22 Pop Art Comic on my cab.

But when I try to use TT font P22 Pop Art Font as default font, the text of the status line appears like the standard ( Arial? ) font.

When I tried some other TT fonts many of them did change, but some fonts didn't

Using W764

mjrgh commented 4 years ago

Thanks for providing the link to a test font. I just gave it a try with the linked font, and it seems to work for me, so apparently it's not the ttf file that's the problem.

I assume you've tried the same font in other programs (e.g., use it in a Word document, something like that), and it's displaying properly there?

And I assume that you have the status line font set to "*" for Default in the settings? Maybe you could try changing the status line font specifically to this one (rather than setting it as the default font) and see if that's any different.

Also, you did exit fully out of PinballY and restart it after installing the new font, right? You usually have to re-launch a process to get it to see new fonts.

githubmarie commented 4 years ago

Thanks for the prompt reaction.

Good to read that you were able to test it. Strange it only not seems to work on my side.

I have this situation for also for other (already installed) fonts. fx Aharoni also gives a standard font, but fx Andalus works perfectly

Answering your questions: The font works in Word and I try to reinstall the font a few times as well.

I tried both installing it for the Default font and for the Statusline font separately.

And I not only restarted PinballY, but rebooted the pc totally.

mjrgh commented 4 years ago

One thing I notice about the two non-working fonts you've mentioned by name (P22 Pop Art Comic and Aharoni) is that neither has a "regular" style - P22 Pop Art Comic is italic-only and Aharoni appears to be boldface-only. On my machine, that doesn't seem to matter, but Gdiplus (the Windows operating system layer that's doing the actual font loading) is known to have some weird differences across Windows versions, particularly Windows 7, which you mentioned you're using. Maybe the Win 7 version of Gdiplus is pickier about exactly matching the style.

If you were to check all of the fonts to see which ones work and which ones don't, do you think this would emerge as a common element among the non-working fonts? That is, would all of the non-working fonts lack a "regular" style - all would be italic and/or bold?

You could actually test this theory pretty easily with Ahroni. If the problem is that it only has a bold style, you can simply ask PinballY to load the bold style rather than the regular style, by selecting "Bold" in the drop box for weight next to the font name in the font selector dialog. If it starts working after you set it to bold in the settings, this is probably the issue.

If so, I could add some code to try the italic and bold variations of the font if the "regular" style doesn't load. (Assuming that Gdiplus even reports the error. The font substitution might be taking place down in the Windows layers - Gdiplus has some known bugs about reporting missing fonts back to the caller. Hopefully this isn't such a case so that we can detect it and work around it.)

githubmarie commented 4 years ago

Wow, your analysis was spot on! First tried changed the settings in statusline to bold and the Ahroni font appeared right.

With the font I also put in the link, the P22 Pop Art font still didn't appear (Bold and Italic version) Then re-downloaded and installed the non italic versions of the P22 Pop Art font and it also worked with the setting bold in the statusline. (The regular versions of this font don't work in non bold setting btw)

Now the statusline text fits my Lichtenstein themed Pincab.

BIG thanks!

(And if I may be bold (pun intended): a request for change will be the possibility to change the color of the status line texts) ;)

mjrgh commented 4 years ago

Glad to hear the style matching was the issue! I've added code for the next update that will automatically try italic+bold style variations if the initial font isn't matched, and also added a new option to select italic specifically.

Adding a color option should be doable at some point.

githubmarie commented 4 years ago

Great news, thanks!