Skip to content

Conversation

@devunt
Copy link

@devunt devunt commented Nov 26, 2025

When draw_glyphs() receives a scaled transform (e.g., Affine::scale(2.0)), bitmap glyphs (emoji) render at incorrect positions because:

  1. Glyph position offset was scaled by the transform via pre_translate
  2. But image_scale_factor and font_units_to_size only used unscaled font_size

This caused a position/size mismatch where bitmap glyphs appeared offset from their expected locations, with the error proportional to the scale factor.

Fix

  • Extract scale factor from transform using determinant().abs().sqrt()
  • Compute glyph position in physical coordinates before applying to transform
  • Use scaled font size for image_scale_factor and font_units_to_size calculations

Screenshots

CleanShot 2025-11-26 at 22 30 22 CleanShot 2025-11-26 at 22 28 06

@nicoburns nicoburns added the C-classic Applies to the classic `vello` crate label Dec 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-classic Applies to the classic `vello` crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants