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

Font::supports_emoji should consider existence of COLR/CPAL tables #43

Closed
ctrlcctrlv opened this issue Apr 3, 2021 · 2 comments
Closed

Comments

@ctrlcctrlv
Copy link

Just asking if the font has embedded images, as is currently done—

allsorts/src/font.rs

Lines 620 to 625 in fef3d22

pub fn supports_emoji(&mut self) -> bool {
match self.embedded_images() {
Ok(Some(_)) => true,
_ => false,
}
}

Is insufficient. Fonts may have embedded images, and only put them in the Latin range. Fonts may have no embedded images, but support emoji via COLR/CPAL—that's more common today on non-Apple platforms, actually.

Just an FYI.

@wezm
Copy link
Contributor

wezm commented Apr 5, 2021

Yes this method is perhaps poorly named. It's used by other code to determine when it should attempt to try to retrieve embedded images. Since we don't currently support COLR/CPAL it doesn't make sense to return true for that case. And you're right that embedded images may exist for non-emoji glyphs. I'll come up with a better name.

@wezm wezm closed this as completed Apr 6, 2021
@wezm
Copy link
Contributor

wezm commented Apr 6, 2021

Fixed in 7308f27

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