<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE document SYSTEM "rml_1_0.dtd">
<document filename="test_030_codepages.pdf" invariant="1">
	<docinit>
    	<registerTTFont faceName="Vera" fileName="Vera.ttf" />
    	<registerTTFont faceName="VeraBold" fileName="VeraBd.ttf" />
		<registerTTFont faceName="VeraItalic" fileName="VeraIt.ttf"/>
	</docinit>
	<template pageSize="a4" leftMargin="72" showBoundary="1">
		<pageTemplate id="main" pageSize="(595,842)">
			<pageGraphics>
				 <setFont name="Helvetica-Bold" size="18"/>
		    <drawString x="35" y="783">RML Example 31: Codepages</drawString>
			<image file="logo_no_bar.png" preserveAspectRatio="1" x="488" y="749" width="72" height="72"/>
    		<image file="strapline.png" preserveAspectRatio="1" x="35" y="0" width="525" />
			</pageGraphics>
			<frame id="second" x1="35" y1="45" width="525" height="590"/>
		</pageTemplate>
	</template>
	<stylesheet>
		<paraStyle name="h1" fontName="VeraBold" fontSize="32" leading="36"/>
		<paraStyle name="normal" fontName="Helvetica" fontSize="10" leading="12" spaceBefore="6"/>
		<paraStyle name="truetype" fontName="Vera" fontSize="10" leading="12" spaceBefore="6"/>
		<paraStyle name="VeraItalic" fontName="VeraItalic" fontSize="10" leading="12" spaceBefore="6" />
		<paraStyle name="rjust" parent="normal" fontName="VeraBold" alignment="RIGHT"/>
		<paraStyle name="intro"  fontName="Helvetica" fontSize="12" leading="12" spaceAfter="12"/>
	</stylesheet>
	<story>
	<storyPlace x="35" y="660" width="525" height="73" origin="page">
<para style="intro">RML (Report Markup Language) is ReportLab's own language for specifying the appearance of a printed page, which is converted into PDF by the utility rml2pdf.</para>
<hr color="white" thickness="8pt"/>
<para style="intro">These RML samples showcase techniques and features for generating various types of ouput and are distributed within our commercial package as test cases. Each should be self explanatory and stand alone.</para>
<illustration height="3" width="525" align="center">
<fill color= "(0,0.99,0.97,0.0)" />
<rect x="0" y = "-12" width="525" height="3" round="1" fill="1" stroke = "Yes" />
</illustration>
</storyPlace>
		<keepInFrame onOverflow="shrink">
		<para style="h1">Unicode Tests</para>
		<para style="normal">In version 2.0 of the ReportLab library and later, all RML input is
strictly UTF8 - the default standard for XML files.  This considerably simplifies things compared to 
version 1.0, where you had to encode data to match the fonts.</para>
		<para style="normal">Most good editors can be configured to display UTF8 characters.  To see
		non-Latin characters, you'll need to make sure you use a multilingual font.</para>
		<blockTable>
			<blockTableStyle id="0002">
				<lineStyle kind="GRID" colorName="black"/>
				<blockBottomPadding length="0"/>
				<blockTopPadding length="3"/>
			</blockTableStyle>
			<tr>
				<td>Brazilian (Portuguese)</td>
				<td>English</td>
			</tr>
			<tr>
				<td>maçã</td>
				<td>apple</td>
			</tr>
			<tr>
				<td>abóbora </td>
				<td>pumpkin</td>
			</tr>
			<tr>
				<td>pé </td>
				<td>foot</td>
			</tr>
			<tr>
				<td>limão </td>
				<td/>
			</tr>
			<tr>
				<td>limões </td>
				<td>lemons</td>
			</tr>
			<tr>
				<td>maracujá </td>
				<td>passion fruit</td>
			</tr>
		</blockTable>
		<para style="normal">The above table should display the names of various fruits, which
		contain accents.  These are in Helvetica, a Type 1 font.</para>

		<para style="normal">This paragraph is in Helvetica, a Type 1 font.  You should see trademark (&#x2122;),
		copyright (&#x00a9;) and registered (&#x00ae;) characters.  Ole!</para>
		<para style="truetype">This paragraph is in Vera, a TrueType font.  You should see trademark (&#x2122;),
		copyright (&#x00a9;) and registered (&#x00ae;) characters.  Ole!</para>
		<para style="VeraItalic">This paragraph is in VeraItalic, a TrueType font.  You should see trademark (&#x2122;),
		copyright (&#x00a9;) and registered (&#x00ae;) characters. Ole!</para>

		<para style="normal">
		</para>

		
		<para style="normal">Characters in UTF8 can always be represented with XML numeric 
entity codes.  Thus, the character 'A' can be shown with the decimal escape sequence "&amp;#65;"
in the document source, or the hex sequence "&amp;#x41;".  Here we go, should get three As:  &#65; &#x41; &#x0041;.
Trademark can be written as &amp;#x2122;, copyright as &amp;#x00a9;, and registered as &amp;#x00ae;. </para>

		<para style="normal">There are some other non-paragraph contexts for text display -
drawing strings directly, and placing strings (not paragraphs) in table cells.  The title
at the top should have a &#174; symbol at the right, and all three should appear in
the table below:</para>
		<spacer length="24"/>
		<blockTable>
			<blockTableStyle id="0001">
				<lineStyle kind="GRID" colorName="black"/>
			</blockTableStyle>
			<tr>
				<td>Symbol Name</td>
				<td>Displays</td>
			</tr>
			<tr>
				<td>Copyright</td>
				<td>&#169;</td>
			</tr>
			<tr>
				<td>Registered</td>
				<td>&#174;</td>
			</tr>
			<tr>
				<td>Trademark</td>
				<td>&#x2122;</td>
			</tr>
			<tr>
				<td>En Dash</td>
				<td>&#x2013;</td>
			</tr>
			<tr>
				<td>Em Dash</td>
				<td>&#x2014;</td>
			</tr>
		</blockTable>

		<para style="normal">Test 31 does Unicode with Japanese characters, but you'll need the Adobe font pack to read that one.</para>

		<para style="normal">This uses the unichar tag to render an umlaut:<unichar name='LATIN SMALL LETTER U WITH DIAERESIS'/></para>
		<para style="normal">This uses the unichar tag to render a  bullet:<unichar name='BULLET'/></para>
		<para style="normal">This uses a numeric entity to render a bullet &#x2022;</para>
		<para style="normal">This uses inline utf8 to render a bullet •</para>
	</keepInFrame>

		


	</story>
</document>
