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

Add font.glyph_to_string to README.md #178

Merged
merged 2 commits into from
Nov 17, 2023
Merged

Add font.glyph_to_string to README.md #178

merged 2 commits into from
Nov 17, 2023

Conversation

roberto-arista
Copy link
Contributor

No description provided.

@anthrotype
Copy link
Member

anthrotype commented Nov 17, 2023

there seems to be two methods that do the same thing (convert a gid to a glyph name), i.e. hb_font_get_glyph_name and hb_font_glyph_to_string, I wonder why and what's the diff /cc @khaledhosny @behdad

@khaledhosny
Copy link
Collaborator

there seems to be two methods that do the same thing (convert a gid to a glyph name), i.e. hb_font_get_glyph_name and hb_font_glyph_to_string, I wonder why and what's the diff /cc @khaledhosny @behdad

hb_font_glyph_to_string() always returns a string and will synthesize a name (gidNNN) if there is no glyph name, while hb_font_get_glyph_name() only returns glyph names if present.

@anthrotype
Copy link
Member

ok thanks. So I suppose get_glyph_name() here is appropriate in the README and we can merge this?

@khaledhosny
Copy link
Collaborator

For uses like this, font.glyph_to_string() is preferable, as font.get_glyph_name() can return None.

@anthrotype
Copy link
Member

right ok, @roberto-arista can you use glyph_to_string() instead? thanks!

@roberto-arista
Copy link
Contributor Author

done!

@anthrotype anthrotype changed the title Add font.get_glyph_name to README.md Add font.glyph_to_string to README.md Nov 17, 2023
@anthrotype anthrotype merged commit 28ff0cb into harfbuzz:main Nov 17, 2023
3 checks passed
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.

3 participants