augusto callejas | 15 Jun 2012 04:15
Favicon

hasdirectionallayout & fonts (openlaszlo 4.9.0, swf10)

hi-

i am using a font in my application, and some of the text views have hasdirectionallayout="true", but the
font doesn't render:

===
<canvas width="100%" height="100%">
        <simplelayout axis="y" spacing="10"/>
        <font name="verdanaBold" src="verdanaBold.ttf"/>
        <text font="verdanaBold">FONT OK</text>
        <text font="verdanaBold" hasdirectionallayout="true">FONT NOT OK</text>
</canvas>
===

the first text view "FONT OK" renders with my verdana bold font, but the second text view "FONT NOT OK" does
not render with my verdana bold font.

how can i use bidirectional text support (via hasdirectionallayout) and custom fonts to work properly?

thanks,
augusto.

augusto callejas | 19 Jun 2012 01:55
Favicon

Re: hasdirectionallayout & fonts (openlaszlo 4.9.0, swf10)

i'm seeing the same problem with inputtext (correct font is displayed in the first inputtext, but not the
second inputtext).

anyone else having this problem?

===
<canvas width="100%" height="100%">
        <font name="mouser" src="mouser.ttf"/>
        <inputtext x="0"  y="0" font="mouser" fontsize="32" height="40" width="100">first</inputtext>
        <inputtext x="0" y="80" font="mouser" fontsize="32" height="40" width="100"
hasdirectionallayout="true" direction="ltr">second</inputtext>
</canvas>
===

On Jun 14, 2012, at 7:15 PM, augusto callejas wrote:

> hi-
> 
> i am using a font in my application, and some of the text views have hasdirectionallayout="true", but the
font doesn't render:
> 
> ===
> <canvas width="100%" height="100%">
>        <simplelayout axis="y" spacing="10"/>
>        <font name="verdanaBold" src="verdanaBold.ttf"/>
>        <text font="verdanaBold">FONT OK</text>
>        <text font="verdanaBold" hasdirectionallayout="true">FONT NOT OK</text>
> </canvas>
> ===
> 
(Continue reading)

Raju Bitter | 19 Jun 2012 05:10

Re: hasdirectionallayout & fonts (openlaszlo 4.9.0, swf10)

The <inputtext> with hasdirectionallayout set to true uses the Adobe
Text-Layout-Framework instead of a simple Flash textfield. TLF based
text components need to embed fonts with an extra property embedAsCFF:
http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7f5f.html

The corresponding attribute on the font tag in OpenLaszlo is
"embedascff". This should work, I've tested with 5.0 trunk.

<canvas width="100%" height="100%">
       <font name="mouser" src="mouser.ttf" embedascff="false"/>
       <font name="mousercff" src="mouser.ttf" embedascff="true"/>
       <inputtext x="0"  y="0" font="mouser" fontsize="32" height="40"
width="100">first</inputtext>
       <inputtext x="0" y="80" font="mousercff" fontsize="32"
height="40" width="100" hasdirectionallayout="true"
direction="ltr">second</inputtext>
</canvas>

- Raju


Gmane