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

Open
wants to merge 1 commit into
base: main
Choose a base branch
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 ?

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