Text rendering of Unicode text in LC

Mark Waddingham mark at livecode.com
Mon Aug 13 15:58:38 EDT 2018


On 2018-08-13 21:02, Peter Bogdanoff via use-livecode wrote:
> To follow up with my question from yesterday…and to continue with
> Biblical allusions others have begun…
> 
> I’ve descended into <font> hell, which I’m trying get out with some
> light from LiveCode Mark!

Heh - well I can't explain the difference between 8.1.3 and 8.1.9 - 
there's no changes to libgraphics or libskia between those two versions 
(as far as I can see) also with a quick diff of the relevant source 
files I can't see any relevant field changes, or image changes (which 
would be the cause of the vertical stretching of the inline image). 
However, that was just with a 'quick look' so can't say for absolute 
certain.

The main change we made to text rendering was between 8.1.x and 9.0.x - 
when we updated Skia to the latest (at the time) version.

One thing I do notice looking at the text (although I don't read Chinese 
ideographs, so I'm doing this purely on shape and a rather intense 
staring at the LC9 image you provided) is this...

You never seem to get a character which looks the same appearing in 
'bold' and 'non-bold'. Now, this isn't bold and non-bold - this is 
sub-pixel anti-aliased and bitmap I presume.

This makes me think that not all your glyphs are being rendered using 
Songti SC Regular - and you are suffering from 'font fallback'. When the 
chosen font does not contain glyphs that are needed, the 'closest 
matching' font on the system which has those glyphs is used.

If you can determine what ideographs are being rendered seemingly bold 
and non-bold (by Unicode codepoint ideally) - then that might help 
diagnose that (also finding a case where the same ideograph appears once 
as bold and once as non-bold would prove that hypothesis false).

The other odd thing I notice is that the field containing the inline 
images appears to have a slight drift downwards compared to the one 
without. You can try using 'fixedLineHeight' of the fields to solve that 
- all ideographic lines should have the same height (as ideographs are 
traditionally drawn in a fixed grid).

If you can copy and paste the two example fields you have there (with 
relevant image needed for the speaker so it renders) I can take a closer 
look - looking at an image is not the best way to diagnose issues 
really!

Warmest Regards,

Mark.

-- 
Mark Waddingham ~ mark at livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps




More information about the use-livecode mailing list