Skip to main content

calculate_bitmap_transform

Function calculate_bitmap_transform 

Source
fn calculate_bitmap_transform(
    glyph: Glyph,
    pixmap: &Pixmap,
    draw_props: DrawProps,
    font_size: f32,
    upem: f32,
    bitmap_glyph: &BitmapGlyph<'_>,
    bitmaps: &BitmapStrikes<'_>,
) -> Affine
Expand description

Calculate transform for bitmap glyphs.

This computes the final positioning transform for a bitmap glyph, taking into account:

  • Glyph position within the run
  • Bitmap scaling to match requested font size
  • Bearing adjustments (outer and inner)
  • Origin placement (top-left vs bottom-left)
  • Special handling for Apple Color Emoji