修复stb_truetype大小与freetype不一致

This commit is contained in:
daiqingshuang 2025-04-02 11:03:36 +08:00
parent 73eebd5387
commit 4d0dbbe6c5

View File

@ -17,7 +17,7 @@ public:
[[nodiscard]] glyph_shaped_t shape_glyph(uint32_t in_glyph_id) const override;
[[nodiscard]] float get_scale_for_pixel_height(float font_size) const {
return stbtt_ScaleForPixelHeight(&font_info_, font_size);
return stbtt_ScaleForMappingEmToPixels(&font_info_, font_size);
}
protected:
bool on_load() override;