-
Notifications
You must be signed in to change notification settings - Fork 17
Check the presence of glyphs when selecting font #106
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
Conversation
Signed-off-by: MuHong Byun <mh.byun@samsung.com> Co-authored-by: Boram Bae <boram21.bae@samsung.com>
Signed-off-by: MuHong Byun <mh.byun@samsung.com> Co-authored-by: Boram Bae <boram21.bae@samsung.com>
Signed-off-by: MuHong Byun <mh.byun@samsung.com> Co-authored-by: Boram Bae <boram21.bae@samsung.com>
Signed-off-by: MuHong Byun <mh.byun@samsung.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you need to re-enable fontconfig in azure-pipelines.
if (utf16Pos == 0 || family.get() != lastFamily) { | ||
|
||
if (utf16Pos == 0 || family.get() != lastFamily || | ||
family.get()->getLastMatchedCodePoint() != ch) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This algorithm tries to reuse the already selected font as much as possible.
I think that using only one codepoint cached causes too much execution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. Maybe I should use map for this.
@@ -528,8 +530,8 @@ void FontCollection::itemize(const uint16_t* string, | |||
} | |||
start -= prevChLength; | |||
} | |||
result->push_back( | |||
{family->getClosestMatch(style), static_cast<int>(start), 0}); | |||
result->push_back({family->getClosestMatchWithChar(style, ch), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we also use variant to check glyphs?
result = hb_font_get_glyph(hb_font, codepoint, variant, &unusedGlyph);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't know about variant selector
, so I looked it up. I think you're right. 😄
@@ -164,6 +164,46 @@ FakedFont FontFamily::getClosestMatch(FontStyle style) const { | |||
return FakedFont{nullptr, FontFakery()}; | |||
} | |||
|
|||
FakedFont FontFamily::getClosestMatchWithChar(FontStyle style, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The core algorithm is similar to FakedFont FontFamily::getClosestMatch(FontStyle style)
I think you can make one nice method for these two.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok~ Thanks!
Signed-off-by: MuHong Byun <mh.byun@samsung.com>
@bwikbs |
…, it is checked more. Signed-off-by: MuHong Byun <mh.byun@samsung.com> Co-authored-by: Boram Bae <boram21.bae@samsung.com>
@bbrto21 I put your implementation as a patch. As you said, there seems to be no problem. Thanks. 👍 |
Signed-off-by: MuHong Byun <mh.byun@samsung.com>
@bwikbs @HakkyuKim |
Signed-off-by: MuHong Byun <mh.byun@samsung.com>
No matter how much I think about it, I can't find an answer, so I made a workaround that the emoji goes backwards when sorting. |
Go on #113 |
No description provided.