freemint / fvdi

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

vqt_xfntinfo() and vqt_name() look up fonts inconsistently #22

Closed chrisridd closed 2 years ago

chrisridd commented 2 years ago

vqt_name() looks up fonts by the index.

vqt_xfntinfo() can look up fonts by their id, or by their index. However the algorithm for looking up by index was different to vqt_name()s.

Refactor the lookup logic so they both look up the same way. Optimise vqt_xfntinfo() to not traverse the font list twice.

chrisridd commented 2 years ago

If you looked up by index, i.e.

    vqt_xfntinfo(handle, 0x0f, 0, 10, &xfntinfo); // index 10

You'd get details for the next font in the list!

chrisridd commented 2 years ago

I think there are some other places in textlib.c that could use the same find_font_by_xxx() functions. I'll do those and update the PR.

chrisridd commented 2 years ago

I have also updated vst_font().