Skip to content

Commit

Permalink
capture emoji state in outer condition
Browse files Browse the repository at this point in the history
  • Loading branch information
dfrg committed May 22, 2024
1 parent b0e6520 commit 96371b1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/shape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,8 @@ impl<'a, 'b, B: Brush> partition::Selector for FontSelector<'a, 'b, B> {
fn select_font(&mut self, cluster: &mut CharCluster) -> Option<Self::SelectedFont> {
use fontique::QueryFamily;
let style_index = cluster.user_data() as u16;
if style_index != self.style_index {
let is_emoji = cluster.info().is_emoji();
if style_index != self.style_index || is_emoji {
self.style_index = style_index;
let style = &self.styles[style_index as usize].style;
let fonts_id = style.font_stack.id();
Expand All @@ -224,7 +225,7 @@ impl<'a, 'b, B: Brush> partition::Selector for FontSelector<'a, 'b, B> {
};
let variations = self.rcx.variations(style.font_variations).unwrap_or(&[]);
let features = self.rcx.features(style.font_features).unwrap_or(&[]);
if cluster.info().is_emoji() {
if is_emoji {
let fonts = self.rcx.stack(style.font_stack).unwrap_or(&[]);
let fonts = fonts.iter().map(|id| QueryFamily::Id(*id));
self.query
Expand Down

0 comments on commit 96371b1

Please sign in to comment.