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

Can blend2d notify which char is not found? #154

Open
miaotianlei opened this issue Oct 10, 2022 · 4 comments
Open

Can blend2d notify which char is not found? #154

miaotianlei opened this issue Oct 10, 2022 · 4 comments

Comments

@miaotianlei
Copy link

Today I render text, a char shows X with box. I want to blend2d can tell me which char can't be found, I try to change font to render it.

@kobalicek
Copy link
Member

kobalicek commented Oct 10, 2022

There is this function:

BLResult BLFont::mapTextToGlyphs(BLGlyphBufferCore& gb, BLGlyphMappingState& stateOut) const

When you use it the BLGlyphMappingState would contain the position of the first undefined glyph, is that sufficient?

@miaotianlei
Copy link
Author

The function only can tell me the first undefine char, How to get all undefine chars?

@kobalicek
Copy link
Member

kobalicek commented Oct 11, 2022

Yeah, mapTextToGlyphs() is good for initial feedback.

To get all supported characters, use BLResult BLFontFace::getCharacterCoverage(BLBitSetCore* out) const - you would have to iterate your input string though, and determine which character is not in the BitSet.

@miaotianlei
Copy link
Author

Please provide an example about the function. I don't know how to use it. Thank you.

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

2 participants