increase the height FreeType uses to draw glyphs in order to preserve precision of very fine features when converted to FC wires. scale the result back down appropriately.

This commit is contained in:
jim
2022-10-16 10:48:52 -07:00
committed by WandererFan
parent 1ae780d3b1
commit fe165ea3da

View File

@@ -155,7 +155,7 @@ PyObject* FT2FC(const Py_UNICODE *PyUString,
// This sets size to 48 point. Magic.
error = FT_Set_Char_Size(FTFont,
0, /* char_width in 1/64th of points */
48*64, /* char_height in 1/64th of points */
480*64, /* char_height in 1/64th of points */
0, /* horizontal device resolution */
0 ); /* vertical device resolution */
if (error) {
@@ -163,7 +163,7 @@ PyObject* FT2FC(const Py_UNICODE *PyUString,
throw std::runtime_error(ErrorMsg.str());
}
scalefactor = stringheight/float(FTFont->height);
scalefactor = (stringheight/float(FTFont->height))/10;
for (i=0; i<length; i++) {
currchar = PyUString[i];
error = FT_Load_Char(FTFont,