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

[fontmap] update Replacer for string normalization by handling null byte removal #171

Closed
wants to merge 1 commit into from

Conversation

akiyosi
Copy link
Contributor

@akiyosi akiyosi commented Oct 27, 2024

I have confirmed that the deserialized font family name contains \x00 (e.g. MS Gothic).
This is why there is a problem with fontmap.FindSystemFonts() not matching even though the correct font name is specified.
This PR is one idea to address this problem, but where to put the normalization process may be debatable.

@akiyosi
Copy link
Contributor Author

akiyosi commented Oct 28, 2024

Hmmm, since the test is failing, would it be better to normalize the footprint.Family in FindSystemFont(). 🤔

@benoitkugler
Copy link
Contributor

Hi,

It seems indeed reasonnable to ignore termination bytes when comparing family names. Thank you for adressing that point.

I'm not entirely sure how to do so, I need to think about your fix a bit deeper first.

Regarding the tests, could you rather add new ones ?

This was referenced Nov 3, 2024
@benoitkugler
Copy link
Contributor

After investigation, there was actually a deeper issue. I've opened #172 and #173, superseding this PR.

@akiyosi
Copy link
Contributor Author

akiyosi commented Nov 4, 2024

@benoitkugler
Thanks for the investigation. Hopefully better improvements will be made on this issue!

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

Successfully merging this pull request may close these issues.

2 participants