Open chrisridd opened 2 years ago
Hmmm. Merged too early, I suppose. Your changes broke applications that were working fine before. Font sizes aren't calculated correctly anymore and are rendered much too small.
What is supposed to look like this
before, now looks like this
Text is rendered using vst_font()
, vst_height()
and v_ftext()
(while using v_gtext()
instead doesn't change anything).
The sources for my test program are here: https://github.com/mfro0/libcmini-examples , if it helps.
@chrisridd Can you look into it again please to see if there is an easy fix? Otherwise I probably need to revert your changes.
Thanks for the test case! I will look later today. While working on the commit I had noticed Papyrus was using vst_height()
with the system font and misbehaving, but the fix for that was clearly insufficient. Good catch.
Looks like a one line fix. PR #37 out for review.
🤞
While fvdi supports the
v_ftext()
etc calls from SpeedoGDOS that use fractional advances (i.e. internally they move the pen position using fractional pixels) actually it just ends up callingv_gtext()
which uses integer advances.It seems NVDI 5 supports both calls correctly, as can be seen by comparing text rendered using
v_gtext()
(top),v_ftext()
(middle) and overlayed for illustration (bottom):Clearly as you render longer lines the errors accumulate.
FreeType uses fractional fixed-point values internally, so it should be possible to expose this through fvdi using the SpeedoGDOS
fix31
type.A brief review of the fvdi code suggests this would require quite changing quite a lot of existing assembler. VDI calls that would certainly need changing include:
v_getbitmap_info()
vqt_advance32()
andvqt_advance()
vqt_pairkern()
andvqt_trackkern()
(there's no kerning support currently)vst_arbpt32()
vst_setsize32()
v_ftext()
and all variants.vqt_f_extent()
This might mean adding
fix31
versions of various existingFontheader
fields such assize
(short) intoFontextra
. Presumably an application can usevst_arbpt32()
and then usev_gtext()
so it would mean modifying existing non-fix31 code as well.