shithub: cstory

Download patch

ref: 80df145d3fd3803331cb2870193bf75fcb11a457
parent: b37e088465a8e3c353c8a24aa5b2cf797f377760
author: Clownacy <Clownacy@users.noreply.github.com>
date: Mon Sep 7 23:04:01 EDT 2020

Fix Japanese text

Sweet mercy I'm bad at FreeType2

--- a/src/Font.cpp
+++ b/src/Font.cpp
@@ -1078,8 +1078,8 @@
 
 					font_object->glyph_list_head = NULL;
 
-					size_t atlas_entry_width = (font_object->face->bbox.xMax - font_object->face->bbox.xMin) >> 6;
-					size_t atlas_entry_height = (font_object->face->bbox.yMax - font_object->face->bbox.yMin) >> 6;
+					size_t atlas_entry_width = FT_MulFix(font_object->face->bbox.xMax - font_object->face->bbox.xMin, font_object->face->size->metrics.x_scale) / 64;
+					size_t atlas_entry_height = FT_MulFix(font_object->face->bbox.yMax - font_object->face->bbox.yMin, font_object->face->size->metrics.y_scale) / 64;
 
 					font_object->atlas_row_length = ceil(sqrt(atlas_entry_width * atlas_entry_height * TOTAL_GLYPH_SLOTS) / atlas_entry_width);