PDA

View Full Version : compiler chooses wrong fonts and spacing or padding


perlwielder
06-25-2006, 10:02 AM
Hi,

I used the "Open Laszlo in 10 minutes" to successully create and view the SWF file however when I take the same LZX code and compile on SuSE Linux it renders in all web browsers on all platforms incorrectly-- the fonts are not the same and the spacing/padding is increased so that the text in all components are a cropped.

It appears to be something simple but I don't enough experience. Thanks in advance for taking this one.


<canvas width="600" height="600">

<goldstyle name="defaultstyle" isdefault="true"/>



<state name="authenticate" pooling="true" apply="true">
<window x="250" y="100" width="145" height="220" title="Jupiter Media Login" resizable="false" closeable="false">

<form name="login">
<statictext>Username:</statictext>
<edittext name="username" />
<statictext>Password:</statictext>
<edittext name="password" password="true" />
<button isdefault="true" align="center">Login
<handler name="onclick">
parent.parent.parent.authenticate.remove();
parent.parent.parent.authenticated.apply();
</handler>
</button>

</form>

</window>
</state>

<state name="authenticated">

<menubar width="100%">
<menu text="User">
<menuitem text="New User"/>
<menuitem text="Edit User"/>
<menuitem text="Delete User"/>
<menuseparator/>
<menuitem text="Logout"/>
</menu>
<menu text="Location">
<menuitem text="Open..."/>
</menu>
</menubar>

</state>

</canvas>


M-

benjamin
06-27-2006, 10:32 AM
Linux doesn't ship with fonts that Flash expects to have; I knew this caused problems for viewing laszlo apps in linux, but it didn't occur to me that it could cause problems with compiling laszlo apps on linux. I do almost all of my laszlo compilation on various linux machines, and view them on macs and pcs without a problem. So there's a bit of a mystery there.

I think if you use an embedded font, it will work the way you expect it to. Several fonts are included in the distribution. Something like this:

<font name="Arioso" src="ariosor.ttf" />

Then add
font="Arioso"
to your
window declaration.

perlwielder
06-27-2006, 11:12 AM
Hi,

Well the font face changes successfully with your modification however the padding or spacing issue still exists. I should not have to explicitly specify these default padding/spacing values (like the <FONT> tag)? Should I?

Thank you very much in advance!


Sincerely,
Mike :-)



<canvas width="600" height="600">

<goldstyle name="defaultstyle" isdefault="true"/>

<font name="Arioso" src="ariosor.ttf"/>

<state name="authenticate" pooling="true" apply="true">
<window x="250" y="100" width="145" height="220" title="Jupiter Media Login" resizable="false" closeable="false">

<form name="login">
<statictext>Username:</statictext>
<edittext name="username" />
<statictext>Password:</statictext>
<edittext name="password" password="true" />
<button isdefault="true" align="center">Login
<handler name="onclick">
parent.parent.parent.authenticate.remove();
parent.parent.parent.authenticated.apply();
</handler>
</button>

</form>

</window>
</state>

<state name="authenticated">

<menubar width="100%">
<menu text="User">
<menuitem text="New User"/>
<menuitem text="Edit User"/>
<menuitem text="Delete User"/>
<menuseparator/>
<menuitem text="Logout"/>
</menu>
<menu text="Location">
<menuitem text="Open..."/>
</menu>
</menubar>

</state>

</canvas>

benjamin
06-27-2006, 11:57 AM
Originally posted by perlwielder
Hi,

Well the font face changes successfully with your modification however the padding or spacing issue still exists. I should not have to explicitly specify these default padding/spacing values (like the <FONT> tag)? Should I?


What version of LPS are you using? I think we have fought with some text measurement problems in the 3.* releases.

Can you please post a screenshot, so I can see exactly what you're seeing?

A workaround, though: for each of your text objects, set width explicitly to something that you know is wide enough.

perlwielder
06-27-2006, 12:14 PM
Hi,

Here is the screen shot. So, my only solution is to explicting specify a width? You mean padding or spacing right?

Mike

benjamin
06-27-2006, 12:17 PM
I haven't seen quite that rendering problem before.
Try setting a large height on your text fields:
Something like <text height="25" ... /> for 12 point fonts. That will camouflage small errors in text height calculation.

Which version of LPS are you using?

perlwielder
06-27-2006, 12:30 PM
Hi,

Should I try an earlier version? I need to demo a "proof of concept" to "decions makers" with in a month.

Thanks for your prompt reply. That will be an important factor during intial development.

Mike


<canvas width="600" height="600">

<goldstyle name="defaultstyle" isdefault="true"/>

<font name="Arioso" src="ariosor.ttf"/>

<state name="authenticate" pooling="true" apply="true">
<window x="250" y="100" width="145" height="220" title="Jupiter Media Login" resizable="false" closeable="false">

<form name="login">
<statictext>Username:</statictext>
<edittext name="username" />
<statictext>Password:</statictext>
<edittext name="password" password="true" />
<button isdefault="true" align="center">Login
<handler name="onclick">
parent.parent.parent.authenticate.remove();
parent.parent.parent.authenticated.apply();
</handler>
</button>

</form>

</window>
</state>

<state name="authenticated">

<menubar width="100%">
<font name="Arioso" src="ariosor.ttf"/>
<menu text="User">
<menuitem text="New User"/>
<menuitem text="Edit User"/>
<menuitem text="Delete User"/>
<menuseparator/>
<menuitem text="Logout"/>
</menu>
<menu text="Location">
<menuitem text="Open..."/>
</menu>
</menubar>

</state>

</canvas>

benjamin
06-27-2006, 05:37 PM
How about trying the latest nightly build?
http://download.openlaszlo.org/nightly/1184-openlaszlo-trunk/openlaszlo-3.3.x-unix.tar.gz

We've been doing a lot of work on text measurement in the legals release, but the components aren't supported there yet.
http://www.openlaszlo.org/legals

Posting to the laszlo-dev mailing list generally gets faster answers than to the forums; we also have support contracts available, and we can probably work something out that's appropriate for your requirements. I'll have someone from sales@laszlosystems.com contact you.

Originally posted by perlwielder
Hi,

Should I try an earlier version? I need to demo a "proof of concept" to "decions makers" with in a month.

Thanks for your prompt reply. That will be an important factor during intial development.

Mike

perlwielder
06-28-2006, 09:32 AM
Hi,

I'm not sure I understand "specifically" how this might resolve the issue I'm experiencing. Other than using the "latest and greatest" how might exactly this help?

Again thank you very much for your reply!

Mike

benjamin
06-28-2006, 12:11 PM
Let's move this thread to laszlo-dev
http://www.openlaszlo.org/mailman/listinfo/laszlo-dev

The Open Laszlo server works on linux, windows, and mac os x. Laszlo apps can be viewed anywhere there's a Flash player, swf7 or higher.

benjamin
06-28-2006, 12:19 PM
Originally posted by perlwielder
I'm not sure I understand "specifically" how this might resolve the issue I'm experiencing. Other than using the "latest and greatest" how might exactly this help?


Well, the issue you're seeing may have been fixed in the "trunk" line of development, but not yet included in an official release. I'm not sure whether we have a bug filed on this particular issue , because I don't have enough information to entirely characterize the problem.

Also, please look through the bug database,http://www.openlaszlo.org/jira and find a matching issue, then it becomes easier for us to identify if and when we think we've fixed it. The bug database often suggests workarounds, too.

But, as I said before, please move this thread to laszlo-dev.

-benjamin