Skip to content

Commit

Permalink
fonts: svg: half-assed attempt to set the y-bearing
Browse files Browse the repository at this point in the history
This is not right, but better than not setting it.
  • Loading branch information
wez committed Aug 15, 2023
1 parent edbf4ac commit b365225
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion wezterm-font/src/rasterizer/freetype.rs
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,8 @@ fn svg_preset_slot_impl(
let dimension_y = pixmap_size.height() as f64 * y_svg_to_out;

slot.bitmap_left = 0;
slot.bitmap_top = 0;
slot.bitmap_top = dimension_y as i32; // This sets the y-bearing. It is incorrect,
// but better than using 0
slot.bitmap.rows = dimension_y as _;
slot.bitmap.width = dimension_x as _;
slot.bitmap.pitch = (dimension_x as i32) * 4;
Expand Down

0 comments on commit b365225

Please sign in to comment.