freemint / fvdi

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

Fix ft2_vst_point #15

Closed chrisridd closed 2 years ago

chrisridd commented 2 years ago

There is an end-of-values marker in the sizes array, aka -1. The old search loop wasn't detecting that, so consequently could just walk off the end of the sizes array.

It also meant that searching for a size > the biggest size in the array would end up matching 0, because the sizes array in loader is padded with zeros.

I noticed this using QED's Font dialog, which calls out to Teradesk's font selector in my config - I was unable to choose any font size for a TTF apart from 10, and Aranym's stderr was filled with "Attempt to load metrics with bad point size!" messages.

With the fix, searching for ptsize will return the nearest size <= it. Searching for sizes smaller than sizes[0] will just return sizes[0]. This seems to match NVDI.