Author: jsundman
Date: 2007-05-17 09:04:25 -0700 (Thu, 17 May 2007)
New Revision: 5067
Modified:
openlaszlo/branches/legals/docs/src/developers/constraints.dbk
openlaszlo/branches/legals/docs/src/developers/fonts.dbk
Log:
updating constraints chapter to new example markup
Modified: openlaszlo/branches/legals/docs/src/developers/constraints.dbk
===================================================================
--- openlaszlo/branches/legals/docs/src/developers/constraints.dbk
2007-05-17 15:44:13 UTC (rev 5066)
+++ openlaszlo/branches/legals/docs/src/developers/constraints.dbk
2007-05-17 16:04:25 UTC (rev 5067)
@@ -42,7 +42,14 @@
runtime. You'll see that the <literal>setConstraint</literal> method has the
same effect as the simple expression <literal>y=${m.y}</literal>
</para>
-<example role="live-example"><title>Runtime constraints with
applyConstraint</title><programlisting
role="lzx-embednew"><filename>constraints-$1.lzx</filename><parameter/><code>
+
+<example role="live-example">
+ <title>Runtime constraintes with applyConstraint</title>
+ <programlisting language="lzx">
+ <textobject><textdata fileref="constraints-$1.lzx"/></textobject>
+ </programlisting>
+</example>
+<?example role="live-example"><title>Runtime constraints with
applyConstraint</title><programlisting
role="lzx-embednew"><filename>constraints-$1.lzx</filename><parameter/><code>
<canvas>
<view x="250" width="20" height="20" bgcolor="red"
y="${m.y}"/>
@@ -78,7 +85,7 @@
<window id="m" x="10" title="Drag me" width="160" height="20"/>
</canvas>
-</programlisting><?lzx-edit programs/constraints-$1.lzx?></example>
+</programlisting><?lzx-edit programs/constraints-$1.lzx></example?>
<para><literal>f</literal> is a callback function that is required for the
<indexterm><primary><literal>applyConstraint()</literal>
method</primary></indexterm><methodname>applyConstraint()</methodname> method.
<varname>d</varname>
is an array consisting of a pointer to a reference node, and the attribute to
bind to.</para>
@@ -165,7 +172,13 @@
the visibility of the blue square automatically switches as
well.</para>
-<example role="live-example" id="ex.constraints.1"><title>An element appears
when a checkbox is set</title><programlisting
role="lzx-embednew"><filename>ex.constraints.1.lzx</filename><parameter/><code>
+<example role="live-example">
+ <title>An element appears when a checkbox is set</title>
+ <programlisting language="lzx">
+ <textobject><textdata fileref="ex.constraints.1.lzx"/></textobject>
+ </programlisting>
+</example>
+<?example role="live-example" id="ex.constraints.1"><title>An element appears
when a checkbox is set</title><programlisting
role="lzx-embednew"><filename>ex.constraints.1.lzx</filename><parameter/><code>
<canvas height="120">
<checkbox id="cb" text="Show Blue Square"/>
<view visible="${cb.value}"
@@ -179,7 +192,7 @@
width="30" height="30" bgcolor="blue"/>
<simplelayout/>
</canvas>
-</programlisting><?lzx-edit programs/ex.constraints.1.lzx?></example>
+</programlisting><?lzx-edit programs/ex.constraints.1.lzx></example?>
<para>In the example below, the position of the blue square is connected
to the position of the mouse. If you move the mouse inside the
@@ -188,7 +201,13 @@
expression includes a method call, but it works in the same way as the
simple attribute expression in <xref linkend="ex.constraints.1"/>.</para>
-<example role="live-example" id="ex.constraints.2"><title>Constrain to Mouse
Position</title><programlisting
role="lzx-embednew"><filename>ex.constraints.2.lzx</filename><parameter/><code>
+<example role="live-example">
+ <title>Constrain to mouse position</title>
+ <programlisting language="lzx">
+ <textobject><textdata fileref="ex.constraints.2.lzx"/></textobject>
+ </programlisting>
+</example>
+<?example role="live-example" id="ex.constraints.2"><title>Constrain to Mouse
Position</title><programlisting
role="lzx-embednew"><filename>ex.constraints.2.lzx</filename><parameter/><code>
<canvas height="120">
<view bgcolor="blue" width="40" height="40"
x="${parent.getMouse('x')}"
@@ -200,7 +219,7 @@
x="${parent.getMouse('x')}"
y="${parent.getMouse('y')}"/>
</canvas>
-</programlisting><?lzx-edit programs/ex.constraints.2.lzx?></example>
+</programlisting><?lzx-edit programs/ex.constraints.2.lzx></example?>
<para>The constraint expression may be almost any Javascript expression. For
example, you could change the y value in example <xref
linkend="ex.constraints.1"/> to
@@ -250,7 +269,13 @@
<para>Experiment with the working example below to see multiple dependencies
in action. Resizing the window
will resize the blue bar. You can also move the slider to adjust the border
size.</para>
-<example role="live-example"><title>Multiple
Dependencies</title><programlisting
role="lzx-embednew"><filename>constraints-$10.lzx</filename><parameter/><code>
+<example role="live-example">
+ <title>Multiple Dependencies</title>
+ <programlisting language="lzx">
+ <textobject><textdata fileref="constraints-$10.lzx"/></textobject>
+ </programlisting>
+</example>
+<?example role="live-example"><title>Multiple
Dependencies</title><programlisting
role="lzx-embednew"><filename>constraints-$10.lzx</filename><parameter/><code>
<canvas height="300" width="700">
<window width="400" height="200" resizable="true">
<attribute name="bordersize" value="${editor.bordersize.value}"/>
@@ -284,7 +309,7 @@
</window>
</canvas>
-</programlisting><?lzx-edit programs/constraints-$10.lzx?></example>
+</programlisting><?lzx-edit programs/constraints-$10.lzx></example?>
<para/></section><section><title>Circular Constraints</title>
@@ -293,7 +318,13 @@
For example, in the Laszlo application below, the <literal>y</literal> values
of the red and blue squares are constrained to each other.
</para>
-<example role="live-example"><title>Circular
Constraints</title><programlisting
role="lzx-embednew"><filename>constraints-$11.lzx</filename><parameter/><code>
+<example role="live-example">
+ <title>Circular constraints</title>
+ <programlisting language="lzx">
+ <textobject><textdata fileref="constraints-$11.lzx"/></textobject>
+ </programlisting>
+</example>
+<?example role="live-example"><title>Circular
Constraints</title><programlisting
role="lzx-embednew"><filename>constraints-$11.lzx</filename><parameter/><code>
<canvas height="120">
<view name="redview" bgcolor="red"
onmousedown="gragger.apply()" onmouseup="gragger.remove()"
@@ -321,7 +352,7 @@
</view>
<simplelayout spacing="40" axis="x"/>
</canvas>
-</programlisting><?lzx-edit programs/constraints-$11.lzx?></example>
+</programlisting><?lzx-edit programs/constraints-$11.lzx></example?>
<para>
How does it work? When you drag
@@ -512,4 +543,4 @@
<para>
The bottom line is that the constraint calculator is not really designed to be
used in functions. It
works for many situations, but not for anything complex.</para>
-<para/></section></chapter>
\ No newline at end of file
+<para/></section></chapter>
Modified: openlaszlo/branches/legals/docs/src/developers/fonts.dbk
===================================================================
--- openlaszlo/branches/legals/docs/src/developers/fonts.dbk 2007-05-17
15:44:13 UTC (rev 5066)
+++ openlaszlo/branches/legals/docs/src/developers/fonts.dbk 2007-05-17
16:04:25 UTC (rev 5067)
@@ -82,7 +82,14 @@
<para>
By default, OpenLaszlo applications use the device fonts.
</para>
-<example role="live-example"><title>using device fonts</title><programlisting
role="lzx-embednew"><filename>fonts-$1.lzx</filename><parameter/><code>
+
+<example role="live-example">
+ <title>Using device fonts</title>
+ <programlisting language="lzx">
+ <textobject><textdata fileref="fonts-$1.lzx"/></textobject>
+ </programlisting>
+</example>
+<?example role="live-example"><title>using device fonts</title><programlisting
role="lzx-embednew"><filename>fonts-$1.lzx</filename><parameter/><code>
<canvas>
<window title="Fonts are fun!" width="400" height="400"
resizable="true">
<view width="500">
@@ -198,7 +205,7 @@
<scrollbar axis="y"/>
</window>
</canvas>
-</programlisting><?lzx-edit programs/fonts-$1.lzx?></example>
+</programlisting><?lzx-edit programs/fonts-$1.lzx></example?>
<para> You can override the default font by redefining the default font on
the <indexterm><primary>canvas tag</primary></indexterm><sgmltag
class="element"><canvas></sgmltag><remark role="fixme">[unknown
tag]</remark>
<!--unknown tag: canvas-->
.
@@ -206,7 +213,14 @@
<!--unknown tag: canvas-->
itself—you cannot do it using an attribute tag.
</para>
-<example role="live-example"><title>setting default tag on the
canvas</title><programlisting
role="lzx-embednew"><filename>fonts-$2.lzx</filename><parameter/><code>
+
+<example role="live-example">
+ <title>setting the default font on the canvas</title>
+ <programlisting language="lzx">
+ <textobject><textdata fileref="fonts-$2.lzx"/></textobject>
+ </programlisting>
+</example>
+<?example role="live-example"><title>setting default tag on the
canvas</title><programlisting
role="lzx-embednew"><filename>fonts-$2.lzx</filename><parameter/><code>
<canvas width="500" height="100" bgcolor="gray" font="default"
fontsize="8">
<font name="default" src="verity/verityplus11.ttf"/>
<text >default Foobar the quick brown frotz jumped over the bad
music</text>
@@ -222,7 +236,7 @@
<text font="Verdana">Verdana Foobar the quick brown frotz jumped
over the bad music</text>
<simplelayout />
</canvas>
-</programlisting><?lzx-edit programs/fonts-$2.lzx?></example>
+</programlisting><?lzx-edit programs/fonts-$2.lzx></example?>
<para/></section></section><section><title condition="swf">OpenLaszlo
"pseudo-pixel" fonts</title>
@@ -256,7 +270,13 @@
<para>
For example,
</para>
-<example role="live-example"><title>Using the font
attribute</title><programlisting
role="lzx-embednew"><filename>fonts-$3.lzx</filename><parameter/><code>
+<example role="live-example">
+ <title>Using the font attribute</title>
+ <programlisting language="lzx">
+ <textobject><textdata fileref="fonts-$3.lzx"/></textobject>
+ </programlisting>
+</example>
+<?example role="live-example"><title>Using the font
attribute</title><programlisting
role="lzx-embednew"><filename>fonts-$3.lzx</filename><parameter/><code>
<canvas>
<simplelayout/>
<view font="helvetica">
@@ -276,7 +296,7 @@
<text>Howdy back!</text>
</view>
</canvas>
-</programlisting><?lzx-edit programs/fonts-$3.lzx?></example>
+</programlisting><?lzx-edit programs/fonts-$3.lzx></example?>
<para/><section><title>Specifying more than one font</title>
<para>
You can supply more than one font name as argument to the font attribute. At
runtime, the system will try the font list from left to right and use the first
one it finds. This can come in handy if you have an application that you would
like to compile to both SWF and DHTML.
@@ -316,7 +336,14 @@
<para>OpenLaszlo does not implement generic font family definitions, but it
does not preclude them nor is it incompatible with them
(as described below).
</para>
-<example role="live-example"><title>Default font</title><programlisting
role="lzx-embednew"><filename>fonts-$4.lzx</filename><parameter/><code>
+
+<example role="live-example">
+ <title>Default font</title>
+ <programlisting language="lzx">
+ <textobject><textdata fileref="fonts-$4.lzx"/></textobject>
+ </programlisting>
+</example>
+<?example role="live-example"><title>Default font</title><programlisting
role="lzx-embednew"><filename>fonts-$4.lzx</filename><parameter/><code>
<canvas height="40">
<text>Hello World</text>
</canvas>
@@ -324,11 +351,18 @@
<canvas height="40">
<text>Hello World</text>
</canvas>
-</programlisting><?lzx-edit programs/fonts-$4.lzx?></example>
+</programlisting><?lzx-edit programs/fonts-$4.lzx></example?>
<para>
This renders Hello World in a client font.
</para>
-<example role="live-example"><title>Default font with non-default font
size</title><programlisting
role="lzx-embednew"><filename>fonts-$5.lzx</filename><parameter/><code>
+
+<example role="live-example">
+ <title>Default font with non-default font size</title>
+ <programlisting language="lzx">
+ <textobject><textdata fileref="fonts-$5.lzx"/></textobject>
+ </programlisting>
+</example>
+<?example role="live-example"><title>Default font with non-default font
size</title><programlisting
role="lzx-embednew"><filename>fonts-$5.lzx</filename><parameter/><code>
<canvas height="100">
<text fontsize="24">Hello World</text>
</canvas>
@@ -336,11 +370,18 @@
<canvas height="100">
<text fontsize="24">Hello World</text>
</canvas>
-</programlisting><?lzx-edit programs/fonts-$5.lzx?></example>
+</programlisting><?lzx-edit programs/fonts-$5.lzx></example?>
<para>
This renders Hello World in a larger client font, with no jaggies.
</para>
-<example role="live-example"><title>Equivalence of generic and defite
names</title><programlisting
role="lzx-embednew"><filename>fonts-$6.lzx</filename><parameter/><code>
+
+<example role="live-example">
+ <title>Equivalence of generic and definite names</title>
+ <programlisting language="lzx">
+ <textobject><textdata fileref="fonts-$6.lzx"/></textobject>
+ </programlisting>
+</example>
+<?example role="live-example"><title>Equivalence of generic and defite
names</title><programlisting
role="lzx-embednew"><filename>fonts-$6.lzx</filename><parameter/><code>
<canvas height="100">
<simplelayout axis="y"/>
<text font="sans-serif">Some text</text>
@@ -360,11 +401,17 @@
<text font="Courier">Some text</text>
<text font="monospace">Some text</text>
</canvas>
-</programlisting><?lzx-edit programs/fonts-$6.lzx?></example>
+</programlisting><?lzx-edit programs/fonts-$6.lzx></example?>
<para>
This displays three pairs of items. The items in each pair may be rendered in
the same font, depending on the default fonts on the client.
</para>
-<example role="live-example"><title>"nofont" attribute</title><programlisting
role="lzx-embednew"><filename>fonts-$7.lzx</filename><parameter/><code>
+<example role="live-example">
+ <title>"nofont" attribute</title>
+ <programlisting language="lzx">
+ <textobject><textdata fileref="fonts-$7.lzx"/></textobject>
+ </programlisting>
+</example>
+<?example role="live-example"><title>"nofont" attribute</title><programlisting
role="lzx-embednew"><filename>fonts-$7.lzx</filename><parameter/><code>
<canvas height="100">
<simplelayout axis="y"/>
<text font="nofont, nofont, sans-serif">Some text</text>
@@ -378,7 +425,7 @@
<text font="nofont, sans-serif">Some text</text>
<text font="sans-serif">Some text</text>
</canvas>
-</programlisting><?lzx-edit programs/fonts-$7.lzx?></example>
+</programlisting><?lzx-edit programs/fonts-$7.lzx></example?>
<para>
This displays three lines in the same font.
</para>
@@ -487,8 +534,14 @@
Because of the way that font attributes cascade, the values of these
attributes on the canvas
are essentially the defaults for the entire application. Below are
some examples of using
font attributes. </para>
-
-<example role="live-example"><title>Using a font</title><programlisting
role="lzx-embednew"><filename>fonts-$11.lzx</filename><parameter/><code>
+
+<example role="live-example">
+ <title>Using a font</title>
+ <programlisting language="lzx">
+ <textobject><textdata fileref="fonts-$11.lzx"/></textobject>
+ </programlisting>
+</example>
+<?example role="live-example"><title>Using a font</title><programlisting
role="lzx-embednew"><filename>fonts-$11.lzx</filename><parameter/><code>
<canvas height="70">
<font name="helmet" src="helmetr.ttf"/>
<text font="helmet" fontsize="20">Hello Helmet</text>
@@ -498,7 +551,7 @@
<font name="helmet" src="helmetr.ttf"/>
<text font="helmet" fontsize="20">Hello Helmet</text>
</canvas>
-</programlisting><?lzx-edit programs/fonts-$11.lzx?></example>
+</programlisting><?lzx-edit programs/fonts-$11.lzx></example?>
<para>
As you can see below, The HTML text rendering tags,
<indexterm><primary>b tag</primary></indexterm><sgmltag
class="element"><b></sgmltag><remark role="fixme">[unknown tag]</remark>
<!--unknown tag: b-->
@@ -508,7 +561,13 @@
(for italic) instruct the OpenLaszlo application to look for and use
the bold, italic, or bold italic version of the current font.</para>
-<example role="live-example"><title>Using font styles and HTML
text</title><programlisting
role="lzx-embednew"><filename>fonts-$12.lzx</filename><parameter/><code>
+<example role="live-example">
+ <title>Using font styles and html text</title>
+ <programlisting language="lzx">
+ <textobject><textdata fileref="fonts-$12.lzx"/></textobject>
+ </programlisting>
+</example>
+<?example role="live-example"><title>Using font styles and HTML
text</title><programlisting
role="lzx-embednew"><filename>fonts-$12.lzx</filename><parameter/><code>
<canvas height="70">
<font name="myfont">
<face src="helmetr.ttf" style="plain" />
@@ -538,14 +597,20 @@
<b><i>bold italic</i></b>
</text>
</canvas>
-</programlisting><?lzx-edit programs/fonts-$12.lzx?></example>
+</programlisting><?lzx-edit programs/fonts-$12.lzx></example?>
<para> In the example below, we use the HTML text <indexterm><primary>font
tag</primary></indexterm><sgmltag class="element"><font></sgmltag><remark
role="fixme">[unknown tag]</remark>
<!--unknown tag: font-->
tag to
change fonts inside a single piece of text.</para>
-<example role="live-example"><title>Using mulitple fonts in HTML
text</title><programlisting
role="lzx-embednew"><filename>fonts-$13.lzx</filename><parameter/><code>
+<example role="live-example">
+ <title>Using multiple fonts in HTML text</title>
+ <programlisting language="lzx">
+ <textobject><textdata fileref="fonts-$13.lzx"/></textobject>
+ </programlisting>
+</example>
+<?example role="live-example"><title>Using mulitple fonts in HTML
text</title><programlisting
role="lzx-embednew"><filename>fonts-$13.lzx</filename><parameter/><code>
<canvas height="70">
<font name="helmet" src="helmetr.ttf"/>
<font name="arioso" src="ariosor.ttf"/>
@@ -563,12 +628,18 @@
<font face="arioso">arioso</font>
</text>
</canvas>
-</programlisting><?lzx-edit programs/fonts-$13.lzx?></example>
+</programlisting><?lzx-edit programs/fonts-$13.lzx></example?>
<para>In the example below, you can see that setting the
<indexterm><primary>fontsize attribute</primary></indexterm><sgmltag
class="attribute">fontsize</sgmltag>
can get you very big text.</para>
-<example role="live-example"><title>Using the fontsize
attribute</title><programlisting
role="lzx-embednew"><filename>fonts-$14.lzx</filename><parameter/><code>
+<example role="live-example">
+ <title>Using the fontsize attribute</title>
+ <programlisting language="lzx">
+ <textobject><textdata fileref="fonts-$14.lzx"/></textobject>
+ </programlisting>
+</example>
+<?example role="live-example"><title>Using the fontsize
attribute</title><programlisting
role="lzx-embednew"><filename>fonts-$14.lzx</filename><parameter/><code>
<canvas height="100">
<font name="helmet" src="helmetr.ttf"/>
<text resize="true" fontsize="100" font="helmet">BIG</text>
@@ -578,11 +649,17 @@
<font name="helmet" src="helmetr.ttf"/>
<text resize="true" fontsize="100" font="helmet">BIG</text>
</canvas>
-</programlisting><?lzx-edit programs/fonts-$14.lzx?></example>
+</programlisting><?lzx-edit programs/fonts-$14.lzx></example?>
<para>Many of the fonts look too small at the default fontsize of
8.</para>
-<example role="live-example"><title>Omitting the fontsize
attribute.</title><programlisting
role="lzx-embednew"><filename>fonts-$15.lzx</filename><parameter/><code>
+<example role="live-example">
+ <title>Omitting the fontsize attribute</title>
+ <programlisting language="lzx">
+ <textobject><textdata fileref="fonts-$15.lzx"/></textobject>
+ </programlisting>
+</example>
+<?example role="live-example"><title>Omitting the fontsize
attribute.</title><programlisting
role="lzx-embednew"><filename>fonts-$15.lzx</filename><parameter/><code>
<canvas height="70">
<font name="helmet" src="helmetr.ttf"/>
<text font="helmet">Helmet at default size(8) is very hard to
read!</text>
@@ -592,10 +669,17 @@
<font name="helmet" src="helmetr.ttf"/>
<text font="helmet">Helmet at default size(8) is very hard to
read!</text>
</canvas>
-</programlisting><?lzx-edit programs/fonts-$15.lzx?></example>
+</programlisting><?lzx-edit programs/fonts-$15.lzx></example?>
<para>You can specify the font for inputtext, too.</para>
-<example role="live-example"><title>Specifying the font for
inputtext.</title><programlisting
role="lzx-embednew"><filename>fonts-$16.lzx</filename><parameter/><code>
+
+<example role="live-example">
+ <title>Specifying the font for inputtext</title>
+ <programlisting language="lzx">
+ <textobject><textdata fileref="fonts-$16.lzx"/></textobject>
+ </programlisting>
+</example>
+<?example role="live-example"><title>Specifying the font for
inputtext.</title><programlisting
role="lzx-embednew"><filename>fonts-$16.lzx</filename><parameter/><code>
<canvas fontsize="20" height="70">
<font name="helmet" src="helmetr.ttf"/>
<inputtext bgcolor="red" font="helmet">Type your text
here</inputtext>
@@ -605,7 +689,7 @@
<font name="helmet" src="helmetr.ttf"/>
<inputtext bgcolor="red" font="helmet">Type your text
here</inputtext>
</canvas>
-</programlisting><?lzx-edit programs/fonts-$16.lzx?></example>
+</programlisting><?lzx-edit programs/fonts-$16.lzx></example?>
<para>Note that HTML text does <emphasis role="b"><emphasis
role="i">not</emphasis></emphasis> work in <indexterm><primary>inputtext
tag</primary></indexterm><sgmltag
class="element"><inputtext></sgmltag><remark role="fixme">[unknown
tag]</remark>
<!--unknown tag: inputtext-->
@@ -627,7 +711,13 @@
Each of the three font attributes cascade separately.
</para>
-<example role="live-example"><title>Using cascaded font
attributes</title><programlisting
role="lzx-embednew"><filename>fonts-$17.lzx</filename><parameter/><code>
+<example role="live-example">
+ <title>Using cascaded font attributes</title>
+ <programlisting language="lzx">
+ <textobject><textdata fileref="fonts-$17.lzx"/></textobject>
+ </programlisting>
+</example>
+<?example role="live-example"><title>Using cascaded font
attributes</title><programlisting
role="lzx-embednew"><filename>fonts-$17.lzx</filename><parameter/><code>
<canvas height="250">
<font name="conga" src="congar.ttf"/>
<font name="conga" src="congab.ttf" style="bold"/>
@@ -659,11 +749,17 @@
</view>
</view>
</canvas>
-</programlisting><?lzx-edit programs/fonts-$17.lzx?></example>
+</programlisting><?lzx-edit programs/fonts-$17.lzx></example?>
- <para>You can even specify font attributes on the canvas</para>
+ <para>You can even specify font attributes on the canvas:</para>
-<example role="live-example"><title>Specifying a canvas
font</title><programlisting
role="lzx-embednew"><filename>fonts-$18.lzx</filename><parameter/><code>
+<example role="live-example">
+ <title>Specifying a canvas font</title>
+ <programlisting language="lzx">
+ <textobject><textdata fileref="fonts-$18.lzx"/></textobject>
+ </programlisting>
+</example>
+<?example role="live-example"><title>Specifying a canvas
font</title><programlisting
role="lzx-embednew"><filename>fonts-$18.lzx</filename><parameter/><code>
<canvas font="tahoe" height="70" width="200">
<font name="tahoe" src="lztahoe8.ttf"/>
<text text="hello"/>
@@ -673,7 +769,7 @@
<font name="tahoe" src="lztahoe8.ttf"/>
<text text="hello"/>
</canvas>
-</programlisting><?lzx-edit programs/fonts-$18.lzx?></example>
+</programlisting><?lzx-edit programs/fonts-$18.lzx></example?>
<para/></section><section><title>Font attributes and classes</title>
<para>Specifying a font attribute on a class definition:</para>
@@ -690,7 +786,14 @@
the implementation (design, layout, positioning) of that class to that
specific font. In general,
you should only do this when absolutely necessary.</para>
-<example role="live-example"><title>Using font attributes in a class
definition</title><programlisting
role="lzx-embednew"><filename>fonts-$19.lzx</filename><parameter/><code>
+<example role="live-example">
+ <title>Using font attributes in a class definition</title>
+ <programlisting language="lzx">
+ <textobject><textdata fileref="fonts-$19.lzx"/></textobject>
+ </programlisting>
+</example>
+
+<?example role="live-example"><title>Using font attributes in a class
definition</title><programlisting
role="lzx-embednew"><filename>fonts-$19.lzx</filename><parameter/><code>
<canvas height="100">
<font name="helmet" src="helmetr.ttf"/>
<font name="tahoe" src="lztahoe8.ttf"/>
@@ -720,7 +823,7 @@
<text text="use cascaded font"/>
</view>
</canvas>
-</programlisting><?lzx-edit programs/fonts-$19.lzx?></example>
+</programlisting><?lzx-edit programs/fonts-$19.lzx></example?>
<para role="fixme"><remark role="fixme"><emphasis role="para-label">FIXME:
</emphasis>Note: sometime in these examples we set the text to be resizable.
Ask Adam or Sarah why</remark></para>
@@ -743,7 +846,14 @@
files provided for 9 point text or you can use the <code>vera*</code>
for arbitrary sizes.
</p>
?>
-<example role="live-example"><title>Verity and vera
fonts</title><programlisting
role="lzx-embednew"><filename>fonts-$20.lzx</filename><parameter/><code>
+
+<example role="live-example">
+ <title>Verity and vera fonts</title>
+ <programlisting language="lzx">
+ <textobject><textdata fileref="fonts-$20.lzx"/></textobject>
+ </programlisting>
+</example>
+<?example role="live-example"><title>Verity and vera
fonts</title><programlisting
role="lzx-embednew"><filename>fonts-$20.lzx</filename><parameter/><code>
<canvas height="120">
<font name="vera" src="bitstream-vera-1.10/vera.ttf"/>
<font name="verity9" src="verity/verity9.ttf"/>
@@ -785,7 +895,7 @@
<text pixellock="true" fontsize="14" font="vera" text="vera 14
abcdefghi"/>
<text pixellock="true" fontsize="20" font="vera" text="vera 20
abcdefghi"/>
</canvas>
-</programlisting><?lzx-edit programs/fonts-$20.lzx?></example>
+</programlisting><?lzx-edit programs/fonts-$20.lzx></example?>
<para>
The OpenLaszlo compiler also knows to automatically include the bold,
italic, or bold italic
@@ -794,7 +904,14 @@
<para>
You may redefine the default font if you'd like.</para>
-<example role="live-example"><title>Redefining the default
font</title><programlisting
role="lzx-embednew"><filename>fonts-$21.lzx</filename><parameter/><code>
+
+<example role="live-example">
+ <title>Redefining the default font</title>
+ <programlisting language="lzx">
+ <textobject><textdata fileref="fonts-$21.lzx"/></textobject>
+ </programlisting>
+</example>
+<?example role="live-example"><title>Redefining the default
font</title><programlisting
role="lzx-embednew"><filename>fonts-$21.lzx</filename><parameter/><code>
<canvas height="70">
<font name="default" src="bitstream-vera-1.10/vera.ttf"/>
<simplelayout axis="y" spacing="2"/>
@@ -808,7 +925,7 @@
<text text="vera"/>
<button text="vera button"/>
</canvas>
-</programlisting><?lzx-edit programs/fonts-$21.lzx?></example>
+</programlisting><?lzx-edit programs/fonts-$21.lzx></example?>
<para>Note that when you redefine the default font, the compiler no
longer can automatically
include the bold, italic, or bold italic styles for you.</para>
@@ -842,7 +959,13 @@
<para>Another way to get components to use a font other than 'default'
is to
actually redefine the default font.</para>
-<example role="live-example"><title>Redefining the default font for Laszlo
components</title><programlisting
role="lzx-embednew"><filename>fonts-$23.lzx</filename><parameter/><code>
+<example role="live-example">
+ <title>Redefining the default font for OpenLaszlo components</title>
+ <programlisting language="lzx">
+ <textobject><textdata fileref="fonts-$23.lzx"/></textobject>
+ </programlisting>
+</example>
+<?example role="live-example"><title>Redefining the default font for Laszlo
components</title><programlisting
role="lzx-embednew"><filename>fonts-$23.lzx</filename><parameter/><code>
<canvas height="80">
<font name="default" src="helmetr.ttf"/>
<button text="hello"/>
@@ -852,7 +975,7 @@
<font name="default" src="helmetr.ttf"/>
<button text="hello"/>
</canvas>
-</programlisting><?lzx-edit programs/fonts-$23.lzx?></example>
+</programlisting><?lzx-edit programs/fonts-$23.lzx></example?>
<para/></section><section><title>Fonts provided with the OpenLaszlo
Server</title>
@@ -932,4 +1055,4 @@
TTF Details: <itemizedlist spacing="compact"><listitem><para>LZX only
supports TTF that are encoded as outline
fonts.</para></listitem><listitem><para>LZX does not import kerning information
from TTFs.</para></listitem></itemizedlist>
</para></listitem><listitem><para>LZX does not use kerning information.
</para></listitem></itemizedlist>
</remark></para>
-<para/></section></chapter>
\ No newline at end of file
+<para/></section></chapter>
_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins