Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Issue] Something happened while rendering the fonts... #5416

Open
CharlieFuu69 opened this issue Mar 14, 2024 · 15 comments
Open

[Issue] Something happened while rendering the fonts... #5416

CharlieFuu69 opened this issue Mar 14, 2024 · 15 comments

Comments

@CharlieFuu69
Copy link

Target: Ren'Py v8.2.1_24030407

Gentlemen, I have no way of explaining it, because I don't know exactly what happened in particular. It may be a Ren'Py bug, or maybe my code is already outdated.

My idea was to finally make the transition to a more recent version of Ren'Py to start enjoying the benefits that Py3 has (since my game uses a lot of code written in pure Python), but there was a mishap. The font the game uses (DIN Medium) is somehow not rendering as expected, and many UI things are not in the position they should be.

1. COMPARISON SCREENSHOTS.

1.1. Project running on Ren'Py v7.4.11

image

1.2. Project running on Ren'Py v8.2.1 (Recent)

image


Is this a Ren'Py problem, or as I said above, is my code already old enough to have errors like this?

@renpytom
Copy link
Member

Can you send an example game? There were a bunch of changes to font handling, so it's possible something broke. (Or something was marginal, and lost that margin.)

@CharlieFuu69
Copy link
Author

The game is a little overweight (6 GB), so giving you my game is going to be a little complicated, but I can provide extra information that could help you see the root of this issue.

I did some side tests with other similar fonts, and in one case it did show me text. It should be noted that I have always used TTF fonts, and this case was no exception.

The sources I have used are the following:

Font Performance
DIN-Medium.ttf BAD
DIN_Next_CYR_Medium.ttf Working

Do you have an email to send you the sources? Maybe you can replicate the problem using those sources (which once worked).

NOTE: I generally use fonts in styles (using font) and in config constants specified in Ren'Py documentation, but it is a single text font that I use for the game.

@CharlieFuu69
Copy link
Author

Status update:

When creating a new project, the problematic font also does not render properly (using Ren'Py v8.2.1):

Captura de pantalla (368)

@renpytom
Copy link
Member

renpytom@gmail.com.

It's probably a bad font file, but I can take a quick look and see if I can figure out why.

@CharlieFuu69
Copy link
Author

Mail sent (I have indicated the Issue number in the subject for better identification)

@CharlieFuu69
Copy link
Author

CharlieFuu69 commented Mar 14, 2024

Status update:

I confirm correct operation in Ren'Py v8.1.3_23091805. The problematic font in v8.2.1 is visible in the aforementioned version.

image

@renpytom
Copy link
Member

Can you try:

style default:
    shaper "freetype"

And see if that changes anything?

@CharlieFuu69
Copy link
Author

I confirm correct display of the text font in Ren'Py v8.2.1.24030407, by updating style default.

image

@renpytom
Copy link
Member

Sure, though now the question is: Why?

@CharlieFuu69
Copy link
Author

Trust me, I'm not sure how to answer that question 😅😅

It's come back to life, but I honestly don't know why. I try to understand why it has been necessary to use shaper when it was not required before.

Did you find anything strange that was closely related to the source file? I always used it in the operating system, and I never had similar problems.

At the time of the error, I noticed that although the font was not visible in Ren'Py, some stylized strings with outlines showed the text bordered, but without the main colorization of the font.

@renpytom
Copy link
Member

Shaper is a new thing.

Basically, Ren'Py now takes advantage of shaping information in the font, when we didn't before. The command I gave you switched that out to the old information which doesn't. My guess is one of the tables in your font is broken, and it just didn't matter before.

I haven't had a ton of time to investigate this, but at least we're getting there.

@CharlieFuu69
Copy link
Author

Hmm... Maybe I should look at the information that resides in the TTF file. In any case, I think the main problem has been mitigated thanks to your help.

Should I close this Issue, or keep it open in case it is required?

@renpytom
Copy link
Member

Let me keep it open.

@Tymedust
Copy link

Tymedust commented Apr 2, 2024

Hi!

I had a similar issue with the newest Ren'Py version, and while it's resolved now, I was asked by HB38 to mention it here as well.

Adding

shaper "freetype"

to

style default:

Like so:

style default: properties gui.text_properties() language gui.language shaper "freetype"

Worked for me as well in resolving the issue.

What happened for me was the font started looking weird all of a sudden, especially the letters o, s and t. Here's a screenshot comparison (before the update, after the update):

before
after

The font used is called AftaSerifThin-Regular.

I hope this is helpful in some way. :)

@mal
Copy link
Member

mal commented Apr 2, 2024

Specifically in @Tymedust's case:
Those are ligatures, and how the font itself expects to be shown. Entering that sentence using that font into an online font preview tool gives the same visual result. If you've grown accustom to a ligatured font being displayed (technically) incorrectly (without ligatures) then using the freetype shaper is the correct way to revert the behaviour for your game.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants