As you may be aware, I've been wrestling with support for surrogate pairs 
encoding Unicode supplementary plane glyphs on Win32 recently (though I may now 
be seeing some light at the end of that tunnel..)

Yesterday my new mac arrived (running 10.6.7) and this is my first non-PPC mac.

I spent a little time running my surrogate pair tests on this Mac, using the 
same test fonts as on Linux and WinXX and the results have been interesting.

Generally, the OSX port seems to be handling it pretty well, the actual 
rendering of the glyphs seems generally good.

Measuring the glyphs (fl_measure, width, text_extents) has been more variable.

In general, on linux, both fl_measure and fl_text_extents have worked OK for 
the supplementary plane glyphs.

On win32, measure works, but text_extents has been "tricky" - though I think I 
now have a way to make that adequate, if not good.

The bizarre thing is that, with my test fonts, on OSX text_extents os working 
fine, but measure/width are returning wrong widths. Not yet sure why, but 
appears to be font specific, some fonts are good, others are bad. May be 
related to kerning or something, though the amount by which it is out seems too 
large to just be kerning...

Also, measuring the width of glyphs on OSX is very fragile; rather than using 
our "errors to 8859" workaround, it measures the UTF8 string directly, and 
faults if the UTF8 is malformed (this of course is what causes the tooltips 
fault reported elsewhere, but may also cause any use of fl_measure to choke in 
the same way.)

I guess we need to make the behave the same as the rest of fltk - in particular 
you can create and display a string, but if you then try to measure it, 
segfault... I guess the tooltip code measures its string to know how big a 
popup window to make, and that's where it all goes pear-shaped.

Thoughts? Is it likely that the WOrkaround proposed by Albrecht, viz we convert 
from UTF8 to UTF16 using our own method, and hence getting the benefit of the 
"errors to 8859 / errors to cp125x" hacks, then convert/measure the UTF16 
string instead?

-- 
Ian



_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to