Support color emoji

This commit is contained in:
Jeremy Soller 2022-10-07 12:42:23 -06:00
parent 1651c4f792
commit deb993d9c3
No known key found for this signature in database
GPG key ID: 87F211AF2BE4C2FE
3 changed files with 52 additions and 14 deletions

View file

@ -74,7 +74,14 @@ impl<'a> FontShapeGlyph<'a> {
let offset = Vector::new((x + x_offset).fract(), (y - y_offset).fract());
// Select our source order
let image_opt = Render::new(&[Source::Outline])
let image_opt = Render::new(&[
// Color outline with the first palette
Source::ColorOutline(0),
// Color bitmap with best fit selection mode
Source::ColorBitmap(StrikeWith::BestFit),
// Standard scalable outline
Source::Outline,
])
// Select a subpixel format
.format(Format::Alpha)
// Apply the fractional offset