freemint / fvdi

fVDI fork with additional fixes and drivers.
https://fvdi.sourceforge.io
7 stars 6 forks source link

Set font->distance from face->size->metrics ascender and descender #26

Closed chrisridd closed 2 years ago

chrisridd commented 2 years ago

After calling FT_Set_Char_Size() the face->size->metrics.ascender and descender fields are filled in with what look like the top and bottom distances, in pixels.

Using these gives very consistent baseline alignment across multiple fonts.

The face->size->metrics.height field is effectively the line height, so is not what is needed for the font->height field, which looks like it is the height of the MFDB buffer instead. So we set this to the sum of the ascender and descender.

chrisridd commented 2 years ago

This fixes issue #25 for me, and seems to behave OK in Papyrus and Atari Works. This does change some fairly fundamental fields so the more testing the better IMO. Is there another good font torture test app?

mfro0 commented 2 years ago

yes, that definitely looks more exact.

Thank you for your contribution!