Here are some font-related issues I ran across porting the 
explorer-nav.lzx to DHTML:

1) Since DHTML doesn't support compiled fonts, we have to rely on system 
fonts unless we use a system like SIFR - see 
http://www.mikeindustries.com/sifr/ .  This means fonts will not look 
exactly the same across runtimes unless we use only system fonts, and 
even then letter spacing and rendering/smoothing is often different.

For now, I added a feature to the  SWF kernel to support the lookup of 
comma-separated fonts so DHTML can fall back to a system font when a 
compiled font isn't found by name.  For example, 
font="itemfont,helvetica,sans-serif" now finds the compiled font 
'itemfont' in SWF and falls back to 'helvetica,sans-serif' in DHTML. 
Note that 'itemfont' is really 'helmet-bold', a helvetica bold variant, 
so the weight and font are not the same.  Also note that the compiled 
font declaration doesn't identify the style is bold, so matching the 
weight (bold) will require changes here.

2) DHTML font size measurement doesn't currently account for leading and 
SWF does.  For example, 13pt type is 20 px high in swf, and 13px high in 
DHTML.  This was easy to fix in explorer-nav - I just changed the label 
positioning to use valign="middle" instead of hard-coded y values.  I 
need to file a bug for this issue - I'll do this later on, after I've 
slept a bit.

3) Small type isn't smoothed in DHTML like it is in SWF.  I'm not sure 
what to do here, except choose our fonts carefully and/or avoid small 
point sizes.

The bottom line is, I don't think we can expect pixel-perfect font 
rendering across all runtimes.  However, with minimal changes for 
alignment and font names, I was able to make explorer-nav look pretty 
good across SWF and DHTML, at least to my eye.

Regards,
Max Carlson
OpenLaszlo.org

_______________________________________________
Laszlo-dev mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-dev

Reply via email to