mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:28:11 +00:00
LibGfx/OpenType: Replace a magic number with a calculation
Makes this code look like the corresponding code in the ScaledFont ctor. Similar to the last commit on #20084. No behavior change.
This commit is contained in:
parent
073e2bffcb
commit
17b22250b6
1 changed files with 2 additions and 2 deletions
|
@ -358,8 +358,8 @@ Gfx::ScaledGlyphMetrics Font::glyph_metrics(u32 glyph_id, float x_scale, float y
|
|||
// the pixels-per-em values and the font point size. It appears that bitmaps are not in the same
|
||||
// coordinate space as the head table's "units per em" value.
|
||||
// There's definitely some cleaner way to do this.
|
||||
float x_scale = (point_width * 1.3333333f) / static_cast<float>(data.bitmap_size.ppem_x);
|
||||
float y_scale = (point_height * 1.3333333f) / static_cast<float>(data.bitmap_size.ppem_y);
|
||||
float x_scale = (point_width * DEFAULT_DPI) / (POINTS_PER_INCH * data.bitmap_size.ppem_x);
|
||||
float y_scale = (point_height * DEFAULT_DPI) / (POINTS_PER_INCH * data.bitmap_size.ppem_y);
|
||||
|
||||
return Gfx::ScaledGlyphMetrics {
|
||||
.ascender = static_cast<float>(data.bitmap_size.hori.ascender) * y_scale,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue