Слияние docx4j 17.3.5 в wordpdf-core и форк FO-рендерера 2.11-docx4j.8 в реактор
PR checks / web (pull_request) Successful in 38s
PR checks / java (pull_request) Successful in 18m31s

- wordpdf-core/src/main/java впитаны исходники docx4j-core, -export-fo,
  -chart-render, -JAXB-ReferenceImpl, -copy, -generated-objects (17.3.5) +
  сгенерированная XJC JAXB-модель; ресурсы — тем же путём; артефакты группы
  org.docx4j из внешних репозиториев больше не подключаются
- vendor/fop: форк docx4j-fo-renderer 2.11-docx4j.8 (util/events/core/fop)
  собирается в реакторе вместо jar из Nexus
- docx2fo.xslt перевендорен со стилем 17.3.5, оба AUDIT-FIX-патча перенесены;
  дрейф-гейт vendoredXsltTracksJarCopy зелёный
- upstream-тесты docx4j перенесены в src/test/java/org (658 классов, вне гейта);
  execution upstream-docx4j-tests в профиле upstream-tests (./mise.sh run
  upstream-tests, в pr.yml non-blocking шаг): 3470 тестов, 3457 зелёных,
  13 красных — категории окружения/калибровки хоста и следствий слияния
  classpath задокументированы в docs/agent/testing.md
- surefire: провайдер SLF4J фиксируется коротким slf4j.provider по execution;
  перенесён upstream logback.xml (root=DEBUG без конфига ломает visitor-экспорт
  VML); upstream-форки пинят JDK JAXP-фабрики; PMD/JaCoCo исключают org/**
- wordpdf-app: без изменений кода (зависит от слитого ядра); тесты 44/44
- документация синхронизирована (AGENTS.md, README, docs/agent/*), mise task
  upstream-tests
This commit is contained in:
Pjandro
2026-11-08 02:54:49 +00:00
parent f41ac54072
commit 8529b6877b
10191 changed files with 1694473 additions and 75 deletions
+439
View File
@@ -0,0 +1,439 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.docx4j</groupId>
<artifactId>docx4j-fo-renderer-core</artifactId>
<name>docx4j FO renderer core</name>
<description>docx4j FO renderer core, based on Apache FOP's main branch after 2.11 (fop-core). This is a modified distribution derived from Apache FOP (its main branch after the 2.11 release). It is maintained by Plutext/docx4j and is not an Apache Software Foundation release. Apache FOP is a trademark of the Apache Software Foundation.</description>
<parent>
<groupId>org.docx4j</groupId>
<artifactId>docx4j-fo-renderer-parent</artifactId>
<version>2.11-docx4j.8</version>
</parent>
<properties>
<fop.hyph.version>2.0</fop.hyph.version>
</properties>
<dependencies>
<!-- batik deps -->
<dependency>
<groupId>org.apache.xmlgraphics</groupId>
<artifactId>batik-anim</artifactId>
<version>${batik.version}</version>
<exclusions>
<exclusion>
<groupId>xalan</groupId>
<artifactId>xalan</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.xmlgraphics</groupId>
<artifactId>batik-awt-util</artifactId>
<version>${batik.version}</version>
</dependency>
<dependency>
<groupId>org.apache.xmlgraphics</groupId>
<artifactId>batik-bridge</artifactId>
<version>${batik.version}</version>
</dependency>
<dependency>
<groupId>org.apache.xmlgraphics</groupId>
<artifactId>batik-extension</artifactId>
<version>${batik.version}</version>
</dependency>
<dependency>
<groupId>org.apache.xmlgraphics</groupId>
<artifactId>batik-gvt</artifactId>
<version>${batik.version}</version>
</dependency>
<dependency>
<groupId>org.apache.xmlgraphics</groupId>
<artifactId>batik-transcoder</artifactId>
<version>${batik.version}</version>
</dependency>
<dependency>
<groupId>org.apache.xmlgraphics</groupId>
<artifactId>batik-codec</artifactId>
<version>${batik.version}</version>
</dependency>
<!-- fop deps -->
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>docx4j-fo-renderer-events</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>docx4j-fo-renderer-util</artifactId>
<version>${project.version}</version>
</dependency>
<!-- xgc deps -->
<dependency>
<groupId>org.apache.xmlgraphics</groupId>
<artifactId>xmlgraphics-commons</artifactId>
<version>${xmlgraphics.commons.version}</version>
</dependency>
<!-- xmlgraphics external deps -->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${commons.io.version}</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>${commons.logging.version}</version>
</dependency>
<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>5.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
<version>${ant.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>fontbox</artifactId>
<version>3.0.3</version>
</dependency>
<!-- VENDOR (java-word-pdf): JAI 1.1.3 физически нет в Maven Central, а разрешения в этом
проекте идут только через зеркало Nexus (mirrorOf=*), поэтому оба jar лежат в
vendor/fop/lib/ (sha1 совпадают у jboss-thirdparty и osgeo: jai-core
b179d2efb1174658483e8b41bf4ac9d2eb5de438, jai-codec 34a67ba62097778e4695c951156bf189c2c8e016)
и ставятся в локальный репозиторий исполнением install-thirdparty-* в родительском
pom (vendor/fop/pom.xml, фаза initialize — до сборки этого модуля). Scope provided
сохранён как у Apache FOP: в downstream-classpath потребителя JAI не попадает,
компиляция fop-core идёт против тех же классов. -->
<dependency>
<groupId>javax.media</groupId>
<artifactId>jai-core</artifactId>
<version>1.1.3</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15to18</artifactId>
<version>1.85</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15to18</artifactId>
<version>1.85</version>
<scope>provided</scope>
</dependency>
<!-- VENDOR (java-word-pdf): тот же vendor-jar, см. комментарий у jai-core. -->
<dependency>
<groupId>com.sun.media</groupId>
<artifactId>jai-codec</artifactId>
<version>1.1.3</version>
<scope>provided</scope>
</dependency>
<!-- test deps -->
<dependency>
<groupId>net.sf.offo</groupId>
<artifactId>fop-hyph</artifactId>
<version>${fop.hyph.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>2.28.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>xmlunit</groupId>
<artifactId>xmlunit</artifactId>
<version>${xmlunit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox</artifactId>
<version>3.0.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.thoughtworks.qdox</groupId>
<artifactId>qdox</artifactId>
<version>1.12</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<!-- generate base14 font class sources -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>xml-maven-plugin</artifactId>
<version>${xml.plugin.version}</version>
<executions>
<execution>
<id>generate-base14-fonts</id>
<phase>generate-sources</phase>
<goals>
<goal>transform</goal>
</goals>
<configuration>
<transformationSets>
<transformationSet>
<dir>${project.basedir}/src/main/codegen/fonts</dir>
<fileMappers>
<fileMapper implementation="org.codehaus.plexus.components.io.filemappers.FileExtensionMapper">
<targetExtension>.java</targetExtension>
</fileMapper>
</fileMappers>
<includes>
<include>Courier*.xml</include>
<include>Helvetica*.xml</include>
<include>Times*.xml</include>
</includes>
<parameters>
<parameter>
<name>encoding</name>
<value>WinAnsiEncoding</value>
</parameter>
</parameters>
<outputDir>${project.build.directory}/generated-sources/main/java/org/apache/fop/fonts/base14</outputDir>
<stylesheet>${project.basedir}/src/main/codegen/fonts/font-file.xsl</stylesheet>
</transformationSet>
<transformationSet>
<dir>${project.basedir}/src/main/codegen/fonts</dir>
<fileMappers>
<fileMapper implementation="org.codehaus.plexus.components.io.filemappers.FileExtensionMapper">
<targetExtension>.java</targetExtension>
</fileMapper>
</fileMappers>
<includes>
<include>Symbol.xml</include>
<include>ZapfDingbats.xml</include>
</includes>
<outputDir>${project.build.directory}/generated-sources/main/java/org/apache/fop/fonts/base14</outputDir>
<stylesheet>${project.basedir}/src/main/codegen/fonts/font-file.xsl</stylesheet>
</transformationSet>
</transformationSets>
</configuration>
</execution>
<execution>
<id>codegen-fonts-encodings</id>
<phase>generate-sources</phase>
<goals>
<goal>transform</goal>
</goals>
<configuration>
<transformationSets>
<transformationSet>
<dir>${project.basedir}/src/main/codegen/fonts</dir>
<fileMappers>
<fileMapper implementation="org.codehaus.plexus.components.io.filemappers.MergeFileMapper">
<targetName>CodePointMapping.java</targetName>
</fileMapper>
</fileMappers>
<includes>
<include>encodings.xml</include>
</includes>
<outputDir>${project.build.directory}/generated-sources/main/java/org/apache/fop/fonts</outputDir>
<stylesheet>${project.basedir}/src/main/codegen/fonts/code-point-mapping.xsl</stylesheet>
</transformationSet>
</transformationSets>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>net.sf.saxon</groupId>
<artifactId>saxon</artifactId>
<version>8.7</version>
</dependency>
</dependencies>
</plugin>
<!-- add generate base14 font class sources to source set -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>${build.helper.plugin.version}</version>
<executions>
<execution>
<id>add-generated-sources</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${project.build.directory}/generated-sources/main/java</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<!-- generate event collector models -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>${antrun.plugin.version}</version>
<executions>
<execution>
<id>codegen-events</id>
<phase>process-classes</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<taskdef name="collectEvents" classname="org.apache.fop.eventtools.EventProducerCollectorTask">
<classpath>
<path refid="maven.compile.classpath"/>
<path refid="maven.test.classpath"/>
</classpath>
</taskdef>
<collectEvents destdir="${project.build.outputDirectory}">
<fileset dir="${project.basedir}/src/main/java">
<include name="**/accessibility/AccessibilityEventProducer.java"/>
<include name="**/afp/AFPEventProducer.java"/>
<include name="**/area/AreaEventProducer.java"/>
<include name="**/fo/flow/table/TableEventProducer.java"/>
<include name="**/fo/FOValidationEventProducer.java"/>
<include name="**/fonts/FontEventProducer.java"/>
<include name="**/layoutmgr/BlockLevelEventProducer.java"/>
<include name="**/layoutmgr/inline/InlineLevelEventProducer.java"/>
<include name="**/render/bitmap/BitmapRendererEventProducer.java"/>
<include name="**/render/pcl/PCLEventProducer.java"/>
<include name="**/render/pdf/extensions/PDFExtensionEventProducer.java"/>
<include name="**/render/pdf/PDFEventProducer.java"/>
<include name="**/render/ps/PSEventProducer.java"/>
<include name="**/render/RendererEventProducer.java"/>
<include name="**/render/rtf/RTFEventProducer.java"/>
<include name="**/ResourceEventProducer.java"/>
<include name="**/svg/SVGEventProducer.java"/>
</fileset>
</collectEvents>
</target>
</configuration>
</execution>
</executions>
</plugin>
<!-- junit testing -->
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire.plugin.version}</version><!--$NO-MVN-MAN-VER$-->
<configuration>
<includes>
<include>**/*TestCase.java</include>
</includes>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
<workingDirectory>../fop</workingDirectory>
</configuration>
</plugin>
<!-- code analysis - checkstyle -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<configLocation>${project.baseUri}src/tools/resources/checkstyle/checkstyle.xml</configLocation>
<headerLocation>${project.baseUri}src/tools/resources/checkstyle/LICENSE.txt</headerLocation>
<includeResources>false</includeResources>
<includeTestResources>false</includeTestResources>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
<linkXRef>false</linkXRef>
<logViolationsToConsole>true</logViolationsToConsole>
<suppressionsLocation>${project.baseUri}src/tools/resources/checkstyle/suppressions.xml</suppressionsLocation>
<violationSeverity>warning</violationSeverity>
</configuration>
</plugin>
<!-- code analysis - checkstyle -->
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<version>${findbugs.plugin.version}</version>
<configuration>
<excludeFilterFile>src/tools/resources/findbugs/exclusions.xml</excludeFilterFile>
<effort>Max</effort>
<threshold>Low</threshold>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
<manifestEntries>
<Automatic-Module-Name>org.apache.xmlgraphics.fop.core</Automatic-Module-Name>
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
<resource>
<directory>${basedir}/..</directory>
<includes>
<include>LICENSE</include>
<include>NOTICE</include>
</includes>
<targetPath>META-INF</targetPath>
</resource>
</resources>
<testResources>
<testResource>
<directory>src/test/resources</directory>
<includes>
<include>**/*</include>
</includes>
</testResource>
</testResources>
</build>
<profiles>
<profile>
<id>runFindbugs</id>
<build>
<plugins>
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<version>${findbugs.plugin.version}</version>
<configuration>
<excludeFilterFile>src/tools/resources/findbugs/exclusions.xml</excludeFilterFile>
<effort>Max</effort>
<threshold>Low</threshold>
</configuration>
<executions>
<execution>
<id>verify</id>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
+166
View File
@@ -0,0 +1,166 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- $Id$ -->
<toto>
<keyword-equiv match="aliceblue">#f0f8ff</keyword-equiv>
<keyword-equiv match="antiquewhite">#faebd7</keyword-equiv>
<keyword-equiv match="aqua">#00ffff</keyword-equiv>
<keyword-equiv match="aquamarine">#7fffd4</keyword-equiv>
<keyword-equiv match="azure">#f0ffff</keyword-equiv>
<keyword-equiv match="beige">#f5f5dc</keyword-equiv>
<keyword-equiv match="bisque">#ffe4c4</keyword-equiv>
<keyword-equiv match="black">#000000</keyword-equiv>
<keyword-equiv match="blanchedalmond">#ffebcd</keyword-equiv>
<keyword-equiv match="blue">#0000ff</keyword-equiv>
<keyword-equiv match="blueviolet">#8a2be2</keyword-equiv>
<keyword-equiv match="brown">#a52a2a</keyword-equiv>
<keyword-equiv match="burlywood">#deb887</keyword-equiv>
<keyword-equiv match="cadetblue">#5f9ea0</keyword-equiv>
<keyword-equiv match="chartreuse">#7fff00</keyword-equiv>
<keyword-equiv match="chocolate">#d2691e</keyword-equiv>
<keyword-equiv match="coral">#ff7f50</keyword-equiv>
<keyword-equiv match="cornflowerblue">#6495ed</keyword-equiv>
<keyword-equiv match="cornsilk">#fff8dc</keyword-equiv>
<keyword-equiv match="crimson">#dc143c</keyword-equiv>
<keyword-equiv match="cyan">#00ffff</keyword-equiv>
<keyword-equiv match="darkblue">#00008b</keyword-equiv>
<keyword-equiv match="darkcyan">#008b8b</keyword-equiv>
<keyword-equiv match="darkgoldenrod">#b8860b</keyword-equiv>
<keyword-equiv match="darkgray">#a9a9a9</keyword-equiv>
<keyword-equiv match="darkgreen">#006400</keyword-equiv>
<keyword-equiv match="darkgrey">#a9a9a9</keyword-equiv>
<keyword-equiv match="darkkhaki">#bdb76b</keyword-equiv>
<keyword-equiv match="darkmagenta">#8b008b</keyword-equiv>
<keyword-equiv match="darkolivegreen">#556b2f</keyword-equiv>
<keyword-equiv match="darkorange">#ff8c00</keyword-equiv>
<keyword-equiv match="darkorchid">#9932cc</keyword-equiv>
<keyword-equiv match="darkred">#8b0000</keyword-equiv>
<keyword-equiv match="darksalmon">#e9967a</keyword-equiv>
<keyword-equiv match="darkseagreen">#8fbc8f</keyword-equiv>
<keyword-equiv match="darkslateblue">#483d8b</keyword-equiv>
<keyword-equiv match="darkslategray">#2f4f4f</keyword-equiv>
<keyword-equiv match="darkslategrey">#2f4f4f</keyword-equiv>
<keyword-equiv match="darkturquoise">#00ced1</keyword-equiv>
<keyword-equiv match="darkviolet">#9400d3</keyword-equiv>
<keyword-equiv match="deeppink">#ff1493</keyword-equiv>
<keyword-equiv match="deepskyblue">#00bfff</keyword-equiv>
<keyword-equiv match="dimgray">#696969</keyword-equiv>
<keyword-equiv match="dimgrey">#696969</keyword-equiv>
<keyword-equiv match="dodgerblue">#1e90ff</keyword-equiv>
<keyword-equiv match="firebrick">#b22222</keyword-equiv>
<keyword-equiv match="floralwhite">#fffaf0</keyword-equiv>
<keyword-equiv match="forestgreen">#228b22</keyword-equiv>
<keyword-equiv match="fuchsia">#ff00ff</keyword-equiv>
<keyword-equiv match="gainsboro">#dcdcdc</keyword-equiv>
<keyword-equiv match="lightpink">#ffb6c1</keyword-equiv>
<keyword-equiv match="lightsalmon">#ffa07a</keyword-equiv>
<keyword-equiv match="lightseagreen">#20b2aa</keyword-equiv>
<keyword-equiv match="lightskyblue">#87cefa</keyword-equiv>
<keyword-equiv match="lightslategray">#778899</keyword-equiv>
<keyword-equiv match="lightslategrey">#778899</keyword-equiv>
<keyword-equiv match="lightsteelblue">#b0c4de</keyword-equiv>
<keyword-equiv match="lightyellow">#ffffe0</keyword-equiv>
<keyword-equiv match="lime">#00ff00</keyword-equiv>
<keyword-equiv match="limegreen">#32cd32</keyword-equiv>
<keyword-equiv match="linen">#faf0e6</keyword-equiv>
<keyword-equiv match="magenta">#ff00ff</keyword-equiv>
<keyword-equiv match="maroon">#800000</keyword-equiv>
<keyword-equiv match="mediumaquamarine">#66cdaa</keyword-equiv>
<keyword-equiv match="mediumblue">#0000cd</keyword-equiv>
<keyword-equiv match="mediumorchid">#ba55d3</keyword-equiv>
<keyword-equiv match="mediumpurple">#9370db</keyword-equiv>
<keyword-equiv match="mediumseagreen">#3cb371</keyword-equiv>
<keyword-equiv match="mediumslateblue">#7b68ee</keyword-equiv>
<keyword-equiv match="mediumspringgreen">#00fa9a</keyword-equiv>
<keyword-equiv match="mediumturquoise">#48d1cc</keyword-equiv>
<keyword-equiv match="mediumvioletred">#c71585</keyword-equiv>
<keyword-equiv match="midnightblue">#191970</keyword-equiv>
<keyword-equiv match="mintcream">#f5fffa</keyword-equiv>
<keyword-equiv match="mistyrose">#ffe4e1</keyword-equiv>
<keyword-equiv match="moccasin">#ffe4b5</keyword-equiv>
<keyword-equiv match="navajowhite">#ffdead</keyword-equiv>
<keyword-equiv match="navy">#000080</keyword-equiv>
<keyword-equiv match="oldlace">#fdf5e6</keyword-equiv>
<keyword-equiv match="olive">#808000</keyword-equiv>
<keyword-equiv match="olivedrab">#6b8e23</keyword-equiv>
<keyword-equiv match="orange">#ffa500</keyword-equiv>
<keyword-equiv match="orangered">#ff4500</keyword-equiv>
<keyword-equiv match="orchid">#da70d6</keyword-equiv>
<keyword-equiv match="palegoldenrod">#eee8aa</keyword-equiv>
<keyword-equiv match="palegreen">#98fb98</keyword-equiv>
<keyword-equiv match="paleturquoise">#afeeee</keyword-equiv>
<keyword-equiv match="palevioletred">#db7093</keyword-equiv>
<keyword-equiv match="papayawhip">#ffefd5</keyword-equiv>
<keyword-equiv match="peachpuff">#ffdab9</keyword-equiv>
<keyword-equiv match="peru">#cd853f</keyword-equiv>
<keyword-equiv match="pink">#ffc0cb</keyword-equiv>
<keyword-equiv match="plum">#dda0dd</keyword-equiv>
<keyword-equiv match="powderblue">#b0e0e6</keyword-equiv>
<keyword-equiv match="purple">#800080</keyword-equiv>
<keyword-equiv match="red">#ff0000</keyword-equiv>
<keyword-equiv match="rosybrown">#bc8f8f</keyword-equiv>
<keyword-equiv match="royalblue">#4169e1</keyword-equiv>
<keyword-equiv match="saddlebrown">#8b4513</keyword-equiv>
<keyword-equiv match="salmon">#fa8072</keyword-equiv>
<keyword-equiv match="ghostwhite">#f8f8ff</keyword-equiv>
<keyword-equiv match="gold">#ffd700</keyword-equiv>
<keyword-equiv match="goldenrod">#daa520</keyword-equiv>
<keyword-equiv match="gray">#808080</keyword-equiv>
<keyword-equiv match="grey">#808080</keyword-equiv>
<keyword-equiv match="green">#008000</keyword-equiv>
<keyword-equiv match="greenyellow">#adff2f</keyword-equiv>
<keyword-equiv match="honeydew">#f0fff0</keyword-equiv>
<keyword-equiv match="hotpink">#ff69b4</keyword-equiv>
<keyword-equiv match="indianred">#cd5c5c</keyword-equiv>
<keyword-equiv match="indigo">#4b0082</keyword-equiv>
<keyword-equiv match="ivory">#fffff0</keyword-equiv>
<keyword-equiv match="khaki">#f0e68c</keyword-equiv>
<keyword-equiv match="lavender">#e6e6fa</keyword-equiv>
<keyword-equiv match="lavenderblush">#fff0f5</keyword-equiv>
<keyword-equiv match="lawngreen">#7cfc00</keyword-equiv>
<keyword-equiv match="lemonchiffon">#fffacd</keyword-equiv>
<keyword-equiv match="lightblue">#add8e6</keyword-equiv>
<keyword-equiv match="lightcoral">#f08080</keyword-equiv>
<keyword-equiv match="lightcyan">#e0ffff</keyword-equiv>
<keyword-equiv match="lightgoldenrodyellow">#fafad2</keyword-equiv>
<keyword-equiv match="lightgray">#d3d3d3</keyword-equiv>
<keyword-equiv match="lightgreen">#90ee90</keyword-equiv>
<keyword-equiv match="lightgrey">#d3d3d3</keyword-equiv>
<keyword-equiv match="sandybrown">#f4a460</keyword-equiv>
<keyword-equiv match="seagreen">#2e8b57</keyword-equiv>
<keyword-equiv match="seashell">#fff5ee</keyword-equiv>
<keyword-equiv match="sienna">#a0522d</keyword-equiv>
<keyword-equiv match="silver">#c0c0c0</keyword-equiv>
<keyword-equiv match="skyblue">#87ceeb</keyword-equiv>
<keyword-equiv match="slateblue">#6a5acd</keyword-equiv>
<keyword-equiv match="slategray">#708090</keyword-equiv>
<keyword-equiv match="slategrey">#708090</keyword-equiv>
<keyword-equiv match="snow">#fffafa</keyword-equiv>
<keyword-equiv match="springgreen">#00ff7f</keyword-equiv>
<keyword-equiv match="steelblue">#4682b4</keyword-equiv>
<keyword-equiv match="tan">#d2b48c</keyword-equiv>
<keyword-equiv match="teal">#008080</keyword-equiv>
<keyword-equiv match="thistle">#d8bfd8</keyword-equiv>
<keyword-equiv match="tomato">#ff6347</keyword-equiv>
<keyword-equiv match="turquoise">#40e0d0</keyword-equiv>
<keyword-equiv match="violet">#ee82ee</keyword-equiv>
<keyword-equiv match="wheat">#f5deb3</keyword-equiv>
<keyword-equiv match="white">#ffffff</keyword-equiv>
<keyword-equiv match="whitesmoke">#f5f5f5</keyword-equiv>
<keyword-equiv match="yellow">#ffff00</keyword-equiv>
<keyword-equiv match="yellowgreen">#9acd32</keyword-equiv>
</toto>
+21
View File
@@ -0,0 +1,21 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- $Id$ -->
<allprops>
<propfile>foproperties.xml</propfile>
<elementfile>foelements.xml</elementfile>
</allprops>
+266
View File
@@ -0,0 +1,266 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- $Id$ -->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:include href="./propinc.xsl"/>
<xsl:output method="text" />
<xsl:template match="allprops">
<xsl:variable name="constlist">
<xsl:for-each select="document(propfile)//generic-property-list
//enumeration/value">
<xsl:sort select="@const"/>
<xsl:value-of select="@const"/>:</xsl:for-each>
</xsl:variable>
<xsl:variable name="propertylist">
<xsl:for-each select="document(propfile)//generic-property-list//
property[not(@type = 'generic')]">
<xsl:sort select="name"/>
<xsl:text>PR_</xsl:text>
<xsl:call-template name="makeEnumConstant">
<xsl:with-param name="propstr" select="name" />
</xsl:call-template>
<xsl:text>:</xsl:text>
</xsl:for-each>
</xsl:variable>
<xsl:variable name="compoundpropertylist">
<xsl:for-each select="document(propfile)//generic-property-list//
property/compound/subproperty">
<xsl:sort select="name"/>
<xsl:text>CP_</xsl:text>
<xsl:call-template name="makeEnumConstant">
<xsl:with-param name="propstr" select="name" />
</xsl:call-template>
<xsl:text>:</xsl:text>
</xsl:for-each>
</xsl:variable>
<xsl:variable name="elementlist">
<xsl:for-each select="document(elementfile)//element">
<xsl:sort select="name"/>
<xsl:text>FO_</xsl:text>
<xsl:call-template name="makeEnumConstant">
<xsl:with-param name="propstr" select="name" />
</xsl:call-template>
<xsl:text>:</xsl:text>
</xsl:for-each>
</xsl:variable>
<xsl:text>
package org.apache.fop.fo;
public interface Constants {</xsl:text>
// element constants
<xsl:call-template name="sortconsts">
<xsl:with-param name="consts" select="$elementlist"/>
<xsl:with-param name="counter" select="'ELEMENT'"/>
</xsl:call-template>
// Masks
int COMPOUND_SHIFT = 9;
int PROPERTY_MASK = (1 &lt;&lt; COMPOUND_SHIFT)-1;
int COMPOUND_MASK = ~PROPERTY_MASK;
int COMPOUND_COUNT = 11;
// property constants
<xsl:call-template name="sortconsts">
<xsl:with-param name="consts" select="$propertylist"/>
<xsl:with-param name="counter" select="'PROPERTY'"/>
</xsl:call-template>
// compound property constants
<xsl:call-template name="sortconsts">
<xsl:with-param name="consts" select="$compoundpropertylist"/>
<xsl:with-param name="suffix" select="' &lt;&lt; COMPOUND_SHIFT'"/>
</xsl:call-template>
// Enumeration constants
<xsl:call-template name="sortconsts">
<xsl:with-param name="consts" select="$constlist"/>
</xsl:call-template>
// Enumeration Interfaces
public interface GenericBooleanInterface {
int TRUE = Constants.TRUE;
int FALSE = Constants.FALSE;
}
public interface GenericBorderStyleInterface {
int NONE = Constants.NONE;
int HIDDEN = Constants.HIDDEN;
int DOTTED = Constants.DOTTED;
int DASHED = Constants.DASHED;
int SOLID = Constants.SOLID;
int DOUBLE = Constants.DOUBLE;
int GROOVE = Constants.GROOVE;
int RIDGE = Constants.RIDGE;
int INSET = Constants.INSET;
int OUTSET = Constants.OUTSET;
}
public interface GenericBreakInterface {
int AUTO = Constants.AUTO;
int COLUMN = Constants.COLUMN;
int PAGE = Constants.PAGE;
int EVEN_PAGE = Constants.EVEN_PAGE;
int ODD_PAGE = Constants.ODD_PAGE;
}
public interface GenericCondBorderWidthInterface {
public interface Conditionality {
int DISCARD = Constants.DISCARD;
int RETAIN = Constants.RETAIN;
}
}
public interface GenericCondPaddingInterface {
public interface Conditionality {
int DISCARD = Constants.DISCARD;
int RETAIN = Constants.RETAIN;
}
}
public interface GenericKeepInterface {
public interface WithinPage {
int AUTO = Constants.AUTO;
int ALWAYS = Constants.ALWAYS;
}
public interface WithinLine {
int AUTO = Constants.AUTO;
int ALWAYS = Constants.ALWAYS;
}
public interface WithinColumn {
int AUTO = Constants.AUTO;
int ALWAYS = Constants.ALWAYS;
}
}
public interface GenericSpaceInterface {
public interface Precedence {
int FORCE = Constants.FORCE;
}
public interface Conditionality {
int DISCARD = Constants.DISCARD;
int RETAIN = Constants.RETAIN;
}
}
<xsl:apply-templates select = "document(propfile)//property[not(@type='generic')]">
<xsl:sort select="name"/>
</xsl:apply-templates>
<xsl:text>
}
</xsl:text>
</xsl:template>
<xsl:template match="property">
<xsl:variable name="classname">
<xsl:choose>
<xsl:when test="class-name">
<xsl:value-of select="class-name"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="makeClassName">
<xsl:with-param name="propstr" select="name"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="bEnum">
<xsl:call-template name="hasEnum"/>
</xsl:variable>
<xsl:variable name="bSubpropEnum">
<xsl:call-template name="hasSubpropEnum"/>
</xsl:variable>
<xsl:if test="$bEnum='true' or contains($bSubpropEnum, 'true')">
<!--redirect:write select="concat($classname, '.java')"-->
<!-- Handle enumeration values -->
<xsl:text>
public interface </xsl:text>
<xsl:value-of select="$classname"/>
<xsl:if test="use-generic">
<xsl:text> extends </xsl:text>
<xsl:value-of select="use-generic"/>
<xsl:text>Interface</xsl:text>
</xsl:if>
<xsl:text> {</xsl:text>
<xsl:for-each select="enumeration/value">
<xsl:text>
int </xsl:text>
<xsl:value-of select="@const"/>
<xsl:text> = Constants.</xsl:text>
<xsl:value-of select="@const"/>
<xsl:text>;</xsl:text>
</xsl:for-each>
<xsl:text> }
</xsl:text>
</xsl:if>
</xsl:template>
<xsl:template name="sortconsts">
<xsl:param name="consts"/>
<xsl:param name="prevconst"/>
<xsl:param name="num" select="1"/>
<xsl:param name="suffix" select="''"/>
<xsl:param name="counter" select="''"/>
<xsl:variable name="cval" select="substring-before($consts,':')"/>
<xsl:choose>
<xsl:when test="$consts = ''">
<xsl:if test="$counter != ''">
<xsl:text>
int </xsl:text>
<xsl:value-of select="$counter"/>_COUNT = <xsl:value-of select="$num - 1"/>;
</xsl:if>
</xsl:when>
<xsl:when test="$cval = $prevconst">
<xsl:call-template name="sortconsts">
<xsl:with-param name="consts" select="substring-after($consts,concat($cval, ':'))"/>
<xsl:with-param name="num" select="$num"/>
<xsl:with-param name="prevconst" select="$cval"/>
<xsl:with-param name="counter" select="$counter"/>
<xsl:with-param name="suffix" select="$suffix"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:text>
int </xsl:text>
<xsl:value-of select="$cval"/>
<xsl:text> = </xsl:text>
<xsl:value-of select="$num"/>
<xsl:value-of select="$suffix"/>
<xsl:text>;</xsl:text>
<xsl:call-template name="sortconsts">
<xsl:with-param name="consts" select="substring-after($consts,concat($cval, ':'))"/>
<xsl:with-param name="num" select="$num + 1"/>
<xsl:with-param name="prevconst" select="$cval"/>
<xsl:with-param name="counter" select="$counter"/>
<xsl:with-param name="suffix" select="$suffix"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
@@ -0,0 +1,254 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- $Id$ -->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:lxslt="http://xml.apache.org/xslt">
<xsl:include href="propinc.xsl"/>
<xsl:output method="text" />
<xsl:template name="genmaker">
<xsl:param name="prop" select="."/>
<xsl:param name="htname"/>
<xsl:variable name="makerclass">
<xsl:choose>
<xsl:when test="$prop/use-generic and count($prop/*)=2">
<xsl:value-of select="$prop/use-generic"/>
</xsl:when>
<xsl:when test="$prop/class-name">
<xsl:value-of select="$prop/class-name"/><xsl:text>Maker</xsl:text>
</xsl:when>
<xsl:otherwise> <!-- make from name -->
<xsl:call-template name="makeClassName">
<xsl:with-param name="propstr" select="$prop/name"/>
</xsl:call-template><xsl:text>Maker</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="lcletters" select="'abcdefghijklmnopqrstuvwxyz-:'" />
<xsl:variable name="ucletters" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ__'" />
<xsl:variable name="enum" select="translate($prop/name, $lcletters, $ucletters)"/>
<xsl:text> addPropertyName("</xsl:text><xsl:value-of select="$prop/name"/>", PR_<xsl:value-of select="$enum"/>);
<xsl:text> </xsl:text><xsl:value-of select="$htname"/>[PR_<xsl:value-of select="$enum"/>] =<xsl:value-of select="$makerclass"/>.maker(PR_<xsl:value-of select="$enum"/>);
</xsl:template>
<xsl:template name="genenum">
<xsl:param name="prop" select="."/>
<xsl:variable name="lcletters" select="'abcdefghijklmnopqrstuvwxyz-:'" />
<xsl:variable name="ucletters" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ__'" />
<xsl:variable name="num" select="count(preceding-sibling::property)"/>
<xsl:variable name="enum" select="translate($prop/name, $lcletters, $ucletters)"/>
<!--
<xsl:text> public final static short </xsl:text><xsl:value-of select="$enum"/> = <xsl:value-of select="$num"/>;
-->
</xsl:template>
<xsl:template match="text()"/>
<xsl:template match="text()" mode="enums"/>
<xsl:template match="property-list">
package org.apache.fop.fo.properties;
import java.util.HashMap;
import java.util.Set;
import org.apache.fop.fo.Constants;
import org.apache.fop.fo.Property;
//import org.apache.fop.svg.*;
public class <xsl:value-of select="@family"/>PropertyMapping implements Constants {
private static Property.Maker[] s_htGeneric = new Property.Maker[PROPERTY_COUNT+1];
/* s_htElementLists not currently used; apparently for specifying element-specific
* property makers (instead of the default maker for a particular property); see
* former org.apache.fop.fo.PropertyListBuilder
*/
private static HashMap s_htElementLists = new HashMap();
private static HashMap s_htSubPropNames = new HashMap();
private static HashMap s_htPropNames = new HashMap();
private static HashMap s_htPropIds = new HashMap();
<xsl:for-each select="element-property-list">
private static HashMap s_ht<xsl:value-of select="localname[1]"/>;</xsl:for-each>
<xsl:apply-templates/>
public static Property.Maker[] getGenericMappings() {
return s_htGeneric;
}
public static Set getElementMappings() {
return s_htElementLists.keySet();
}
public static Property.Maker[] getElementMapping(int elemName) {
return (Property.Maker[])s_htElementLists.get(new Integer(elemName));
}
public static int getPropertyId(String name) {
// check to see if base.compound or just base property
int sepchar = name.indexOf('.');
if (sepchar > -1) {
Integer baseId = (Integer) s_htPropNames.get(name.substring(0, sepchar));
if (baseId == null) {
return -1;
} else {
int cmpdId = getSubPropertyId(name.substring(sepchar + 1));
if (cmpdId == -1) {
return -1;
} else {
return baseId.intValue() + cmpdId;
}
}
} else {
Integer baseId = (Integer) s_htPropNames.get(name);
if (baseId == null)
return -1;
return baseId.intValue();
}
}
public static int getSubPropertyId(String name) {
Integer i = (Integer) s_htSubPropNames.get(name);
if (i == null)
return -1;
return i.intValue();
}
// returns a property, compound, or property.compound name
public static String getPropertyName(int id) {
if (((id &amp; Constants.COMPOUND_MASK) == 0)
|| ((id &amp; Constants.PROPERTY_MASK) == 0)) {
return (String) s_htPropIds.get(new Integer(id));
} else {
return (String) s_htPropIds.get(new Integer(
id &amp; Constants.PROPERTY_MASK)) + "." + s_htPropIds.get(
new Integer(id &amp; Constants.COMPOUND_MASK));
}
}
static {
addSubPropertyName("length", CP_LENGTH);
addSubPropertyName("conditionality", CP_CONDITIONALITY);
addSubPropertyName("block-progression-direction", CP_BLOCK_PROGRESSION_DIRECTION);
addSubPropertyName("inline-progression-direction", CP_INLINE_PROGRESSION_DIRECTION);
addSubPropertyName("within-line", CP_WITHIN_LINE);
addSubPropertyName("within-column", CP_WITHIN_COLUMN);
addSubPropertyName("within-page", CP_WITHIN_PAGE);
addSubPropertyName("minimum", CP_MINIMUM);
addSubPropertyName("maximum", CP_MAXIMUM);
addSubPropertyName("optimum", CP_OPTIMUM);
addSubPropertyName("precedence", CP_PRECEDENCE);
}
public static void addPropertyName(String name, int id) {
s_htPropNames.put(name, new Integer(id));
s_htPropIds.put(new Integer(id), name);
}
public static void addSubPropertyName(String name, int id) {
s_htSubPropNames.put(name, new Integer(id));
s_htPropIds.put(new Integer(id), name);
}
}
</xsl:template>
<xsl:template match="generic-property-list">
<xsl:apply-templates mode="enums"/>
static {
// Generate the generic mapping
<xsl:apply-templates>
<xsl:with-param name="htname" select='"s_htGeneric"'/>
</xsl:apply-templates>
}
</xsl:template>
<xsl:template match="element-property-list">
<xsl:variable name="ename" select="localname[1]"/>
static {
s_ht<xsl:value-of select="$ename"/> = new HashMap();
<xsl:for-each select="localname">
s_htElementLists.put("<xsl:value-of select='.'/>", s_ht<xsl:value-of select='$ename'/>);
</xsl:for-each>
<xsl:apply-templates>
<xsl:with-param name='htname'>s_ht<xsl:value-of select="$ename"/></xsl:with-param>
</xsl:apply-templates>
}
</xsl:template>
<xsl:template match="property[@type='generic']" mode="enums">
/* PROPCLASS = <xsl:call-template name="propclass"/> */
</xsl:template>
<xsl:template match="property" mode="enums">
<xsl:param name="htname"/>
<xsl:variable name="refname" select="name"/>
<xsl:choose>
<xsl:when test="@type='ref'">
<xsl:call-template name="genenum">
<xsl:with-param name="htname" select="$htname"/>
<xsl:with-param name="prop"
select='document(concat(@family, "properties.xml"))//property[name=$refname]'/>
</xsl:call-template>
</xsl:when>
<xsl:when test="not(@type)">
<xsl:call-template name="genenum">
<xsl:with-param name="htname" select="$htname"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise/>
</xsl:choose>
</xsl:template>
<xsl:template match="subproperty" mode="enums">
<xsl:call-template name="genenum"/>
</xsl:template>
<xsl:template match="property">
<xsl:param name="htname"/>
<xsl:variable name="refname" select="name"/>
<xsl:choose>
<xsl:when test="@type='ref'">
<xsl:call-template name="genmaker">
<xsl:with-param name="htname" select="$htname"/>
<xsl:with-param name="prop"
select='document(concat(@family, "properties.xml"))//property[name=$refname]'/>
</xsl:call-template>
</xsl:when>
<xsl:when test="not(@type)">
<xsl:call-template name="genmaker">
<xsl:with-param name="htname" select="$htname"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise/>
</xsl:choose>
</xsl:template>
<xsl:template match="property[@type='generic']">
/* PROPCLASS = <xsl:call-template name="propclass"/> */
</xsl:template>
</xsl:stylesheet>
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+328
View File
@@ -0,0 +1,328 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- $Id$ -->
<!--
DTD for foproperties.xml and svgproperties.xml
-->
<!DOCTYPE property-list [
<!ELEMENT property-list (generic-property-list?, element-property-list*) >
<!-- This defines properties which are generic: meaning they are valid for
any formatting object in the namespace associated with this properties
file.
-->
<!ELEMENT generic-property-list (property+) >
<!-- This defines properties which are specific to a particular element.
The elements are specified in one or more localname elements. This
will generate code which can be used to set up element-specific
mappings for the PropertyListBuilder object.
-->
<!ELEMENT element-property-list (localname+, property+) >
<!ELEMENT localname (#PCDATA) >
<!-- Define a single property in the current namespace -->
<!ELEMENT property (name, (use-generic | datatype), class-name?, inherited?,
default?, enumeration?, datatype-conversion*, compound?,
keyword-equiv*, percent-ok?, auto-ok?, derive?, corresponding? ) >
<!-- If type is set to "ref", then this is not a new property definition,
but rather a reference to a property allready defined (should be in
another namespace). The "family" attribute then indicates in which
other property family the referenced attribute is defined. This is
used to let SVG reuse font-related properties defined in FO.
The family attribute is ignored if type isn't "ref".
If type = "generic", this is not a "real" property but rather a
template on which one or usually several other properties are
based. This reduces typing in the properties files and can reduce the
number and size of property classes created.
-->
<!ATTLIST property
type (ref|generic|normal) "normal"
family (fo|svg) "fo"
>
<!-- Sub-elements of property. -->
<!-- This gives the name of the attribute used to specify values for this
property in input FO or SVG files. It MUST be specified.
-->
<!ELEMENT name (#PCDATA) >
<!-- This gives the class name of the Java class which will be created to
represent values for this property. It doesn't need to be specified if
it can be deduced from the "name". The rule is that the first letter
of the property name and any name following a "-" are capitalized and
the "-" characters are removed. If you want to force a name, use the
class-name sub-element.
-->
<!ELEMENT class-name (#PCDATA) >
<!-- This indicates that this property is based on a generic property
datatype. This may be one hand-coded, such as SVGLengthProperty, or it
may be one which is created by a generic property definition in the
properties.xml file being processed. The content of this element is
the CLASSNAME of the generic property (NOTE: not its name). A property
can be based on a generic property and still override certain aspects
such as the default value, simply by specifying the appropriate
sub-elements.
If the "ispropclass" attribute = "true", then the contents of the
use-generic element is the name of a hard-coded Property subclass
and not of a generated Property.Maker subclass. This is currently
only used for the SVG properties, because they don't have a
rule-based relationship between the actual Property class name
and the name of the datatype stored by objects of that class.
-->
<!ELEMENT use-generic (#PCDATA) >
<!ATTLIST use-generic
ispropclass (true | false ) "false"
>
<!-- This indicates whether the property is inherited or not. Use the value
true for inherited and false for non-inherited. If the attribute
"type" is set to "specified", the specified rather than the computed
value of the property is inherited. An example is line-height, which
if specified using relative units or a percent, is recalculated
relative to the FONTSIZE of the current FO.
-->
<!ELEMENT inherited (#PCDATA) >
<!ATTLIST inherited
type (specified | computed) "computed"
>
<!-- This gives the datatype of the stored property values. It shouldn't be
specified if the property has a use-generic element. The value of this
element should be the name of either a basic Java class (String,
Integer) or a class defined as a FOP or SVG datatype (eg. ColorType).
NOTE: the value "Enum" is special and indicates an enumerated
datatype, stored as a Java "int". There is an EnumProperty class, but
no corresponding Enum class.
-->
<!ELEMENT datatype (#PCDATA) >
<!-- This element is used to specify the allowable values for enumerated
datatypes (<datatype>Enum</datatype>). Each value sub-element
specifies a possible value for the property. The "const" attribute for
each value is used to generate a public static constant value in the
class which can be referenced in code to test the property value. It
must be a legal Java identifier. By convention, use all caps.
-->
<!ELEMENT enumeration (value+) >
<!ELEMENT value (#PCDATA) >
<!ATTLIST value
const CDATA #REQUIRED
>
<!-- This gives the default value for a property if it is not specified on
a given FO. (The spec calls this the "initial" value.)
It may also be used to specify a default value for a particular
component of a compound property. This is used to give each component
its initial value if components are only partially specified in the
FO file.
NOTE: It should be an expression which can be parsed to give a legal
value for the property! This can't be checked by the generating
script, so if there is a problem, it will only be seen at runtime.
If the attribute "contextdep" is present and set to "true", the
generated code for the Maker will create a new Property object each
time it is asked to make the default value. Otherwise (the usual
case), it will only make one Property object with the default value
and return it on each call. Context-dependent default values include
those specified with relative units (eg. 1em).
The "subproperty" attribute can be used on properties which are
based on generic property specifications to specify a default value
for a particular component. For example, the border-end-width property
is based on GenericCondBorderWidth and specifies a specific default
for the "conditionality" component.
-->
<!ELEMENT default (#PCDATA) >
<!ATTLIST default
contextdep (true | false) "false"
subproperty CDATA #IMPLIED
>
<!-- The datatype-conversion element(s) specify how to handle property
values which can be specified in several ways. For example, the
line-height property can be specified as a Length, or as a number or
as a percent, which are both interpreted as being a factor of the
current font-size. The datatype for this property is Length. The
datatype-conversion element is used to handle the cases in which the
Property parser returns a type which is not a Length. Each element
tests it against a possible property type. The content gives the
actual code which should be inserted in the generated class in order
to correctly initialize the property value.
NOTE: the use of this for Color properties is rather a hack. All color
properties can be specified by a large number of keywords. To be
consistent with my logic we should use the keyword-equiv element. But
that was a lot of work. So for now, if the value evaluates to a String
and not to a ColorType, the datatype-conversion just uses it to
directly initialize a ColorType object.
-->
<!ELEMENT datatype-conversion (#PCDATA) >
<!-- The attribute from-type gives a possible property datatype, such as
Number or String. The varname gives the name of a variable which can
be used in the content of the datatype-conversion element. If the type
of the variable is not the same as from-type, it may be specified with
the attribute vartype.
An example of usage is from the line-height property. This should be
a Length object, but may be specified as a Number, which is interpreted
as though it were a percentage of the current font-size.
-->
<!ATTLIST datatype-conversion
from-type CDATA #REQUIRED
vartype CDATA #IMPLIED
varname CDATA #REQUIRED
>
<!-- The compound element indicates that the property is a "compound"
property as defined in the XSL specification. It is specified as one
or more individual attributes whose names are built up from the base
property name and the name of a compoent. Each "subproperty" element
describes a component of a compound property.
An example is space-before.
-->
<!ELEMENT compound (subproperty+) >
<!-- Describe one component of a compound property. Only the name and the
datatype should be specified. For example, in the space-before
property, the optimum component has the name optimum and the datatype
Length.
-->
<!ELEMENT subproperty (name, datatype, auto-ok?, default?, corresponding?,
enumeration?, keyword-equiv? ) >
<!-- This element which may be repeated, specifies keyword shorthands for
non-enumerated properties. For example, the border-width family of
properties can be specified either by a Length (eg. 1pt) or by one of
the keywords "thin", "medium", or "thick", each of which corresponds
to a "user-agent specific value" (XSL Spec.) These values are defined
by the keyword-equiv element. The "match" attribute gives the string
keyword value and the content is the replacement value, which should
be able to be evaluated to produce an object of the property's
datatype (such as Length). An example is:
<keyword-equiv match="thin" eval="true">0.5pt</keyword-equiv>
The "eval" attribute indicates whether the specified value must be
"parsed" using the Property parser or whether it can be used to
directly construct an object of the appropriate datatype. The default
is to evaluate the specified value (like the default specification).
-->
<!ELEMENT keyword-equiv (#PCDATA) >
<!ATTLIST keyword-equiv
match CDATA #REQUIRED
eval (true|false) "true"
>
<!-- This element if present indicates that percent specifications are
allowed as property values. The attribute "base" indicates how the
actual value is calculated.
FONTSIZE - the value is a percent of the current font-size
INH-FONTSIZE - the value is a percent of the inherited
font-size. This is necessary because font-size itself can be specified
as a percent!
CONTAINING-BOX - the value is a percent of the appropriate
dimension of the containing box of this FO.
If none of these is specified, the content of the element is
assumed to be a Java expression which can be used to calculate an
absolute value. This expression can assume that the variables
propertyList and fo are in scope and refer to the FO on which the
property was specified as a percent.
-->
<!ELEMENT percent-ok (#PCDATA) >
<!ATTLIST percent-ok
base (FONTSIZE | INH-FONTSIZE | CONTAINING-BOX) #IMPLIED
>
<!-- This element if present indicates that a value of "auto" for a Length
specification is allowed. If "auto" is specified, a LengthProperty object
is created which holds a Length object of type "AUTO".
-->
<!ELEMENT auto-ok EMPTY >
<!-- This element if present indicates that the value of the property may
be computed (derived) from other properties if it isn't specified. It
assumes that the property is an Enum datatype. (Currently only used
for text-align-last.)
The "from" attribute gives the name of the property from which this
property is derived.
Each "if" sub-element specifies a possible value. The "match"
attribute is compared with the value of the "derive-from" property. If
it is equal, the value of the current property is set to the value
specified by the content of the "if" element.
-->
<!ELEMENT derive (if+) >
<!ATTLIST derive
from CDATA #REQUIRED
>
<!ELEMENT if (#PCDATA) >
<!ATTLIST if
match CDATA #REQUIRED
>
<!-- This element indicates that the value of the property is the same as
that of a "corresponding" absolute or writing-mode-relative property.
if the "use-if-specified" attribute has the value "true", then the
corresponding property value takes precedence over the property on
which it is specified. To be conformant to the specification, all the
the "absolute" versions of properties have precedence.
Example: if a get() call is made on padding-end for a FO using lr-tb
writing-mode, then the padding-right property will be used if it is
specified, even if padding-end is actually specified.
However, if a get() is made on padding-right, the value of padding-end
will only be used if padding-right isn't specified on the FO.
-->
<!ELEMENT corresponding (propval, propexpr?) >
<!ATTLIST corresponding
use-if-specified (true|false) "false"
>
<!-- If the value must be calculated using several other properties, the
propexpr element may be used. Then only example I know of are the
indent properties which are calculated based on the margin-* values
if those are specified, plus the corresponding padding and border-width
values.
-->
<!ELEMENT propexpr (propval | #PCDATA)+ >
<!-- The name of the corresponding property is given in the propval element.
The conversion between absolute and relative property names is
made using wmrel2abs or wm2bs2rel elements, intermixed with text.
For example, for the property "padding-left", the corresponding
property is "padding-start" if the inline progression direction is
left to right. This is expressed in the properties file with the
expression "padding-<wmabs2rel dir='LEFT'/>". The wmabs2rel element
is replaced by the writing-mode relative direction which corresponds
to the absolute direction LEFT using the writing-mode in effect for the
flow object where this property is specified.
-->
<!ELEMENT propval (wmrel2abs | wmabs2rel | #PCDATA)+ >
<!ELEMENT wmrel2abs EMPTY>
<!ATTLIST wmrel2abs
dir (BEFORE | AFTER | START | END | BLOCKPROGDIM | INLINEPROGDIM)
#REQUIRED
>
<!ELEMENT wmabs2rel EMPTY>
<!ATTLIST wmabs2rel
dir (TOP | BOTTOM | LEFT | RIGHT | HEIGHT | WIDTH ) #REQUIRED
>
@@ -0,0 +1,289 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- $Id$ -->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" />
<xsl:include href="propinc.xsl"/>
<xsl:template match="root">
<xsl:text>
package org.apache.fop.fo;
import org.apache.fop.fo.Constants;
import java.util.BitSet;
import java.util.ArrayList;
public class PropertySets {
private static short[][] mapping = null;
private Element[] elements = new Element[Constants.ELEMENT_COUNT+1];
private BitSet block_elems = new BitSet();
private BitSet inline_elems = new BitSet();
</xsl:text>
<xsl:apply-templates select="common" mode="decl"/>
<xsl:text>
public void initializeElements() {
block_elems.set(Constants.FO_BLOCK);
block_elems.set(Constants.FO_BLOCK_CONTAINER);
block_elems.set(Constants.FO_TABLE_AND_CAPTION);
block_elems.set(Constants.FO_TABLE);
block_elems.set(Constants.FO_LIST_BLOCK);
inline_elems.set(Constants.FO_BIDI_OVERRIDE);
inline_elems.set(Constants.FO_CHARACTER);
inline_elems.set(Constants.FO_EXTERNAL_GRAPHIC);
inline_elems.set(Constants.FO_INSTREAM_FOREIGN_OBJECT);
inline_elems.set(Constants.FO_INLINE);
inline_elems.set(Constants.FO_INLINE_CONTAINER);
inline_elems.set(Constants.FO_LEADER);
inline_elems.set(Constants.FO_PAGE_NUMBER);
inline_elems.set(Constants.FO_PAGE_NUMBER_CITATION);
inline_elems.set(Constants.FO_BASIC_LINK);
inline_elems.set(Constants.FO_MULTI_TOGGLE);
}
public void initializeCommon() {
</xsl:text>
<xsl:apply-templates select="common"/>
<xsl:text>
}
public void initialize() {
// define the fo: elements
for (int i = 1; i &lt; elements.length; i++) {
elements[i] = new Element(i);
}
// populate the elements with properties and content elements.
Element elem;
</xsl:text>
<xsl:apply-templates select="//element"/>
<xsl:text>
// Merge the attributes from the children into the parent.
for (boolean dirty = true; dirty; ) {
dirty = false;
for (int i = 1; i &lt; elements.length; i++) {
dirty = dirty || elements[i].merge();
}
}
// Calculate the sparse indices for each element.
for (int i = 1; i &lt; elements.length; i++) {
mapping[i] = makeSparseIndices(elements[i].valid);
}
}
/**
* Turn a BitSet into an array of shorts with the first element
* on the array the number of set bits in the BitSet.
*/
private static short[] makeSparseIndices(BitSet set) {
short[] indices = new short[Constants.PROPERTY_COUNT+1];
int j = 1;
for (int i = 0; i &lt; Constants.PROPERTY_COUNT+1; i++) {
if (set.get(i)) {
indices[i] = (short) j++;
}
}
indices[0] = (short)j;
return indices;
}
public static short[] getPropertySet(int elementId) {
if (mapping == null) {
mapping = new short[Constants.ELEMENT_COUNT+1][];
PropertySets ps = new PropertySets();
ps.initializeElements();
ps.initializeCommon();
ps.initialize();
}
return mapping[elementId];
}
/**
* An object that represent the properties and contents of a fo element
*/
class Element {
BitSet relevant = new BitSet();
BitSet valid = new BitSet();
int elementId;
ArrayList children;
Element(int elementId) {
this.elementId = elementId;
}
/**
* Add a single property to the element.
*/
public void addProperty(int propId) {
relevant.set(propId);
valid.set(propId);
}
/**
* Add a set of properties to the element.
*/
public void addProperties(BitSet properties) {
relevant.or(properties);
valid.or(properties);
}
/**
* Add a single fo element as a content child.
*/
public void addContent(int elementId) {
if (children == null) {
children = new ArrayList();
}
children.add(elements[elementId]);
}
/**
* Add a set of fo elements as content children.
*/
public void addContent(BitSet elements) {
for (int i = 0; i &lt; elements.size(); i++) {
if (elements.get(i)) {
addContent(i);
}
}
}
/**
* Merge the properties from the children into the set of valid
* properties. Return true if at least one property could be added.
*/
public boolean merge() {
if (children == null) {
return false;
}
boolean dirty = false;
for (int i = 0; i &lt; children.size(); i++) {
Element child = (Element) children.get(i);
BitSet childValid = child.valid;
int n = childValid.length();
for (int j = 0; j &lt; n; j++) {
if (childValid.get(j) &amp;&amp; !valid.get(j)) {
dirty = true;
valid.set(j);
}
}
}
return dirty;
}
}
}
</xsl:text>
</xsl:template>
<xsl:template match="common" mode="decl">
<xsl:variable name="name" select="name"/>
<xsl:text> BitSet </xsl:text><xsl:value-of select="$name"/>
<xsl:text> = new BitSet();
</xsl:text>
</xsl:template>
<xsl:template match="common">
<xsl:variable name="name" select="name"/>
<xsl:apply-templates select="property">
<xsl:with-param name="setname" select="$name"/>
</xsl:apply-templates>
<xsl:text>
</xsl:text>
</xsl:template>
<xsl:template match="common/property">
<xsl:param name="setname"/>
<xsl:text> </xsl:text>
<xsl:value-of select="../name"/><xsl:text>.set(Constants.PR_</xsl:text>
<xsl:call-template name="makeEnumConstant">
<xsl:with-param name="propstr" select="." />
</xsl:call-template>);
</xsl:template>
<xsl:template match="element">
<xsl:variable name="name">
<xsl:call-template name="makeEnumConstant">
<xsl:with-param name="propstr" select="name" />
</xsl:call-template>
</xsl:variable>
<xsl:text> elem = elements[Constants.FO_</xsl:text>
<xsl:value-of select="$name"/>
<xsl:text>];
</xsl:text>
<xsl:apply-templates select="common-ref | property"/>
<xsl:apply-templates select="content"/>
<xsl:text>
</xsl:text>
</xsl:template>
<xsl:template match="element/common-ref">
<xsl:param name="setname"/>
<xsl:text> elem.addProperties(</xsl:text>
<xsl:value-of select="."/>);
</xsl:template>
<xsl:template match="element/property">
<xsl:param name="setname"/>
<xsl:text> elem.addProperty(Constants.PR_</xsl:text>
<xsl:call-template name="makeEnumConstant">
<xsl:with-param name="propstr" select="." />
</xsl:call-template>);
</xsl:template>
<xsl:template match="element/content">
<xsl:variable name="name">
<xsl:text>Constants.FO_</xsl:text>
<xsl:call-template name="makeEnumConstant">
<xsl:with-param name="propstr" select="." />
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test=". = '%block;'">
<xsl:text> elem.addContent(block_elems);
</xsl:text>
</xsl:when>
<xsl:when test=". = '%inline;'">
<xsl:text> elem.addContent(inline_elems);
</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text> elem.addContent(</xsl:text>
<xsl:value-of select="$name"/>
<xsl:text>);
</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="text()"/>
</xsl:stylesheet>
+128
View File
@@ -0,0 +1,128 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- $Id$ -->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:key name="genericref" match="property[@type='generic']" use="class-name"/>
<xsl:key name="shorthandref" match="property" use="name"/>
<xsl:template name="capfirst">
<xsl:param name="str"/>
<xsl:variable name="lcletters" select="'abcdefghijklmnopqrstuvwxyz'" />
<xsl:variable name="ucletters" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />
<xsl:value-of select="concat(translate(substring($str, 1, 1),
$lcletters, $ucletters), substring($str, 2))"/>
</xsl:template>
<xsl:template name="makeClassName">
<xsl:param name="propstr"/>
<xsl:choose>
<xsl:when test="contains($propstr, '-')">
<xsl:call-template name="capfirst">
<xsl:with-param name="str" select="substring-before($propstr, '-')"/>
</xsl:call-template>
<xsl:call-template name="makeClassName">
<xsl:with-param name="propstr" select="substring-after($propstr, '-')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="capfirst">
<xsl:with-param name="str" select="$propstr"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- Generate enumeration constants for FO's, Properties, etc. -->
<xsl:template name="makeEnumConstant">
<xsl:param name="propstr"/>
<xsl:variable name="lcletters" select="'abcdefghijklmnopqrstuvwxyz-:'" />
<xsl:variable name="ucletters" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ__'" />
<xsl:value-of select="translate($propstr, $lcletters, $ucletters)"/>
</xsl:template>
<!-- The name of the subclass of Property to be created -->
<xsl:template name="propclass">
<xsl:param name="prop" select="."/>
<xsl:choose>
<xsl:when test="$prop/datatype">
<xsl:value-of select="$prop/datatype"/><xsl:text>Property</xsl:text>
</xsl:when>
<xsl:when test="$prop/use-generic[@ispropclass='true']">
<xsl:value-of select="$prop/use-generic"/>
</xsl:when>
<xsl:when test="$prop/use-generic">
<!-- If no datatype child, then the prop must use the same datatype as
its template. -->
<xsl:call-template name="propclass">
<xsl:with-param name="prop"
select="key('genericref', $prop/use-generic)"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<!-- ERROR -->
<xsl:message terminate="yes">
No datatype found for property: <xsl:value-of select="$prop/name"/>
</xsl:message>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- return a boolean value -->
<xsl:template name="hasEnum">
<xsl:param name="prop" select="."/>
<xsl:choose>
<xsl:when test="$prop/enumeration">true</xsl:when>
<xsl:when test="$prop/use-generic">
<!-- If no datatype child, then the prop must use the same datatype as
its template. -->
<xsl:call-template name="hasEnum">
<xsl:with-param name="prop"
select="key('genericref', $prop/use-generic)"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>false</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- return a boolean value -->
<xsl:template name="hasSubpropEnum">
<xsl:param name="prop" select="."/>
<xsl:choose>
<xsl:when test="$prop/compound/subproperty/enumeration">true</xsl:when>
<xsl:when test="$prop/use-generic">
<!-- If no datatype child, then the prop must use the same datatype as
its template. -->
<xsl:call-template name="hasSubpropEnum">
<xsl:with-param name="prop"
select="key('genericref', $prop/use-generic)"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$prop/compound/subproperty/use-generic">
<xsl:for-each select="$prop/compound/subproperty[use-generic]">
<xsl:call-template name="hasEnum">
<xsl:with-param name="prop"
select="key('genericref', use-generic)"/>
</xsl:call-template>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>false</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
+47
View File
@@ -0,0 +1,47 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- $Id$ -->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:lxslt="http://xml.apache.org/xslt"
xmlns:redirect="org.apache.xalan.xslt.extensions.Redirect"
extension-element-prefixes="redirect">
<xsl:import href="elements.xsl"/>
<xsl:output method="xml" />
<xsl:template match="elements">
<property-list>
<xsl:attribute name="family">
<xsl:call-template name="capall"><xsl:with-param name="str" select="$prefixVal"/></xsl:call-template>
</xsl:attribute>
<generic-property-list>
<xsl:apply-templates select="*//attribute"/>
</generic-property-list>
</property-list>
</xsl:template>
<xsl:template match="*//attribute">
<property>
<name><xsl:apply-templates/></name>
<use-generic ispropclass="true">SVGStringProperty</use-generic>
</property>
</xsl:template>
</xsl:stylesheet>
+267
View File
@@ -0,0 +1,267 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- $Id$ -->
<!-- JKT: these metrics in XML were kindly produced by Fotis Jannidis -->
<font-metrics>
<font-name>Courier</font-name>
<full-name>Courier</full-name>
<family-name>Courier</family-name>
<class-name>Courier</class-name>
<encoding>StandardEncoding</encoding>
<underline-position>-100</underline-position>
<underline-thickness>50</underline-thickness>
<cap-height>562</cap-height>
<x-height>426</x-height>
<ascender>629</ascender>
<descender>-157</descender>
<first-char>32</first-char>
<last-char>255</last-char>
<char-metrics>
<char name="A" width="600" llx="3" lly="0" urx="597" ury="562"/>
<char name="AE" width="600" llx="3" lly="0" urx="550" ury="562"/>
<char name="Aacute" width="600" llx="3" lly="0" urx="597" ury="805"/>
<char name="Acircumflex" width="600" llx="3" lly="0" urx="597" ury="787"/>
<char name="Adieresis" width="600" llx="3" lly="0" urx="597" ury="753"/>
<char name="Agrave" width="600" llx="3" lly="0" urx="597" ury="805"/>
<char name="Aring" width="600" llx="3" lly="0" urx="597" ury="750"/>
<char name="Atilde" width="600" llx="3" lly="0" urx="597" ury="729"/>
<char name="B" width="600" llx="43" lly="0" urx="559" ury="562"/>
<char name="C" width="600" llx="41" lly="-18" urx="540" ury="580"/>
<char name="Ccedilla" width="600" llx="41" lly="-151" urx="540" ury="580"/>
<char name="D" width="600" llx="43" lly="0" urx="574" ury="562"/>
<char name="E" width="600" llx="53" lly="0" urx="550" ury="562"/>
<char name="Eacute" width="600" llx="53" lly="0" urx="550" ury="805"/>
<char name="Ecircumflex" width="600" llx="53" lly="0" urx="550" ury="787"/>
<char name="Edieresis" width="600" llx="53" lly="0" urx="550" ury="753"/>
<char name="Egrave" width="600" llx="53" lly="0" urx="550" ury="805"/>
<char name="Eth" width="600" llx="30" lly="0" urx="574" ury="562"/>
<char name="Euro" width="600" llx="0" lly="0" urx="0" ury="0"/>
<char name="F" width="600" llx="53" lly="0" urx="545" ury="562"/>
<char name="G" width="600" llx="31" lly="-18" urx="575" ury="580"/>
<char name="H" width="600" llx="32" lly="0" urx="568" ury="562"/>
<char name="I" width="600" llx="96" lly="0" urx="504" ury="562"/>
<char name="Iacute" width="600" llx="96" lly="0" urx="504" ury="805"/>
<char name="Icircumflex" width="600" llx="96" lly="0" urx="504" ury="787"/>
<char name="Idieresis" width="600" llx="96" lly="0" urx="504" ury="753"/>
<char name="Igrave" width="600" llx="96" lly="0" urx="504" ury="805"/>
<char name="J" width="600" llx="34" lly="-18" urx="566" ury="562"/>
<char name="K" width="600" llx="38" lly="0" urx="582" ury="562"/>
<char name="L" width="600" llx="47" lly="0" urx="554" ury="562"/>
<char name="Lslash" width="600" llx="47" lly="0" urx="554" ury="562"/>
<char name="M" width="600" llx="4" lly="0" urx="596" ury="562"/>
<char name="N" width="600" llx="7" lly="-13" urx="593" ury="562"/>
<char name="Ntilde" width="600" llx="7" lly="-13" urx="593" ury="729"/>
<char name="O" width="600" llx="43" lly="-18" urx="557" ury="580"/>
<char name="OE" width="600" llx="7" lly="0" urx="567" ury="562"/>
<char name="Oacute" width="600" llx="43" lly="-18" urx="557" ury="805"/>
<char name="Ocircumflex" width="600" llx="43" lly="-18" urx="557" ury="787"/>
<char name="Odieresis" width="600" llx="43" lly="-18" urx="557" ury="753"/>
<char name="Ograve" width="600" llx="43" lly="-18" urx="557" ury="805"/>
<char name="Oslash" width="600" llx="43" lly="-80" urx="557" ury="629"/>
<char name="Otilde" width="600" llx="43" lly="-18" urx="557" ury="729"/>
<char name="P" width="600" llx="79" lly="0" urx="558" ury="562"/>
<char name="Q" width="600" llx="43" lly="-138" urx="557" ury="580"/>
<char name="R" width="600" llx="38" lly="0" urx="588" ury="562"/>
<char name="S" width="600" llx="72" lly="-20" urx="529" ury="580"/>
<char name="Scaron" width="600" llx="72" lly="-20" urx="529" ury="802"/>
<char name="Scedilla" width="600" llx="72" lly="-151" urx="529" ury="580"/>
<char name="T" width="600" llx="38" lly="0" urx="563" ury="562"/>
<char name="Thorn" width="600" llx="79" lly="0" urx="538" ury="562"/>
<char name="U" width="600" llx="17" lly="-18" urx="583" ury="562"/>
<char name="Uacute" width="600" llx="17" lly="-18" urx="583" ury="805"/>
<char name="Ucircumflex" width="600" llx="17" lly="-18" urx="583" ury="787"/>
<char name="Udieresis" width="600" llx="17" lly="-18" urx="583" ury="753"/>
<char name="Ugrave" width="600" llx="17" lly="-18" urx="583" ury="805"/>
<char name="V" width="600" llx="-4" lly="-13" urx="604" ury="562"/>
<char name="W" width="600" llx="-3" lly="-13" urx="603" ury="562"/>
<char name="X" width="600" llx="23" lly="0" urx="577" ury="562"/>
<char name="Y" width="600" llx="24" lly="0" urx="576" ury="562"/>
<char name="Yacute" width="600" llx="24" lly="0" urx="576" ury="805"/>
<char name="Ydieresis" width="600" llx="24" lly="0" urx="576" ury="753"/>
<char name="Z" width="600" llx="86" lly="0" urx="514" ury="562"/>
<char name="Zcaron" width="600" llx="86" lly="0" urx="514" ury="802"/>
<char name="a" width="600" llx="53" lly="-15" urx="559" ury="441"/>
<char name="aacute" width="600" llx="53" lly="-15" urx="559" ury="672"/>
<char name="acircumflex" width="600" llx="53" lly="-15" urx="559" ury="654"/>
<char name="acute" width="600" llx="242" lly="497" urx="469" ury="672"/>
<char name="adieresis" width="600" llx="53" lly="-15" urx="559" ury="620"/>
<char name="ae" width="600" llx="19" lly="-15" urx="570" ury="441"/>
<char name="agrave" width="600" llx="53" lly="-15" urx="559" ury="672"/>
<char name="ampersand" width="600" llx="63" lly="-15" urx="538" ury="543"/>
<char name="aring" width="600" llx="53" lly="-15" urx="559" ury="627"/>
<char name="asciicircum" width="600" llx="94" lly="354" urx="506" ury="622"/>
<char name="asciitilde" width="600" llx="63" lly="197" urx="540" ury="320"/>
<char name="asterisk" width="600" llx="116" lly="257" urx="484" ury="607"/>
<char name="at" width="600" llx="77" lly="-15" urx="533" ury="622"/>
<char name="atilde" width="600" llx="53" lly="-15" urx="559" ury="606"/>
<char name="b" width="600" llx="14" lly="-15" urx="575" ury="629"/>
<char name="backslash" width="600" llx="118" lly="-80" urx="482" ury="629"/>
<char name="bar" width="600" llx="275" lly="-250" urx="326" ury="750"/>
<char name="braceleft" width="600" llx="182" lly="-108" urx="437" ury="622"/>
<char name="braceright" width="600" llx="163" lly="-108" urx="418" ury="622"/>
<char name="bracketleft" width="600" llx="269" lly="-108" urx="442" ury="622"/>
<char name="bracketright" width="600" llx="158" lly="-108" urx="331" ury="622"/>
<char name="breve" width="600" llx="153" lly="501" urx="447" ury="609"/>
<char name="brokenbar" width="600" llx="275" lly="-175" urx="326" ury="675"/>
<char name="bullet" width="600" llx="172" lly="130" urx="428" ury="383"/>
<char name="c" width="600" llx="66" lly="-15" urx="529" ury="441"/>
<char name="caron" width="600" llx="124" lly="492" urx="476" ury="669"/>
<char name="ccedilla" width="600" llx="66" lly="-151" urx="529" ury="441"/>
<char name="cedilla" width="600" llx="224" lly="-151" urx="362" ury="10"/>
<char name="cent" width="600" llx="96" lly="-49" urx="500" ury="614"/>
<char name="circumflex" width="600" llx="124" lly="477" urx="476" ury="654"/>
<char name="colon" width="600" llx="229" lly="-15" urx="371" ury="385"/>
<char name="comma" width="600" llx="181" lly="-112" urx="344" ury="122"/>
<char name="copyright" width="600" llx="0" lly="-18" urx="600" ury="580"/>
<char name="currency" width="600" llx="73" lly="58" urx="527" ury="506"/>
<char name="d" width="600" llx="45" lly="-15" urx="591" ury="629"/>
<char name="dagger" width="600" llx="141" lly="-78" urx="459" ury="580"/>
<char name="daggerdbl" width="600" llx="141" lly="-78" urx="459" ury="580"/>
<char name="degree" width="600" llx="123" lly="269" urx="477" ury="622"/>
<char name="dieresis" width="600" llx="148" lly="537" urx="453" ury="640"/>
<char name="divide" width="600" llx="87" lly="48" urx="513" ury="467"/>
<char name="dollar" width="600" llx="105" lly="-126" urx="496" ury="662"/>
<char name="dotaccent" width="600" llx="249" lly="537" urx="352" ury="640"/>
<char name="dotlessi" width="600" llx="95" lly="0" urx="505" ury="426"/>
<char name="e" width="600" llx="66" lly="-15" urx="548" ury="441"/>
<char name="eacute" width="600" llx="66" lly="-15" urx="548" ury="672"/>
<char name="ecircumflex" width="600" llx="66" lly="-15" urx="548" ury="654"/>
<char name="edieresis" width="600" llx="66" lly="-15" urx="548" ury="620"/>
<char name="egrave" width="600" llx="66" lly="-15" urx="548" ury="672"/>
<char name="eight" width="600" llx="102" lly="-15" urx="498" ury="622"/>
<char name="ellipsis" width="600" llx="37" lly="-15" urx="563" ury="111"/>
<char name="emdash" width="600" llx="0" lly="231" urx="600" ury="285"/>
<char name="endash" width="600" llx="75" lly="231" urx="525" ury="285"/>
<char name="equal" width="600" llx="80" lly="138" urx="520" ury="376"/>
<char name="eth" width="600" llx="62" lly="-15" urx="538" ury="629"/>
<char name="exclam" width="600" llx="236" lly="-15" urx="364" ury="572"/>
<char name="exclamdown" width="600" llx="236" lly="-157" urx="364" ury="430"/>
<char name="f" width="600" llx="114" lly="0" urx="531" ury="629"/>
<char name="fi" width="600" llx="3" lly="0" urx="597" ury="629"/>
<char name="five" width="600" llx="92" lly="-15" urx="497" ury="607"/>
<char name="fl" width="600" llx="3" lly="0" urx="597" ury="629"/>
<char name="florin" width="600" llx="4" lly="-143" urx="539" ury="622"/>
<char name="four" width="600" llx="78" lly="0" urx="500" ury="622"/>
<char name="fraction" width="600" llx="92" lly="-57" urx="509" ury="665"/>
<char name="g" width="600" llx="45" lly="-157" urx="566" ury="441"/>
<char name="germandbls" width="600" llx="48" lly="-15" urx="588" ury="629"/>
<char name="grave" width="600" llx="151" lly="497" urx="378" ury="672"/>
<char name="greater" width="600" llx="66" lly="42" urx="544" ury="472"/>
<char name="guillemotleft" width="600" llx="37" lly="70" urx="563" ury="446"/>
<char name="guillemotright" width="600" llx="37" lly="70" urx="563" ury="446"/>
<char name="guilsinglleft" width="600" llx="149" lly="70" urx="451" ury="446"/>
<char name="guilsinglright" width="600" llx="149" lly="70" urx="451" ury="446"/>
<char name="h" width="600" llx="18" lly="0" urx="582" ury="629"/>
<char name="hungarumlaut" width="600" llx="133" lly="497" urx="540" ury="672"/>
<char name="hyphen" width="600" llx="103" lly="231" urx="497" ury="285"/>
<char name="i" width="600" llx="95" lly="0" urx="505" ury="657"/>
<char name="iacute" width="600" llx="95" lly="0" urx="505" ury="672"/>
<char name="icircumflex" width="600" llx="94" lly="0" urx="505" ury="654"/>
<char name="idieresis" width="600" llx="95" lly="0" urx="505" ury="620"/>
<char name="igrave" width="600" llx="95" lly="0" urx="505" ury="672"/>
<char name="j" width="600" llx="82" lly="-157" urx="410" ury="657"/>
<char name="k" width="600" llx="43" lly="0" urx="580" ury="629"/>
<char name="l" width="600" llx="95" lly="0" urx="505" ury="629"/>
<char name="less" width="600" llx="41" lly="42" urx="519" ury="472"/>
<char name="logicalnot" width="600" llx="87" lly="108" urx="513" ury="369"/>
<char name="lslash" width="600" llx="95" lly="0" urx="505" ury="629"/>
<char name="m" width="600" llx="-5" lly="0" urx="605" ury="441"/>
<char name="macron" width="600" llx="120" lly="525" urx="480" ury="565"/>
<char name="minus" width="600" llx="80" lly="232" urx="520" ury="283"/>
<char name="mu" width="600" llx="21" lly="-157" urx="562" ury="426"/>
<char name="multiply" width="600" llx="87" lly="43" urx="515" ury="470"/>
<char name="n" width="600" llx="26" lly="0" urx="575" ury="441"/>
<char name="nine" width="600" llx="96" lly="-15" urx="489" ury="622"/>
<char name="ntilde" width="600" llx="26" lly="0" urx="575" ury="606"/>
<char name="numbersign" width="600" llx="93" lly="-32" urx="507" ury="639"/>
<char name="o" width="600" llx="62" lly="-15" urx="538" ury="441"/>
<char name="oacute" width="600" llx="62" lly="-15" urx="538" ury="672"/>
<char name="ocircumflex" width="600" llx="62" lly="-15" urx="538" ury="654"/>
<char name="odieresis" width="600" llx="62" lly="-15" urx="538" ury="620"/>
<char name="oe" width="600" llx="19" lly="-15" urx="559" ury="441"/>
<char name="ogonek" width="600" llx="211" lly="-172" urx="407" ury="4"/>
<char name="ograve" width="600" llx="62" lly="-15" urx="538" ury="672"/>
<char name="one" width="600" llx="96" lly="0" urx="505" ury="622"/>
<char name="onehalf" width="600" llx="0" lly="-57" urx="611" ury="665"/>
<char name="onequarter" width="600" llx="0" lly="-57" urx="600" ury="665"/>
<char name="onesuperior" width="600" llx="172" lly="249" urx="428" ury="622"/>
<char name="ordfeminine" width="600" llx="156" lly="249" urx="442" ury="580"/>
<char name="ordmasculine" width="600" llx="157" lly="249" urx="443" ury="580"/>
<char name="oslash" width="600" llx="62" lly="-80" urx="538" ury="506"/>
<char name="otilde" width="600" llx="62" lly="-15" urx="538" ury="606"/>
<char name="p" width="600" llx="9" lly="-157" urx="555" ury="441"/>
<char name="paragraph" width="600" llx="50" lly="-78" urx="511" ury="562"/>
<char name="parenleft" width="600" llx="269" lly="-108" urx="440" ury="622"/>
<char name="parenright" width="600" llx="160" lly="-108" urx="331" ury="622"/>
<char name="percent" width="600" llx="81" lly="-15" urx="518" ury="622"/>
<char name="period" width="600" llx="229" lly="-15" urx="371" ury="109"/>
<char name="periodcentered" width="600" llx="222" lly="189" urx="378" ury="327"/>
<char name="perthousand" width="600" llx="3" lly="-15" urx="600" ury="622"/>
<char name="plus" width="600" llx="80" lly="44" urx="520" ury="470"/>
<char name="plusminus" width="600" llx="87" lly="44" urx="513" ury="558"/>
<char name="q" width="600" llx="45" lly="-157" urx="591" ury="441"/>
<char name="question" width="600" llx="129" lly="-15" urx="492" ury="572"/>
<char name="questiondown" width="600" llx="108" lly="-157" urx="471" ury="430"/>
<char name="quotedbl" width="600" llx="187" lly="328" urx="413" ury="562"/>
<char name="quotedblbase" width="600" llx="143" lly="-134" urx="457" ury="100"/>
<char name="quotedblleft" width="600" llx="143" lly="328" urx="471" ury="562"/>
<char name="quotedblright" width="600" llx="143" lly="328" urx="457" ury="562"/>
<char name="quoteleft" width="600" llx="224" lly="328" urx="387" ury="562"/>
<char name="quoteright" width="600" llx="213" lly="328" urx="376" ury="562"/>
<char name="quotesinglbase" width="600" llx="213" lly="-134" urx="376" ury="100"/>
<char name="quotesingle" width="600" llx="259" lly="328" urx="341" ury="562"/>
<char name="r" width="600" llx="60" lly="0" urx="559" ury="441"/>
<char name="registered" width="600" llx="0" lly="-18" urx="600" ury="580"/>
<char name="ring" width="600" llx="218" lly="463" urx="382" ury="627"/>
<char name="s" width="600" llx="80" lly="-15" urx="513" ury="441"/>
<char name="scaron" width="600" llx="80" lly="-15" urx="513" ury="669"/>
<char name="scedilla" width="600" llx="80" lly="-151" urx="513" ury="441"/>
<char name="section" width="600" llx="113" lly="-78" urx="488" ury="580"/>
<char name="semicolon" width="600" llx="181" lly="-112" urx="371" ury="385"/>
<char name="seven" width="600" llx="82" lly="0" urx="483" ury="607"/>
<char name="six" width="600" llx="111" lly="-15" urx="497" ury="622"/>
<char name="slash" width="600" llx="125" lly="-80" urx="475" ury="629"/>
<char name="space" width="600" llx="0" lly="0" urx="0" ury="0"/>
<!-- JKT: the following has been manually added -->
<char name="sterling" width="600" llx="84" lly="-21" urx="521" ury="611"/>
<char name="t" width="600" llx="87" lly="-15" urx="530" ury="561"/>
<char name="thorn" width="600" llx="-6" lly="-157" urx="555" ury="629"/>
<char name="three" width="600" llx="75" lly="-15" urx="466" ury="622"/>
<char name="threequarters" width="600" llx="8" lly="-56" urx="593" ury="666"/>
<char name="threesuperior" width="600" llx="155" lly="240" urx="406" ury="622"/>
<char name="tilde" width="600" llx="105" lly="489" urx="503" ury="606"/>
<char name="trademark" width="600" llx="-23" lly="263" urx="623" ury="562"/>
<char name="two" width="600" llx="70" lly="0" urx="471" ury="622"/>
<char name="twosuperior" width="600" llx="177" lly="249" urx="424" ury="622"/>
<char name="u" width="600" llx="21" lly="-15" urx="562" ury="426"/>
<char name="uacute" width="600" llx="21" lly="-15" urx="562" ury="672"/>
<char name="ucircumflex" width="600" llx="21" lly="-15" urx="562" ury="654"/>
<char name="udieresis" width="600" llx="21" lly="-15" urx="562" ury="620"/>
<char name="ugrave" width="600" llx="21" lly="-15" urx="562" ury="672"/>
<char name="underscore" width="600" llx="0" lly="-125" urx="600" ury="-75"/>
<char name="v" width="600" llx="10" lly="-10" urx="590" ury="426"/>
<char name="w" width="600" llx="-4" lly="-10" urx="604" ury="426"/>
<char name="x" width="600" llx="20" lly="0" urx="580" ury="426"/>
<char name="y" width="600" llx="7" lly="-157" urx="592" ury="426"/>
<char name="yacute" width="600" llx="7" lly="-157" urx="592" ury="672"/>
<char name="ydieresis" width="600" llx="7" lly="-157" urx="592" ury="620"/>
<char name="yen" width="600" llx="26" lly="0" urx="574" ury="562"/>
<char name="z" width="600" llx="99" lly="0" urx="502" ury="426"/>
<char name="zcaron" width="600" llx="99" lly="0" urx="502" ury="669"/>
<char name="zero" width="600" llx="106" lly="-15" urx="494" ury="622"/>
</char-metrics>
</font-metrics>
@@ -0,0 +1,267 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- $Id$ -->
<!-- JKT: these metrics in XML were kindly produced by Fotis Jannidis -->
<font-metrics>
<font-name>Courier-Bold</font-name>
<full-name>Courier Bold</full-name>
<family-name>Courier</family-name>
<class-name>CourierBold</class-name>
<encoding>StandardEncoding</encoding>
<underline-position>-100</underline-position>
<underline-thickness>50</underline-thickness>
<cap-height>562</cap-height>
<x-height>439</x-height>
<ascender>626</ascender>
<descender>-142</descender>
<first-char>32</first-char>
<last-char>255</last-char>
<char-metrics>
<char name="A" width="600" llx="-9" lly="0" urx="609" ury="562"/>
<char name="AE" width="600" llx="-29" lly="0" urx="602" ury="562"/>
<char name="Aacute" width="600" llx="-9" lly="0" urx="609" ury="784"/>
<char name="Acircumflex" width="600" llx="-9" lly="0" urx="609" ury="780"/>
<char name="Adieresis" width="600" llx="-9" lly="0" urx="609" ury="761"/>
<char name="Agrave" width="600" llx="-9" lly="0" urx="609" ury="784"/>
<char name="Aring" width="600" llx="-9" lly="0" urx="609" ury="801"/>
<char name="Atilde" width="600" llx="-9" lly="0" urx="609" ury="759"/>
<char name="B" width="600" llx="30" lly="0" urx="573" ury="562"/>
<char name="C" width="600" llx="22" lly="-18" urx="560" ury="580"/>
<char name="Ccedilla" width="600" llx="22" lly="-206" urx="560" ury="580"/>
<char name="D" width="600" llx="30" lly="0" urx="594" ury="562"/>
<char name="E" width="600" llx="25" lly="0" urx="560" ury="562"/>
<char name="Eacute" width="600" llx="25" lly="0" urx="560" ury="784"/>
<char name="Ecircumflex" width="600" llx="25" lly="0" urx="560" ury="780"/>
<char name="Edieresis" width="600" llx="25" lly="0" urx="560" ury="761"/>
<char name="Egrave" width="600" llx="25" lly="0" urx="560" ury="784"/>
<char name="Eth" width="600" llx="30" lly="0" urx="594" ury="562"/>
<char name="Euro" width="600" llx="0" lly="0" urx="0" ury="0"/>
<char name="F" width="600" llx="39" lly="0" urx="570" ury="562"/>
<char name="G" width="600" llx="22" lly="-18" urx="594" ury="580"/>
<char name="H" width="600" llx="20" lly="0" urx="580" ury="562"/>
<char name="I" width="600" llx="77" lly="0" urx="523" ury="562"/>
<char name="Iacute" width="600" llx="77" lly="0" urx="523" ury="784"/>
<char name="Icircumflex" width="600" llx="77" lly="0" urx="523" ury="780"/>
<char name="Idieresis" width="600" llx="77" lly="0" urx="523" ury="761"/>
<char name="Igrave" width="600" llx="77" lly="0" urx="523" ury="784"/>
<char name="J" width="600" llx="37" lly="-18" urx="601" ury="562"/>
<char name="K" width="600" llx="21" lly="0" urx="599" ury="562"/>
<char name="L" width="600" llx="39" lly="0" urx="578" ury="562"/>
<char name="Lslash" width="600" llx="39" lly="0" urx="578" ury="562"/>
<char name="M" width="600" llx="-2" lly="0" urx="602" ury="562"/>
<char name="N" width="600" llx="8" lly="-12" urx="610" ury="562"/>
<char name="Ntilde" width="600" llx="8" lly="-12" urx="610" ury="759"/>
<char name="O" width="600" llx="22" lly="-18" urx="578" ury="580"/>
<char name="OE" width="600" llx="-25" lly="0" urx="595" ury="562"/>
<char name="Oacute" width="600" llx="22" lly="-18" urx="578" ury="784"/>
<char name="Ocircumflex" width="600" llx="22" lly="-18" urx="578" ury="780"/>
<char name="Odieresis" width="600" llx="22" lly="-18" urx="578" ury="761"/>
<char name="Ograve" width="600" llx="22" lly="-18" urx="578" ury="784"/>
<char name="Oslash" width="600" llx="22" lly="-22" urx="578" ury="584"/>
<char name="Otilde" width="600" llx="22" lly="-18" urx="578" ury="759"/>
<char name="P" width="600" llx="48" lly="0" urx="559" ury="562"/>
<char name="Q" width="600" llx="32" lly="-138" urx="578" ury="580"/>
<char name="R" width="600" llx="24" lly="0" urx="599" ury="562"/>
<char name="S" width="600" llx="47" lly="-22" urx="553" ury="582"/>
<char name="Scaron" width="600" llx="47" lly="-22" urx="553" ury="790"/>
<char name="Scedilla" width="600" llx="47" lly="-206" urx="553" ury="582"/>
<char name="T" width="600" llx="21" lly="0" urx="579" ury="562"/>
<char name="Thorn" width="600" llx="48" lly="0" urx="557" ury="562"/>
<char name="U" width="600" llx="4" lly="-18" urx="596" ury="562"/>
<char name="Uacute" width="600" llx="4" lly="-18" urx="596" ury="784"/>
<char name="Ucircumflex" width="600" llx="4" lly="-18" urx="596" ury="780"/>
<char name="Udieresis" width="600" llx="4" lly="-18" urx="596" ury="761"/>
<char name="Ugrave" width="600" llx="4" lly="-18" urx="596" ury="784"/>
<char name="V" width="600" llx="-13" lly="0" urx="613" ury="562"/>
<char name="W" width="600" llx="-18" lly="0" urx="618" ury="562"/>
<char name="X" width="600" llx="12" lly="0" urx="588" ury="562"/>
<char name="Y" width="600" llx="12" lly="0" urx="589" ury="562"/>
<char name="Yacute" width="600" llx="12" lly="0" urx="589" ury="784"/>
<char name="Ydieresis" width="600" llx="12" lly="0" urx="589" ury="761"/>
<char name="Z" width="600" llx="62" lly="0" urx="539" ury="562"/>
<char name="Zcaron" width="600" llx="62" lly="0" urx="539" ury="790"/>
<char name="a" width="600" llx="35" lly="-15" urx="570" ury="454"/>
<char name="aacute" width="600" llx="35" lly="-15" urx="570" ury="661"/>
<char name="acircumflex" width="600" llx="35" lly="-15" urx="570" ury="657"/>
<char name="acute" width="600" llx="205" lly="508" urx="468" ury="661"/>
<char name="adieresis" width="600" llx="35" lly="-15" urx="570" ury="638"/>
<char name="ae" width="600" llx="-4" lly="-15" urx="601" ury="454"/>
<char name="agrave" width="600" llx="35" lly="-15" urx="570" ury="661"/>
<char name="ampersand" width="600" llx="36" lly="-15" urx="546" ury="543"/>
<char name="aring" width="600" llx="35" lly="-15" urx="570" ury="678"/>
<char name="asciicircum" width="600" llx="108" lly="250" urx="492" ury="616"/>
<char name="asciitilde" width="600" llx="71" lly="153" urx="530" ury="356"/>
<char name="asterisk" width="600" llx="91" lly="219" urx="509" ury="601"/>
<char name="at" width="600" llx="16" lly="-15" urx="584" ury="616"/>
<char name="atilde" width="600" llx="35" lly="-15" urx="570" ury="636"/>
<char name="b" width="600" llx="0" lly="-15" urx="584" ury="626"/>
<char name="backslash" width="600" llx="99" lly="-77" urx="503" ury="626"/>
<char name="bar" width="600" llx="255" lly="-250" urx="345" ury="750"/>
<char name="braceleft" width="600" llx="160" lly="-102" urx="464" ury="616"/>
<char name="braceright" width="600" llx="136" lly="-102" urx="440" ury="616"/>
<char name="bracketleft" width="600" llx="245" lly="-102" urx="475" ury="616"/>
<char name="bracketright" width="600" llx="125" lly="-102" urx="355" ury="616"/>
<char name="breve" width="600" llx="83" lly="468" urx="517" ury="631"/>
<char name="brokenbar" width="600" llx="255" lly="-175" urx="345" ury="675"/>
<char name="bullet" width="600" llx="140" lly="132" urx="460" ury="430"/>
<char name="c" width="600" llx="40" lly="-15" urx="545" ury="459"/>
<char name="caron" width="600" llx="103" lly="493" urx="497" ury="667"/>
<char name="ccedilla" width="600" llx="40" lly="-206" urx="545" ury="459"/>
<char name="cedilla" width="600" llx="205" lly="-206" urx="387" ury="0"/>
<char name="cent" width="600" llx="66" lly="-49" urx="518" ury="614"/>
<char name="circumflex" width="600" llx="103" lly="483" urx="497" ury="657"/>
<char name="colon" width="600" llx="191" lly="-15" urx="407" ury="425"/>
<char name="comma" width="600" llx="123" lly="-111" urx="393" ury="174"/>
<char name="copyright" width="600" llx="0" lly="-18" urx="600" ury="580"/>
<char name="currency" width="600" llx="54" lly="49" urx="546" ury="517"/>
<char name="d" width="600" llx="20" lly="-15" urx="591" ury="626"/>
<char name="dagger" width="600" llx="106" lly="-70" urx="494" ury="580"/>
<char name="daggerdbl" width="600" llx="106" lly="-70" urx="494" ury="580"/>
<char name="degree" width="600" llx="86" lly="243" urx="474" ury="616"/>
<char name="dieresis" width="600" llx="128" lly="498" urx="472" ury="638"/>
<char name="divide" width="600" llx="71" lly="16" urx="529" ury="500"/>
<char name="dollar" width="600" llx="82" lly="-126" urx="519" ury="666"/>
<char name="dotaccent" width="600" llx="230" lly="498" urx="370" ury="638"/>
<char name="dotlessi" width="600" llx="77" lly="0" urx="523" ury="439"/>
<char name="e" width="600" llx="40" lly="-15" urx="563" ury="454"/>
<char name="eacute" width="600" llx="40" lly="-15" urx="563" ury="661"/>
<char name="ecircumflex" width="600" llx="40" lly="-15" urx="563" ury="657"/>
<char name="edieresis" width="600" llx="40" lly="-15" urx="563" ury="638"/>
<char name="egrave" width="600" llx="40" lly="-15" urx="563" ury="661"/>
<char name="eight" width="600" llx="83" lly="-15" urx="517" ury="616"/>
<char name="ellipsis" width="600" llx="26" lly="-15" urx="574" ury="116"/>
<char name="emdash" width="600" llx="-10" lly="203" urx="610" ury="313"/>
<char name="endash" width="600" llx="65" lly="203" urx="535" ury="313"/>
<char name="equal" width="600" llx="71" lly="118" urx="529" ury="398"/>
<char name="eth" width="600" llx="58" lly="-27" urx="543" ury="626"/>
<char name="exclam" width="600" llx="202" lly="-15" urx="398" ury="572"/>
<char name="exclamdown" width="600" llx="202" lly="-146" urx="398" ury="449"/>
<char name="f" width="600" llx="83" lly="0" urx="547" ury="626"/>
<char name="fi" width="600" llx="12" lly="0" urx="593" ury="626"/>
<char name="five" width="600" llx="70" lly="-15" urx="521" ury="601"/>
<char name="fl" width="600" llx="12" lly="0" urx="593" ury="626"/>
<char name="florin" width="600" llx="-30" lly="-131" urx="572" ury="616"/>
<char name="four" width="600" llx="53" lly="0" urx="507" ury="616"/>
<char name="fraction" width="600" llx="25" lly="-60" urx="576" ury="661"/>
<char name="g" width="600" llx="30" lly="-146" urx="580" ury="454"/>
<char name="germandbls" width="600" llx="22" lly="-15" urx="596" ury="626"/>
<char name="grave" width="600" llx="132" lly="508" urx="395" ury="661"/>
<char name="greater" width="600" llx="77" lly="15" urx="534" ury="501"/>
<char name="guillemotleft" width="600" llx="8" lly="70" urx="553" ury="446"/>
<char name="guillemotright" width="600" llx="47" lly="70" urx="592" ury="446"/>
<char name="guilsinglleft" width="600" llx="141" lly="70" urx="459" ury="446"/>
<char name="guilsinglright" width="600" llx="141" lly="70" urx="459" ury="446"/>
<char name="h" width="600" llx="5" lly="0" urx="592" ury="626"/>
<char name="hungarumlaut" width="600" llx="68" lly="488" urx="588" ury="661"/>
<char name="hyphen" width="600" llx="100" lly="203" urx="500" ury="313"/>
<char name="i" width="600" llx="77" lly="0" urx="523" ury="658"/>
<char name="iacute" width="600" llx="77" lly="0" urx="523" ury="661"/>
<char name="icircumflex" width="600" llx="73" lly="0" urx="523" ury="657"/>
<char name="idieresis" width="600" llx="77" lly="0" urx="523" ury="618"/>
<char name="igrave" width="600" llx="77" lly="0" urx="523" ury="661"/>
<char name="j" width="600" llx="63" lly="-146" urx="440" ury="658"/>
<char name="k" width="600" llx="20" lly="0" urx="585" ury="626"/>
<char name="l" width="600" llx="77" lly="0" urx="523" ury="626"/>
<char name="less" width="600" llx="66" lly="15" urx="523" ury="501"/>
<char name="logicalnot" width="600" llx="71" lly="103" urx="529" ury="413"/>
<char name="lslash" width="600" llx="77" lly="0" urx="523" ury="626"/>
<char name="m" width="600" llx="-22" lly="0" urx="626" ury="454"/>
<char name="macron" width="600" llx="88" lly="505" urx="512" ury="585"/>
<char name="minus" width="600" llx="71" lly="203" urx="529" ury="313"/>
<char name="mu" width="600" llx="-1" lly="-142" urx="569" ury="439"/>
<char name="multiply" width="600" llx="81" lly="39" urx="520" ury="478"/>
<char name="n" width="600" llx="18" lly="0" urx="592" ury="454"/>
<char name="nine" width="600" llx="79" lly="-15" urx="510" ury="616"/>
<char name="ntilde" width="600" llx="18" lly="0" urx="592" ury="636"/>
<char name="numbersign" width="600" llx="56" lly="-45" urx="544" ury="651"/>
<char name="o" width="600" llx="30" lly="-15" urx="570" ury="454"/>
<char name="oacute" width="600" llx="30" lly="-15" urx="570" ury="661"/>
<char name="ocircumflex" width="600" llx="30" lly="-15" urx="570" ury="657"/>
<char name="odieresis" width="600" llx="30" lly="-15" urx="570" ury="638"/>
<char name="oe" width="600" llx="-18" lly="-15" urx="611" ury="454"/>
<char name="ogonek" width="600" llx="169" lly="-199" urx="400" ury="0"/>
<char name="ograve" width="600" llx="30" lly="-15" urx="570" ury="661"/>
<char name="one" width="600" llx="81" lly="0" urx="539" ury="616"/>
<char name="onehalf" width="600" llx="-47" lly="-60" urx="648" ury="661"/>
<char name="onequarter" width="600" llx="-56" lly="-60" urx="656" ury="661"/>
<char name="onesuperior" width="600" llx="153" lly="230" urx="447" ury="616"/>
<char name="ordfeminine" width="600" llx="147" lly="196" urx="453" ury="580"/>
<char name="ordmasculine" width="600" llx="147" lly="196" urx="453" ury="580"/>
<char name="oslash" width="600" llx="30" lly="-24" urx="570" ury="463"/>
<char name="otilde" width="600" llx="30" lly="-15" urx="570" ury="636"/>
<char name="p" width="600" llx="-1" lly="-142" urx="570" ury="454"/>
<char name="paragraph" width="600" llx="6" lly="-70" urx="576" ury="580"/>
<char name="parenleft" width="600" llx="219" lly="-102" urx="461" ury="616"/>
<char name="parenright" width="600" llx="139" lly="-102" urx="381" ury="616"/>
<char name="percent" width="600" llx="5" lly="-15" urx="595" ury="616"/>
<char name="period" width="600" llx="192" lly="-15" urx="408" ury="171"/>
<char name="periodcentered" width="600" llx="196" lly="165" urx="404" ury="351"/>
<char name="perthousand" width="600" llx="-113" lly="-15" urx="713" ury="616"/>
<char name="plus" width="600" llx="71" lly="39" urx="529" ury="478"/>
<char name="plusminus" width="600" llx="71" lly="24" urx="529" ury="515"/>
<char name="q" width="600" llx="20" lly="-142" urx="591" ury="454"/>
<char name="question" width="600" llx="98" lly="-14" urx="501" ury="580"/>
<char name="questiondown" width="600" llx="99" lly="-146" urx="502" ury="449"/>
<char name="quotedbl" width="600" llx="135" lly="277" urx="465" ury="562"/>
<char name="quotedblbase" width="600" llx="65" lly="-142" urx="529" ury="143"/>
<char name="quotedblleft" width="600" llx="71" lly="277" urx="535" ury="562"/>
<char name="quotedblright" width="600" llx="61" lly="277" urx="525" ury="562"/>
<char name="quoteleft" width="600" llx="178" lly="277" urx="428" ury="562"/>
<char name="quoteright" width="600" llx="171" lly="277" urx="423" ury="562"/>
<char name="quotesinglbase" width="600" llx="175" lly="-142" urx="427" ury="143"/>
<char name="quotesingle" width="600" llx="227" lly="277" urx="373" ury="562"/>
<char name="r" width="600" llx="47" lly="0" urx="580" ury="454"/>
<char name="registered" width="600" llx="0" lly="-18" urx="600" ury="580"/>
<char name="ring" width="600" llx="198" lly="481" urx="402" ury="678"/>
<char name="s" width="600" llx="68" lly="-17" urx="535" ury="459"/>
<char name="scaron" width="600" llx="68" lly="-17" urx="535" ury="667"/>
<char name="scedilla" width="600" llx="68" lly="-206" urx="535" ury="459"/>
<char name="section" width="600" llx="83" lly="-70" urx="517" ury="580"/>
<char name="semicolon" width="600" llx="123" lly="-111" urx="408" ury="425"/>
<char name="seven" width="600" llx="55" lly="0" urx="494" ury="601"/>
<char name="six" width="600" llx="90" lly="-15" urx="521" ury="616"/>
<char name="slash" width="600" llx="98" lly="-77" urx="502" ury="626"/>
<char name="space" width="600" llx="0" lly="0" urx="0" ury="0"/>
<!-- JKT: the following has been manually added -->
<char name="sterling" width="600" llx="72" lly="-28" urx="558" ury="611"/>
<char name="t" width="600" llx="47" lly="-15" urx="532" ury="562"/>
<char name="thorn" width="600" llx="-14" lly="-142" urx="570" ury="626"/>
<char name="three" width="600" llx="63" lly="-15" urx="501" ury="616"/>
<char name="threequarters" width="600" llx="-47" lly="-60" urx="648" ury="661"/>
<char name="threesuperior" width="600" llx="138" lly="222" urx="433" ury="616"/>
<char name="tilde" width="600" llx="89" lly="493" urx="512" ury="636"/>
<char name="trademark" width="600" llx="-9" lly="230" urx="749" ury="562"/>
<char name="two" width="600" llx="61" lly="0" urx="499" ury="616"/>
<char name="twosuperior" width="600" llx="143" lly="230" urx="436" ury="616"/>
<char name="u" width="600" llx="-1" lly="-15" urx="569" ury="439"/>
<char name="uacute" width="600" llx="-1" lly="-15" urx="569" ury="661"/>
<char name="ucircumflex" width="600" llx="-1" lly="-15" urx="569" ury="657"/>
<char name="udieresis" width="600" llx="-1" lly="-15" urx="569" ury="638"/>
<char name="ugrave" width="600" llx="-1" lly="-15" urx="569" ury="661"/>
<char name="underscore" width="600" llx="0" lly="-125" urx="600" ury="-75"/>
<char name="v" width="600" llx="-1" lly="0" urx="601" ury="439"/>
<char name="w" width="600" llx="-18" lly="0" urx="618" ury="439"/>
<char name="x" width="600" llx="6" lly="0" urx="594" ury="439"/>
<char name="y" width="600" llx="-4" lly="-142" urx="601" ury="439"/>
<char name="yacute" width="600" llx="-4" lly="-142" urx="601" ury="661"/>
<char name="ydieresis" width="600" llx="-4" lly="-142" urx="601" ury="638"/>
<char name="yen" width="600" llx="10" lly="0" urx="590" ury="562"/>
<char name="z" width="600" llx="81" lly="0" urx="520" ury="439"/>
<char name="zcaron" width="600" llx="81" lly="0" urx="520" ury="667"/>
<char name="zero" width="600" llx="87" lly="-15" urx="513" ury="616"/>
</char-metrics>
</font-metrics>
@@ -0,0 +1,267 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- $Id$ -->
<!-- JKT: these metrics in XML were kindly produced by Fotis Jannidis -->
<font-metrics>
<font-name>Courier-BoldOblique</font-name>
<full-name>Courier Bold Oblique</full-name>
<family-name>Courier</family-name>
<class-name>CourierBoldOblique</class-name>
<encoding>StandardEncoding</encoding>
<underline-position>-100</underline-position>
<underline-thickness>50</underline-thickness>
<cap-height>562</cap-height>
<x-height>439</x-height>
<ascender>626</ascender>
<descender>-142</descender>
<first-char>32</first-char>
<last-char>255</last-char>
<char-metrics>
<char name="A" width="600" llx="-9" lly="0" urx="632" ury="562"/>
<char name="AE" width="600" llx="-29" lly="0" urx="708" ury="562"/>
<char name="Aacute" width="600" llx="-9" lly="0" urx="655" ury="784"/>
<char name="Acircumflex" width="600" llx="-9" lly="0" urx="632" ury="780"/>
<char name="Adieresis" width="600" llx="-9" lly="0" urx="632" ury="761"/>
<char name="Agrave" width="600" llx="-9" lly="0" urx="632" ury="784"/>
<char name="Aring" width="600" llx="-9" lly="0" urx="632" ury="801"/>
<char name="Atilde" width="600" llx="-9" lly="0" urx="669" ury="759"/>
<char name="B" width="600" llx="30" lly="0" urx="630" ury="562"/>
<char name="C" width="600" llx="74" lly="-18" urx="675" ury="580"/>
<char name="Ccedilla" width="600" llx="74" lly="-206" urx="675" ury="580"/>
<char name="D" width="600" llx="30" lly="0" urx="664" ury="562"/>
<char name="E" width="600" llx="25" lly="0" urx="670" ury="562"/>
<char name="Eacute" width="600" llx="25" lly="0" urx="670" ury="784"/>
<char name="Ecircumflex" width="600" llx="25" lly="0" urx="670" ury="780"/>
<char name="Edieresis" width="600" llx="25" lly="0" urx="670" ury="761"/>
<char name="Egrave" width="600" llx="25" lly="0" urx="670" ury="784"/>
<char name="Eth" width="600" llx="30" lly="0" urx="664" ury="562"/>
<char name="Euro" width="600" llx="0" lly="0" urx="0" ury="0"/>
<char name="F" width="600" llx="39" lly="0" urx="684" ury="562"/>
<char name="G" width="600" llx="74" lly="-18" urx="675" ury="580"/>
<char name="H" width="600" llx="20" lly="0" urx="700" ury="562"/>
<char name="I" width="600" llx="77" lly="0" urx="643" ury="562"/>
<char name="Iacute" width="600" llx="77" lly="0" urx="643" ury="784"/>
<char name="Icircumflex" width="600" llx="77" lly="0" urx="643" ury="780"/>
<char name="Idieresis" width="600" llx="77" lly="0" urx="643" ury="761"/>
<char name="Igrave" width="600" llx="77" lly="0" urx="643" ury="784"/>
<char name="J" width="600" llx="58" lly="-18" urx="721" ury="562"/>
<char name="K" width="600" llx="21" lly="0" urx="692" ury="562"/>
<char name="L" width="600" llx="39" lly="0" urx="636" ury="562"/>
<char name="Lslash" width="600" llx="39" lly="0" urx="636" ury="562"/>
<char name="M" width="600" llx="-2" lly="0" urx="722" ury="562"/>
<char name="N" width="600" llx="8" lly="-12" urx="730" ury="562"/>
<char name="Ntilde" width="600" llx="8" lly="-12" urx="730" ury="759"/>
<char name="O" width="600" llx="74" lly="-18" urx="645" ury="580"/>
<char name="OE" width="600" llx="26" lly="0" urx="701" ury="562"/>
<char name="Oacute" width="600" llx="74" lly="-18" urx="645" ury="784"/>
<char name="Ocircumflex" width="600" llx="74" lly="-18" urx="645" ury="780"/>
<char name="Odieresis" width="600" llx="74" lly="-18" urx="645" ury="761"/>
<char name="Ograve" width="600" llx="74" lly="-18" urx="645" ury="784"/>
<char name="Oslash" width="600" llx="48" lly="-22" urx="673" ury="584"/>
<char name="Otilde" width="600" llx="74" lly="-18" urx="669" ury="759"/>
<char name="P" width="600" llx="48" lly="0" urx="643" ury="562"/>
<char name="Q" width="600" llx="83" lly="-138" urx="636" ury="580"/>
<char name="R" width="600" llx="24" lly="0" urx="617" ury="562"/>
<char name="S" width="600" llx="54" lly="-22" urx="673" ury="582"/>
<char name="Scaron" width="600" llx="54" lly="-22" urx="689" ury="790"/>
<char name="Scedilla" width="600" llx="54" lly="-206" urx="673" ury="582"/>
<char name="T" width="600" llx="86" lly="0" urx="679" ury="562"/>
<char name="Thorn" width="600" llx="48" lly="0" urx="620" ury="562"/>
<char name="U" width="600" llx="101" lly="-18" urx="716" ury="562"/>
<char name="Uacute" width="600" llx="101" lly="-18" urx="716" ury="784"/>
<char name="Ucircumflex" width="600" llx="101" lly="-18" urx="716" ury="780"/>
<char name="Udieresis" width="600" llx="101" lly="-18" urx="716" ury="761"/>
<char name="Ugrave" width="600" llx="101" lly="-18" urx="716" ury="784"/>
<char name="V" width="600" llx="84" lly="0" urx="733" ury="562"/>
<char name="W" width="600" llx="79" lly="0" urx="738" ury="562"/>
<char name="X" width="600" llx="12" lly="0" urx="690" ury="562"/>
<char name="Y" width="600" llx="109" lly="0" urx="709" ury="562"/>
<char name="Yacute" width="600" llx="109" lly="0" urx="709" ury="784"/>
<char name="Ydieresis" width="600" llx="109" lly="0" urx="709" ury="761"/>
<char name="Z" width="600" llx="62" lly="0" urx="637" ury="562"/>
<char name="Zcaron" width="600" llx="62" lly="0" urx="659" ury="790"/>
<char name="a" width="600" llx="61" lly="-15" urx="593" ury="454"/>
<char name="aacute" width="600" llx="61" lly="-15" urx="609" ury="661"/>
<char name="acircumflex" width="600" llx="61" lly="-15" urx="607" ury="657"/>
<char name="acute" width="600" llx="312" lly="508" urx="609" ury="661"/>
<char name="adieresis" width="600" llx="61" lly="-15" urx="595" ury="638"/>
<char name="ae" width="600" llx="21" lly="-15" urx="652" ury="454"/>
<char name="agrave" width="600" llx="61" lly="-15" urx="593" ury="661"/>
<char name="ampersand" width="600" llx="61" lly="-15" urx="595" ury="543"/>
<char name="aring" width="600" llx="61" lly="-15" urx="593" ury="678"/>
<char name="asciicircum" width="600" llx="171" lly="250" urx="556" ury="616"/>
<char name="asciitilde" width="600" llx="120" lly="153" urx="590" ury="356"/>
<char name="asterisk" width="600" llx="179" lly="219" urx="598" ury="601"/>
<char name="at" width="600" llx="65" lly="-15" urx="642" ury="616"/>
<char name="atilde" width="600" llx="61" lly="-15" urx="643" ury="636"/>
<char name="b" width="600" llx="13" lly="-15" urx="636" ury="626"/>
<char name="backslash" width="600" llx="222" lly="-77" urx="496" ury="626"/>
<char name="bar" width="600" llx="201" lly="-250" urx="505" ury="750"/>
<char name="braceleft" width="600" llx="203" lly="-102" urx="595" ury="616"/>
<char name="braceright" width="600" llx="114" lly="-102" urx="506" ury="616"/>
<char name="bracketleft" width="600" llx="223" lly="-102" urx="606" ury="616"/>
<char name="bracketright" width="600" llx="103" lly="-102" urx="486" ury="616"/>
<char name="breve" width="600" llx="217" lly="468" urx="652" ury="631"/>
<char name="brokenbar" width="600" llx="217" lly="-175" urx="489" ury="675"/>
<char name="bullet" width="600" llx="196" lly="132" urx="523" ury="430"/>
<char name="c" width="600" llx="81" lly="-15" urx="631" ury="459"/>
<char name="caron" width="600" llx="238" lly="493" urx="633" ury="667"/>
<char name="ccedilla" width="600" llx="81" lly="-206" urx="631" ury="459"/>
<char name="cedilla" width="600" llx="168" lly="-206" urx="368" ury="0"/>
<char name="cent" width="600" llx="121" lly="-49" urx="605" ury="614"/>
<char name="circumflex" width="600" llx="212" lly="483" urx="607" ury="657"/>
<char name="colon" width="600" llx="205" lly="-15" urx="480" ury="425"/>
<char name="comma" width="600" llx="99" lly="-111" urx="430" ury="174"/>
<char name="copyright" width="600" llx="53" lly="-18" urx="667" ury="580"/>
<char name="currency" width="600" llx="77" lly="49" urx="644" ury="517"/>
<char name="d" width="600" llx="60" lly="-15" urx="645" ury="626"/>
<char name="dagger" width="600" llx="175" lly="-70" urx="586" ury="580"/>
<char name="daggerdbl" width="600" llx="121" lly="-70" urx="587" ury="580"/>
<char name="degree" width="600" llx="173" lly="243" urx="570" ury="616"/>
<char name="dieresis" width="600" llx="246" lly="498" urx="595" ury="638"/>
<char name="divide" width="600" llx="114" lly="16" urx="596" ury="500"/>
<char name="dollar" width="600" llx="87" lly="-126" urx="630" ury="666"/>
<char name="dotaccent" width="600" llx="348" lly="498" urx="493" ury="638"/>
<char name="dotlessi" width="600" llx="77" lly="0" urx="546" ury="439"/>
<char name="e" width="600" llx="81" lly="-15" urx="605" ury="454"/>
<char name="eacute" width="600" llx="81" lly="-15" urx="609" ury="661"/>
<char name="ecircumflex" width="600" llx="81" lly="-15" urx="607" ury="657"/>
<char name="edieresis" width="600" llx="81" lly="-15" urx="605" ury="638"/>
<char name="egrave" width="600" llx="81" lly="-15" urx="605" ury="661"/>
<char name="eight" width="600" llx="115" lly="-15" urx="604" ury="616"/>
<char name="ellipsis" width="600" llx="35" lly="-15" urx="587" ury="116"/>
<char name="emdash" width="600" llx="33" lly="203" urx="677" ury="313"/>
<char name="endash" width="600" llx="108" lly="203" urx="602" ury="313"/>
<char name="equal" width="600" llx="96" lly="118" urx="614" ury="398"/>
<char name="eth" width="600" llx="93" lly="-27" urx="661" ury="626"/>
<char name="exclam" width="600" llx="215" lly="-15" urx="495" ury="572"/>
<char name="exclamdown" width="600" llx="196" lly="-146" urx="477" ury="449"/>
<char name="f" width="600" llx="83" lly="0" urx="677" ury="626"/>
<char name="fi" width="600" llx="12" lly="0" urx="644" ury="626"/>
<char name="five" width="600" llx="77" lly="-15" urx="621" ury="601"/>
<char name="fl" width="600" llx="12" lly="0" urx="644" ury="626"/>
<char name="florin" width="600" llx="-57" lly="-131" urx="702" ury="616"/>
<char name="four" width="600" llx="81" lly="0" urx="559" ury="616"/>
<char name="fraction" width="600" llx="22" lly="-60" urx="708" ury="661"/>
<char name="g" width="600" llx="40" lly="-146" urx="674" ury="454"/>
<char name="germandbls" width="600" llx="22" lly="-15" urx="629" ury="626"/>
<char name="grave" width="600" llx="272" lly="508" urx="503" ury="661"/>
<char name="greater" width="600" llx="97" lly="15" urx="589" ury="501"/>
<char name="guillemotleft" width="600" llx="62" lly="70" urx="639" ury="446"/>
<char name="guillemotright" width="600" llx="71" lly="70" urx="647" ury="446"/>
<char name="guilsinglleft" width="600" llx="195" lly="70" urx="545" ury="446"/>
<char name="guilsinglright" width="600" llx="165" lly="70" urx="514" ury="446"/>
<char name="h" width="600" llx="18" lly="0" urx="615" ury="626"/>
<char name="hungarumlaut" width="600" llx="171" lly="488" urx="729" ury="661"/>
<char name="hyphen" width="600" llx="143" lly="203" urx="567" ury="313"/>
<char name="i" width="600" llx="77" lly="0" urx="546" ury="658"/>
<char name="iacute" width="600" llx="77" lly="0" urx="609" ury="661"/>
<char name="icircumflex" width="600" llx="77" lly="0" urx="577" ury="657"/>
<char name="idieresis" width="600" llx="77" lly="0" urx="561" ury="618"/>
<char name="igrave" width="600" llx="77" lly="0" urx="546" ury="661"/>
<char name="j" width="600" llx="36" lly="-146" urx="580" ury="658"/>
<char name="k" width="600" llx="33" lly="0" urx="643" ury="626"/>
<char name="l" width="600" llx="77" lly="0" urx="546" ury="626"/>
<char name="less" width="600" llx="120" lly="15" urx="613" ury="501"/>
<char name="logicalnot" width="600" llx="135" lly="103" urx="617" ury="413"/>
<char name="lslash" width="600" llx="77" lly="0" urx="587" ury="626"/>
<char name="m" width="600" llx="-22" lly="0" urx="649" ury="454"/>
<char name="macron" width="600" llx="195" lly="505" urx="637" ury="585"/>
<char name="minus" width="600" llx="114" lly="203" urx="596" ury="313"/>
<char name="mu" width="600" llx="49" lly="-142" urx="592" ury="439"/>
<char name="multiply" width="600" llx="104" lly="39" urx="606" ury="478"/>
<char name="n" width="600" llx="18" lly="0" urx="615" ury="454"/>
<char name="nine" width="600" llx="75" lly="-15" urx="592" ury="616"/>
<char name="ntilde" width="600" llx="18" lly="0" urx="643" ury="636"/>
<char name="numbersign" width="600" llx="88" lly="-45" urx="641" ury="651"/>
<char name="o" width="600" llx="71" lly="-15" urx="622" ury="454"/>
<char name="oacute" width="600" llx="71" lly="-15" urx="649" ury="661"/>
<char name="ocircumflex" width="600" llx="71" lly="-15" urx="622" ury="657"/>
<char name="odieresis" width="600" llx="71" lly="-15" urx="622" ury="638"/>
<char name="oe" width="600" llx="18" lly="-15" urx="662" ury="454"/>
<char name="ogonek" width="600" llx="143" lly="-199" urx="367" ury="0"/>
<char name="ograve" width="600" llx="71" lly="-15" urx="622" ury="661"/>
<char name="one" width="600" llx="93" lly="0" urx="562" ury="616"/>
<char name="onehalf" width="600" llx="22" lly="-60" urx="716" ury="661"/>
<char name="onequarter" width="600" llx="13" lly="-60" urx="707" ury="661"/>
<char name="onesuperior" width="600" llx="212" lly="230" urx="514" ury="616"/>
<char name="ordfeminine" width="600" llx="188" lly="196" urx="526" ury="580"/>
<char name="ordmasculine" width="600" llx="188" lly="196" urx="543" ury="580"/>
<char name="oslash" width="600" llx="54" lly="-24" urx="638" ury="463"/>
<char name="otilde" width="600" llx="71" lly="-15" urx="643" ury="636"/>
<char name="p" width="600" llx="-32" lly="-142" urx="622" ury="454"/>
<char name="paragraph" width="600" llx="61" lly="-70" urx="700" ury="580"/>
<char name="parenleft" width="600" llx="265" lly="-102" urx="592" ury="616"/>
<char name="parenright" width="600" llx="117" lly="-102" urx="444" ury="616"/>
<char name="percent" width="600" llx="101" lly="-15" urx="625" ury="616"/>
<char name="period" width="600" llx="206" lly="-15" urx="427" ury="171"/>
<char name="periodcentered" width="600" llx="248" lly="165" urx="461" ury="351"/>
<char name="perthousand" width="600" llx="-45" lly="-15" urx="743" ury="616"/>
<char name="plus" width="600" llx="114" lly="39" urx="596" ury="478"/>
<char name="plusminus" width="600" llx="76" lly="24" urx="614" ury="515"/>
<char name="q" width="600" llx="60" lly="-142" urx="685" ury="454"/>
<char name="question" width="600" llx="183" lly="-14" urx="592" ury="580"/>
<char name="questiondown" width="600" llx="100" lly="-146" urx="509" ury="449"/>
<char name="quotedbl" width="600" llx="211" lly="277" urx="585" ury="562"/>
<char name="quotedblbase" width="600" llx="34" lly="-142" urx="560" ury="143"/>
<char name="quotedblleft" width="600" llx="190" lly="277" urx="594" ury="562"/>
<char name="quotedblright" width="600" llx="119" lly="277" urx="645" ury="562"/>
<char name="quoteleft" width="600" llx="297" lly="277" urx="487" ury="562"/>
<char name="quoteright" width="600" llx="229" lly="277" urx="543" ury="562"/>
<char name="quotesinglbase" width="600" llx="144" lly="-142" urx="458" ury="143"/>
<char name="quotesingle" width="600" llx="303" lly="277" urx="493" ury="562"/>
<char name="r" width="600" llx="47" lly="0" urx="655" ury="454"/>
<char name="registered" width="600" llx="53" lly="-18" urx="667" ury="580"/>
<char name="ring" width="600" llx="319" lly="481" urx="528" ury="678"/>
<char name="s" width="600" llx="66" lly="-17" urx="608" ury="459"/>
<char name="scaron" width="600" llx="66" lly="-17" urx="633" ury="667"/>
<char name="scedilla" width="600" llx="66" lly="-206" urx="608" ury="459"/>
<char name="section" width="600" llx="74" lly="-70" urx="620" ury="580"/>
<char name="semicolon" width="600" llx="99" lly="-111" urx="481" ury="425"/>
<char name="seven" width="600" llx="147" lly="0" urx="622" ury="601"/>
<char name="six" width="600" llx="135" lly="-15" urx="652" ury="616"/>
<char name="slash" width="600" llx="90" lly="-77" urx="626" ury="626"/>
<char name="space" width="600" llx="0" lly="0" urx="0" ury="0"/>
<!-- JKT: the following has been manually added -->
<char name="sterling" width="600" llx="106" lly="-28" urx="650" ury="611"/>
<char name="t" width="600" llx="118" lly="-15" urx="567" ury="562"/>
<char name="thorn" width="600" llx="-32" lly="-142" urx="622" ury="626"/>
<char name="three" width="600" llx="71" lly="-15" urx="571" ury="616"/>
<char name="threequarters" width="600" llx="8" lly="-60" urx="699" ury="661"/>
<char name="threesuperior" width="600" llx="193" lly="222" urx="526" ury="616"/>
<char name="tilde" width="600" llx="199" lly="493" urx="643" ury="636"/>
<char name="trademark" width="600" llx="86" lly="230" urx="869" ury="562"/>
<char name="two" width="600" llx="61" lly="0" urx="594" ury="616"/>
<char name="twosuperior" width="600" llx="191" lly="230" urx="542" ury="616"/>
<char name="u" width="600" llx="70" lly="-15" urx="592" ury="439"/>
<char name="uacute" width="600" llx="70" lly="-15" urx="599" ury="661"/>
<char name="ucircumflex" width="600" llx="70" lly="-15" urx="597" ury="657"/>
<char name="udieresis" width="600" llx="70" lly="-15" urx="595" ury="638"/>
<char name="ugrave" width="600" llx="70" lly="-15" urx="592" ury="661"/>
<char name="underscore" width="600" llx="-27" lly="-125" urx="585" ury="-75"/>
<char name="v" width="600" llx="70" lly="0" urx="695" ury="439"/>
<char name="w" width="600" llx="53" lly="0" urx="712" ury="439"/>
<char name="x" width="600" llx="6" lly="0" urx="671" ury="439"/>
<char name="y" width="600" llx="-21" lly="-142" urx="695" ury="439"/>
<char name="yacute" width="600" llx="-21" lly="-142" urx="695" ury="661"/>
<char name="ydieresis" width="600" llx="-21" lly="-142" urx="695" ury="638"/>
<char name="yen" width="600" llx="98" lly="0" urx="710" ury="562"/>
<char name="z" width="600" llx="81" lly="0" urx="614" ury="439"/>
<char name="zcaron" width="600" llx="81" lly="0" urx="643" ury="667"/>
<char name="zero" width="600" llx="135" lly="-15" urx="593" ury="616"/>
</char-metrics>
</font-metrics>
@@ -0,0 +1,267 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- $Id$ -->
<!-- JKT: these metrics in XML were kindly produced by Fotis Jannidis -->
<font-metrics>
<font-name>Courier-Oblique</font-name>
<full-name>Courier Oblique</full-name>
<family-name>Courier</family-name>
<class-name>CourierOblique</class-name>
<encoding>StandardEncoding</encoding>
<underline-position>-100</underline-position>
<underline-thickness>50</underline-thickness>
<cap-height>562</cap-height>
<x-height>426</x-height>
<ascender>629</ascender>
<descender>-157</descender>
<first-char>32</first-char>
<last-char>255</last-char>
<char-metrics>
<char name="A" width="600" llx="3" lly="0" urx="607" ury="562"/>
<char name="AE" width="600" llx="3" lly="0" urx="655" ury="562"/>
<char name="Aacute" width="600" llx="3" lly="0" urx="660" ury="805"/>
<char name="Acircumflex" width="600" llx="3" lly="0" urx="607" ury="787"/>
<char name="Adieresis" width="600" llx="3" lly="0" urx="607" ury="753"/>
<char name="Agrave" width="600" llx="3" lly="0" urx="607" ury="805"/>
<char name="Aring" width="600" llx="3" lly="0" urx="607" ury="750"/>
<char name="Atilde" width="600" llx="3" lly="0" urx="655" ury="729"/>
<char name="B" width="600" llx="43" lly="0" urx="616" ury="562"/>
<char name="C" width="600" llx="93" lly="-18" urx="655" ury="580"/>
<char name="Ccedilla" width="600" llx="93" lly="-151" urx="658" ury="580"/>
<char name="D" width="600" llx="43" lly="0" urx="645" ury="562"/>
<char name="E" width="600" llx="53" lly="0" urx="660" ury="562"/>
<char name="Eacute" width="600" llx="53" lly="0" urx="670" ury="805"/>
<char name="Ecircumflex" width="600" llx="53" lly="0" urx="660" ury="787"/>
<char name="Edieresis" width="600" llx="53" lly="0" urx="660" ury="753"/>
<char name="Egrave" width="600" llx="53" lly="0" urx="660" ury="805"/>
<char name="Eth" width="600" llx="43" lly="0" urx="645" ury="562"/>
<char name="Euro" width="600" llx="0" lly="0" urx="0" ury="0"/>
<char name="F" width="600" llx="53" lly="0" urx="660" ury="562"/>
<char name="G" width="600" llx="83" lly="-18" urx="645" ury="580"/>
<char name="H" width="600" llx="32" lly="0" urx="687" ury="562"/>
<char name="I" width="600" llx="96" lly="0" urx="623" ury="562"/>
<char name="Iacute" width="600" llx="96" lly="0" urx="640" ury="805"/>
<char name="Icircumflex" width="600" llx="96" lly="0" urx="623" ury="787"/>
<char name="Idieresis" width="600" llx="96" lly="0" urx="623" ury="753"/>
<char name="Igrave" width="600" llx="96" lly="0" urx="623" ury="805"/>
<char name="J" width="600" llx="52" lly="-18" urx="685" ury="562"/>
<char name="K" width="600" llx="38" lly="0" urx="671" ury="562"/>
<char name="L" width="600" llx="47" lly="0" urx="607" ury="562"/>
<char name="Lslash" width="600" llx="47" lly="0" urx="607" ury="562"/>
<char name="M" width="600" llx="4" lly="0" urx="715" ury="562"/>
<char name="N" width="600" llx="7" lly="-13" urx="712" ury="562"/>
<char name="Ntilde" width="600" llx="7" lly="-13" urx="712" ury="729"/>
<char name="O" width="600" llx="94" lly="-18" urx="625" ury="580"/>
<char name="OE" width="600" llx="59" lly="0" urx="672" ury="562"/>
<char name="Oacute" width="600" llx="94" lly="-18" urx="640" ury="805"/>
<char name="Ocircumflex" width="600" llx="94" lly="-18" urx="625" ury="787"/>
<char name="Odieresis" width="600" llx="94" lly="-18" urx="625" ury="753"/>
<char name="Ograve" width="600" llx="94" lly="-18" urx="625" ury="805"/>
<char name="Oslash" width="600" llx="94" lly="-80" urx="625" ury="629"/>
<char name="Otilde" width="600" llx="94" lly="-18" urx="655" ury="729"/>
<char name="P" width="600" llx="79" lly="0" urx="644" ury="562"/>
<char name="Q" width="600" llx="95" lly="-138" urx="625" ury="580"/>
<char name="R" width="600" llx="38" lly="0" urx="598" ury="562"/>
<char name="S" width="600" llx="76" lly="-20" urx="650" ury="580"/>
<char name="Scaron" width="600" llx="76" lly="-20" urx="672" ury="802"/>
<char name="Scedilla" width="600" llx="76" lly="-151" urx="650" ury="580"/>
<char name="T" width="600" llx="108" lly="0" urx="665" ury="562"/>
<char name="Thorn" width="600" llx="79" lly="0" urx="606" ury="562"/>
<char name="U" width="600" llx="125" lly="-18" urx="702" ury="562"/>
<char name="Uacute" width="600" llx="125" lly="-18" urx="702" ury="805"/>
<char name="Ucircumflex" width="600" llx="125" lly="-18" urx="702" ury="787"/>
<char name="Udieresis" width="600" llx="125" lly="-18" urx="702" ury="753"/>
<char name="Ugrave" width="600" llx="125" lly="-18" urx="702" ury="805"/>
<char name="V" width="600" llx="105" lly="-13" urx="723" ury="562"/>
<char name="W" width="600" llx="106" lly="-13" urx="722" ury="562"/>
<char name="X" width="600" llx="23" lly="0" urx="675" ury="562"/>
<char name="Y" width="600" llx="133" lly="0" urx="695" ury="562"/>
<char name="Yacute" width="600" llx="133" lly="0" urx="695" ury="805"/>
<char name="Ydieresis" width="600" llx="133" lly="0" urx="695" ury="753"/>
<char name="Z" width="600" llx="86" lly="0" urx="610" ury="562"/>
<char name="Zcaron" width="600" llx="86" lly="0" urx="642" ury="802"/>
<char name="a" width="600" llx="76" lly="-15" urx="569" ury="441"/>
<char name="aacute" width="600" llx="76" lly="-15" urx="612" ury="672"/>
<char name="acircumflex" width="600" llx="76" lly="-15" urx="581" ury="654"/>
<char name="acute" width="600" llx="348" lly="497" urx="612" ury="672"/>
<char name="adieresis" width="600" llx="76" lly="-15" urx="575" ury="620"/>
<char name="ae" width="600" llx="41" lly="-15" urx="626" ury="441"/>
<char name="agrave" width="600" llx="76" lly="-15" urx="569" ury="672"/>
<char name="ampersand" width="600" llx="87" lly="-15" urx="580" ury="543"/>
<char name="aring" width="600" llx="76" lly="-15" urx="569" ury="627"/>
<char name="asciicircum" width="600" llx="175" lly="354" urx="587" ury="622"/>
<char name="asciitilde" width="600" llx="116" lly="197" urx="600" ury="320"/>
<char name="asterisk" width="600" llx="212" lly="257" urx="580" ury="607"/>
<char name="at" width="600" llx="127" lly="-15" urx="582" ury="622"/>
<char name="atilde" width="600" llx="76" lly="-15" urx="629" ury="606"/>
<char name="b" width="600" llx="29" lly="-15" urx="625" ury="629"/>
<char name="backslash" width="600" llx="249" lly="-80" urx="468" ury="629"/>
<char name="bar" width="600" llx="222" lly="-250" urx="485" ury="750"/>
<char name="braceleft" width="600" llx="233" lly="-108" urx="569" ury="622"/>
<char name="braceright" width="600" llx="140" lly="-108" urx="477" ury="622"/>
<char name="bracketleft" width="600" llx="246" lly="-108" urx="574" ury="622"/>
<char name="bracketright" width="600" llx="135" lly="-108" urx="463" ury="622"/>
<char name="breve" width="600" llx="279" lly="501" urx="576" ury="609"/>
<char name="brokenbar" width="600" llx="238" lly="-175" urx="469" ury="675"/>
<char name="bullet" width="600" llx="224" lly="130" urx="485" ury="383"/>
<char name="c" width="600" llx="106" lly="-15" urx="608" ury="441"/>
<char name="caron" width="600" llx="262" lly="492" urx="614" ury="669"/>
<char name="ccedilla" width="600" llx="106" lly="-151" urx="614" ury="441"/>
<char name="cedilla" width="600" llx="197" lly="-151" urx="344" ury="10"/>
<char name="cent" width="600" llx="151" lly="-49" urx="588" ury="614"/>
<char name="circumflex" width="600" llx="229" lly="477" urx="581" ury="654"/>
<char name="colon" width="600" llx="238" lly="-15" urx="441" ury="385"/>
<char name="comma" width="600" llx="157" lly="-112" urx="370" ury="122"/>
<char name="copyright" width="600" llx="53" lly="-18" urx="667" ury="580"/>
<char name="currency" width="600" llx="94" lly="58" urx="628" ury="506"/>
<char name="d" width="600" llx="85" lly="-15" urx="640" ury="629"/>
<char name="dagger" width="600" llx="217" lly="-78" urx="546" ury="580"/>
<char name="daggerdbl" width="600" llx="163" lly="-78" urx="546" ury="580"/>
<char name="degree" width="600" llx="214" lly="269" urx="576" ury="622"/>
<char name="dieresis" width="600" llx="272" lly="537" urx="579" ury="640"/>
<char name="divide" width="600" llx="136" lly="48" urx="573" ury="467"/>
<char name="dollar" width="600" llx="108" lly="-126" urx="596" ury="662"/>
<char name="dotaccent" width="600" llx="373" lly="537" urx="478" ury="640"/>
<char name="dotlessi" width="600" llx="95" lly="0" urx="515" ury="426"/>
<char name="e" width="600" llx="106" lly="-15" urx="598" ury="441"/>
<char name="eacute" width="600" llx="106" lly="-15" urx="612" ury="672"/>
<char name="ecircumflex" width="600" llx="106" lly="-15" urx="598" ury="654"/>
<char name="edieresis" width="600" llx="106" lly="-15" urx="598" ury="620"/>
<char name="egrave" width="600" llx="106" lly="-15" urx="598" ury="672"/>
<char name="eight" width="600" llx="132" lly="-15" urx="588" ury="622"/>
<char name="ellipsis" width="600" llx="46" lly="-15" urx="575" ury="111"/>
<char name="emdash" width="600" llx="49" lly="231" urx="661" ury="285"/>
<char name="endash" width="600" llx="124" lly="231" urx="586" ury="285"/>
<char name="equal" width="600" llx="109" lly="138" urx="600" ury="376"/>
<char name="eth" width="600" llx="102" lly="-15" urx="639" ury="629"/>
<char name="exclam" width="600" llx="243" lly="-15" urx="464" ury="572"/>
<char name="exclamdown" width="600" llx="225" lly="-157" urx="445" ury="430"/>
<char name="f" width="600" llx="114" lly="0" urx="662" ury="629"/>
<char name="fi" width="600" llx="3" lly="0" urx="619" ury="629"/>
<char name="five" width="600" llx="99" lly="-15" urx="589" ury="607"/>
<char name="fl" width="600" llx="3" lly="0" urx="619" ury="629"/>
<char name="florin" width="600" llx="-26" lly="-143" urx="671" ury="622"/>
<char name="four" width="600" llx="108" lly="0" urx="541" ury="622"/>
<char name="fraction" width="600" llx="84" lly="-57" urx="646" ury="665"/>
<char name="g" width="600" llx="61" lly="-157" urx="657" ury="441"/>
<char name="germandbls" width="600" llx="48" lly="-15" urx="617" ury="629"/>
<char name="grave" width="600" llx="294" lly="497" urx="484" ury="672"/>
<char name="greater" width="600" llx="85" lly="42" urx="599" ury="472"/>
<char name="guillemotleft" width="600" llx="92" lly="70" urx="652" ury="446"/>
<char name="guillemotright" width="600" llx="58" lly="70" urx="618" ury="446"/>
<char name="guilsinglleft" width="600" llx="204" lly="70" urx="540" ury="446"/>
<char name="guilsinglright" width="600" llx="170" lly="70" urx="506" ury="446"/>
<char name="h" width="600" llx="33" lly="0" urx="592" ury="629"/>
<char name="hungarumlaut" width="600" llx="239" lly="497" urx="683" ury="672"/>
<char name="hyphen" width="600" llx="152" lly="231" urx="558" ury="285"/>
<char name="i" width="600" llx="95" lly="0" urx="515" ury="657"/>
<char name="iacute" width="600" llx="95" lly="0" urx="612" ury="672"/>
<char name="icircumflex" width="600" llx="95" lly="0" urx="551" ury="654"/>
<char name="idieresis" width="600" llx="95" lly="0" urx="545" ury="620"/>
<char name="igrave" width="600" llx="95" lly="0" urx="515" ury="672"/>
<char name="j" width="600" llx="52" lly="-157" urx="550" ury="657"/>
<char name="k" width="600" llx="58" lly="0" urx="633" ury="629"/>
<char name="l" width="600" llx="95" lly="0" urx="515" ury="629"/>
<char name="less" width="600" llx="96" lly="42" urx="610" ury="472"/>
<char name="logicalnot" width="600" llx="155" lly="108" urx="591" ury="369"/>
<char name="lslash" width="600" llx="95" lly="0" urx="587" ury="629"/>
<char name="m" width="600" llx="-5" lly="0" urx="615" ury="441"/>
<char name="macron" width="600" llx="232" lly="525" urx="600" ury="565"/>
<char name="minus" width="600" llx="129" lly="232" urx="580" ury="283"/>
<char name="mu" width="600" llx="72" lly="-157" urx="572" ury="426"/>
<char name="multiply" width="600" llx="103" lly="43" urx="607" ury="470"/>
<char name="n" width="600" llx="26" lly="0" urx="585" ury="441"/>
<char name="nine" width="600" llx="93" lly="-15" urx="574" ury="622"/>
<char name="ntilde" width="600" llx="26" lly="0" urx="629" ury="606"/>
<char name="numbersign" width="600" llx="133" lly="-32" urx="596" ury="639"/>
<char name="o" width="600" llx="102" lly="-15" urx="588" ury="441"/>
<char name="oacute" width="600" llx="102" lly="-15" urx="612" ury="672"/>
<char name="ocircumflex" width="600" llx="102" lly="-15" urx="588" ury="654"/>
<char name="odieresis" width="600" llx="102" lly="-15" urx="588" ury="620"/>
<char name="oe" width="600" llx="54" lly="-15" urx="615" ury="441"/>
<char name="ogonek" width="600" llx="189" lly="-172" urx="377" ury="4"/>
<char name="ograve" width="600" llx="102" lly="-15" urx="588" ury="672"/>
<char name="one" width="600" llx="98" lly="0" urx="515" ury="622"/>
<char name="onehalf" width="600" llx="65" lly="-57" urx="669" ury="665"/>
<char name="onequarter" width="600" llx="65" lly="-57" urx="674" ury="665"/>
<char name="onesuperior" width="600" llx="231" lly="249" urx="491" ury="622"/>
<char name="ordfeminine" width="600" llx="209" lly="249" urx="512" ury="580"/>
<char name="ordmasculine" width="600" llx="210" lly="249" urx="535" ury="580"/>
<char name="oslash" width="600" llx="102" lly="-80" urx="588" ury="506"/>
<char name="otilde" width="600" llx="102" lly="-15" urx="629" ury="606"/>
<char name="p" width="600" llx="-24" lly="-157" urx="605" ury="441"/>
<char name="paragraph" width="600" llx="100" lly="-78" urx="630" ury="562"/>
<char name="parenleft" width="600" llx="313" lly="-108" urx="572" ury="622"/>
<char name="parenright" width="600" llx="137" lly="-108" urx="396" ury="622"/>
<char name="percent" width="600" llx="134" lly="-15" urx="599" ury="622"/>
<char name="period" width="600" llx="238" lly="-15" urx="382" ury="109"/>
<char name="periodcentered" width="600" llx="275" lly="189" urx="434" ury="327"/>
<char name="perthousand" width="600" llx="59" lly="-15" urx="627" ury="622"/>
<char name="plus" width="600" llx="129" lly="44" urx="580" ury="470"/>
<char name="plusminus" width="600" llx="96" lly="44" urx="594" ury="558"/>
<char name="q" width="600" llx="85" lly="-157" urx="682" ury="441"/>
<char name="question" width="600" llx="222" lly="-15" urx="583" ury="572"/>
<char name="questiondown" width="600" llx="105" lly="-157" urx="466" ury="430"/>
<char name="quotedbl" width="600" llx="273" lly="328" urx="532" ury="562"/>
<char name="quotedblbase" width="600" llx="115" lly="-134" urx="478" ury="100"/>
<char name="quotedblleft" width="600" llx="262" lly="328" urx="541" ury="562"/>
<char name="quotedblright" width="600" llx="213" lly="328" urx="576" ury="562"/>
<char name="quoteleft" width="600" llx="343" lly="328" urx="457" ury="562"/>
<char name="quoteright" width="600" llx="283" lly="328" urx="495" ury="562"/>
<char name="quotesinglbase" width="600" llx="185" lly="-134" urx="397" ury="100"/>
<char name="quotesingle" width="600" llx="345" lly="328" urx="460" ury="562"/>
<char name="r" width="600" llx="60" lly="0" urx="636" ury="441"/>
<char name="registered" width="600" llx="53" lly="-18" urx="667" ury="580"/>
<char name="ring" width="600" llx="332" lly="463" urx="500" ury="627"/>
<char name="s" width="600" llx="78" lly="-15" urx="584" ury="441"/>
<char name="scaron" width="600" llx="78" lly="-15" urx="614" ury="669"/>
<char name="scedilla" width="600" llx="78" lly="-151" urx="584" ury="441"/>
<char name="section" width="600" llx="104" lly="-78" urx="590" ury="580"/>
<char name="semicolon" width="600" llx="157" lly="-112" urx="441" ury="385"/>
<char name="seven" width="600" llx="182" lly="0" urx="612" ury="607"/>
<char name="six" width="600" llx="155" lly="-15" urx="629" ury="622"/>
<char name="slash" width="600" llx="112" lly="-80" urx="604" ury="629"/>
<char name="space" width="600" llx="0" lly="0" urx="0" ury="0"/>
<!-- JKT: the following has been manually added -->
<char name="sterling" width="600" llx="124" lly="-21" urx="621" ury="611"/>
<char name="t" width="600" llx="167" lly="-15" urx="561" ury="561"/>
<char name="thorn" width="600" llx="-24" lly="-157" urx="605" ury="629"/>
<char name="three" width="600" llx="82" lly="-15" urx="538" ury="622"/>
<char name="threequarters" width="600" llx="73" lly="-56" urx="659" ury="666"/>
<char name="threesuperior" width="600" llx="213" lly="240" urx="501" ury="622"/>
<char name="tilde" width="600" llx="212" lly="489" urx="629" ury="606"/>
<char name="trademark" width="600" llx="75" lly="263" urx="742" ury="562"/>
<char name="two" width="600" llx="70" lly="0" urx="568" ury="622"/>
<char name="twosuperior" width="600" llx="230" lly="249" urx="535" ury="622"/>
<char name="u" width="600" llx="101" lly="-15" urx="572" ury="426"/>
<char name="uacute" width="600" llx="101" lly="-15" urx="602" ury="672"/>
<char name="ucircumflex" width="600" llx="101" lly="-15" urx="572" ury="654"/>
<char name="udieresis" width="600" llx="101" lly="-15" urx="575" ury="620"/>
<char name="ugrave" width="600" llx="101" lly="-15" urx="572" ury="672"/>
<char name="underscore" width="600" llx="-27" lly="-125" urx="584" ury="-75"/>
<char name="v" width="600" llx="90" lly="-10" urx="681" ury="426"/>
<char name="w" width="600" llx="76" lly="-10" urx="695" ury="426"/>
<char name="x" width="600" llx="20" lly="0" urx="655" ury="426"/>
<char name="y" width="600" llx="-4" lly="-157" urx="683" ury="426"/>
<char name="yacute" width="600" llx="-4" lly="-157" urx="683" ury="672"/>
<char name="ydieresis" width="600" llx="-4" lly="-157" urx="683" ury="620"/>
<char name="yen" width="600" llx="120" lly="0" urx="693" ury="562"/>
<char name="z" width="600" llx="99" lly="0" urx="593" ury="426"/>
<char name="zcaron" width="600" llx="99" lly="0" urx="624" ury="669"/>
<char name="zero" width="600" llx="154" lly="-15" urx="575" ury="622"/>
</char-metrics>
</font-metrics>
+606
View File
@@ -0,0 +1,606 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- $Id$ -->
<!-- JKT: these metrics in XML were kindly produced by Fotis Jannidis -->
<font-metrics>
<font-name>Helvetica</font-name>
<full-name>Helvetica</full-name>
<family-name>Helvetica</family-name>
<class-name>Helvetica</class-name>
<encoding>StandardEncoding</encoding>
<underline-position>-100</underline-position>
<underline-thickness>50</underline-thickness>
<cap-height>718</cap-height>
<x-height>523</x-height>
<ascender>718</ascender>
<descender>-207</descender>
<first-char>32</first-char>
<last-char>255</last-char>
<char-metrics>
<char name="A" width="667" llx="14" lly="0" urx="654" ury="718"/>
<char name="AE" width="1000" llx="8" lly="0" urx="951" ury="718"/>
<char name="Aacute" width="667" llx="14" lly="0" urx="654" ury="929"/>
<char name="Acircumflex" width="667" llx="14" lly="0" urx="654" ury="929"/>
<char name="Adieresis" width="667" llx="14" lly="0" urx="654" ury="901"/>
<char name="Agrave" width="667" llx="14" lly="0" urx="654" ury="929"/>
<char name="Aring" width="667" llx="14" lly="0" urx="654" ury="931"/>
<char name="Atilde" width="667" llx="14" lly="0" urx="654" ury="917"/>
<char name="B" width="667" llx="74" lly="0" urx="627" ury="718"/>
<char name="C" width="722" llx="44" lly="-19" urx="681" ury="737"/>
<char name="Ccedilla" width="722" llx="44" lly="-225" urx="681" ury="737"/>
<char name="D" width="722" llx="81" lly="0" urx="674" ury="718"/>
<char name="E" width="667" llx="86" lly="0" urx="616" ury="718"/>
<char name="Eacute" width="667" llx="86" lly="0" urx="616" ury="929"/>
<char name="Ecircumflex" width="667" llx="86" lly="0" urx="616" ury="929"/>
<char name="Edieresis" width="667" llx="86" lly="0" urx="616" ury="901"/>
<char name="Egrave" width="667" llx="86" lly="0" urx="616" ury="929"/>
<char name="Eth" width="722" llx="0" lly="0" urx="674" ury="718"/>
<char name="Euro" width="556" llx="0" lly="0" urx="0" ury="0"/>
<char name="F" width="611" llx="86" lly="0" urx="583" ury="718"/>
<char name="G" width="778" llx="48" lly="-19" urx="704" ury="737"/>
<char name="H" width="722" llx="77" lly="0" urx="646" ury="718"/>
<char name="I" width="278" llx="91" lly="0" urx="188" ury="718"/>
<char name="Iacute" width="278" llx="91" lly="0" urx="292" ury="929"/>
<char name="Icircumflex" width="278" llx="-6" lly="0" urx="285" ury="929"/>
<char name="Idieresis" width="278" llx="13" lly="0" urx="266" ury="901"/>
<char name="Igrave" width="278" llx="-13" lly="0" urx="188" ury="929"/>
<char name="J" width="500" llx="17" lly="-19" urx="428" ury="718"/>
<char name="K" width="667" llx="76" lly="0" urx="663" ury="718"/>
<char name="L" width="556" llx="76" lly="0" urx="537" ury="718"/>
<char name="Lslash" width="556" llx="-20" lly="0" urx="537" ury="718"/>
<char name="M" width="833" llx="73" lly="0" urx="761" ury="718"/>
<char name="N" width="722" llx="76" lly="0" urx="646" ury="718"/>
<char name="Ntilde" width="722" llx="76" lly="0" urx="646" ury="917"/>
<char name="O" width="778" llx="39" lly="-19" urx="739" ury="737"/>
<char name="OE" width="1000" llx="36" lly="-19" urx="965" ury="737"/>
<char name="Oacute" width="778" llx="39" lly="-19" urx="739" ury="929"/>
<char name="Ocircumflex" width="778" llx="39" lly="-19" urx="739" ury="929"/>
<char name="Odieresis" width="778" llx="39" lly="-19" urx="739" ury="901"/>
<char name="Ograve" width="778" llx="39" lly="-19" urx="739" ury="929"/>
<char name="Oslash" width="778" llx="39" lly="-19" urx="740" ury="737"/>
<char name="Otilde" width="778" llx="39" lly="-19" urx="739" ury="917"/>
<char name="P" width="667" llx="86" lly="0" urx="622" ury="718"/>
<char name="Q" width="778" llx="39" lly="-56" urx="739" ury="737"/>
<char name="R" width="722" llx="88" lly="0" urx="684" ury="718"/>
<char name="S" width="667" llx="49" lly="-19" urx="620" ury="737"/>
<char name="Scaron" width="667" llx="49" lly="-19" urx="620" ury="929"/>
<char name="T" width="611" llx="14" lly="0" urx="597" ury="718"/>
<char name="Thorn" width="667" llx="86" lly="0" urx="622" ury="718"/>
<char name="U" width="722" llx="79" lly="-19" urx="644" ury="718"/>
<char name="Uacute" width="722" llx="79" lly="-19" urx="644" ury="929"/>
<char name="Ucircumflex" width="722" llx="79" lly="-19" urx="644" ury="929"/>
<char name="Udieresis" width="722" llx="79" lly="-19" urx="644" ury="901"/>
<char name="Ugrave" width="722" llx="79" lly="-19" urx="644" ury="929"/>
<char name="V" width="667" llx="20" lly="0" urx="647" ury="718"/>
<char name="W" width="944" llx="16" lly="0" urx="928" ury="718"/>
<char name="X" width="667" llx="19" lly="0" urx="648" ury="718"/>
<char name="Y" width="667" llx="14" lly="0" urx="653" ury="718"/>
<char name="Yacute" width="667" llx="14" lly="0" urx="653" ury="929"/>
<char name="Ydieresis" width="667" llx="14" lly="0" urx="653" ury="901"/>
<char name="Z" width="611" llx="23" lly="0" urx="588" ury="718"/>
<char name="Zcaron" width="611" llx="23" lly="0" urx="588" ury="929"/>
<char name="a" width="556" llx="36" lly="-15" urx="530" ury="538"/>
<char name="aacute" width="556" llx="36" lly="-15" urx="530" ury="734"/>
<char name="acircumflex" width="556" llx="36" lly="-15" urx="530" ury="734"/>
<char name="acute" width="333" llx="122" lly="593" urx="319" ury="734"/>
<char name="adieresis" width="556" llx="36" lly="-15" urx="530" ury="706"/>
<char name="ae" width="889" llx="36" lly="-15" urx="847" ury="538"/>
<char name="agrave" width="556" llx="36" lly="-15" urx="530" ury="734"/>
<char name="ampersand" width="667" llx="44" lly="-15" urx="645" ury="718"/>
<char name="aring" width="556" llx="36" lly="-15" urx="530" ury="756"/>
<char name="asciicircum" width="469" llx="-14" lly="264" urx="483" ury="688"/>
<char name="asciitilde" width="584" llx="61" lly="180" urx="523" ury="326"/>
<char name="asterisk" width="389" llx="39" lly="431" urx="349" ury="718"/>
<char name="at" width="1015" llx="147" lly="-19" urx="868" ury="737"/>
<char name="atilde" width="556" llx="36" lly="-15" urx="530" ury="722"/>
<char name="b" width="556" llx="58" lly="-15" urx="517" ury="718"/>
<char name="backslash" width="278" llx="-17" lly="-19" urx="295" ury="737"/>
<char name="bar" width="260" llx="94" lly="-225" urx="167" ury="775"/>
<char name="braceleft" width="334" llx="42" lly="-196" urx="292" ury="722"/>
<char name="braceright" width="334" llx="42" lly="-196" urx="292" ury="722"/>
<char name="bracketleft" width="278" llx="63" lly="-196" urx="250" ury="722"/>
<char name="bracketright" width="278" llx="28" lly="-196" urx="215" ury="722"/>
<char name="breve" width="333" llx="13" lly="595" urx="321" ury="731"/>
<char name="brokenbar" width="260" llx="94" lly="-150" urx="167" ury="700"/>
<char name="bullet" width="350" llx="18" lly="202" urx="333" ury="517"/>
<char name="c" width="500" llx="30" lly="-15" urx="477" ury="538"/>
<char name="caron" width="333" llx="21" lly="593" urx="312" ury="734"/>
<char name="ccedilla" width="500" llx="30" lly="-225" urx="477" ury="538"/>
<char name="cedilla" width="333" llx="45" lly="-225" urx="259" ury="0"/>
<char name="cent" width="556" llx="51" lly="-115" urx="513" ury="623"/>
<char name="circumflex" width="333" llx="21" lly="593" urx="312" ury="734"/>
<char name="colon" width="278" llx="87" lly="0" urx="191" ury="516"/>
<char name="comma" width="278" llx="87" lly="-147" urx="191" ury="106"/>
<char name="copyright" width="737" llx="-14" lly="-19" urx="752" ury="737"/>
<char name="currency" width="556" llx="28" lly="99" urx="528" ury="603"/>
<char name="d" width="556" llx="35" lly="-15" urx="499" ury="718"/>
<char name="dagger" width="556" llx="43" lly="-159" urx="514" ury="718"/>
<char name="daggerdbl" width="556" llx="43" lly="-159" urx="514" ury="718"/>
<char name="degree" width="400" llx="54" lly="411" urx="346" ury="703"/>
<char name="dieresis" width="333" llx="40" lly="604" urx="293" ury="706"/>
<char name="divide" width="584" llx="39" lly="-19" urx="545" ury="524"/>
<char name="dollar" width="556" llx="32" lly="-115" urx="520" ury="775"/>
<char name="dotaccent" width="333" llx="121" lly="604" urx="212" ury="706"/>
<char name="dotlessi" width="278" llx="95" lly="0" urx="183" ury="523"/>
<char name="e" width="556" llx="40" lly="-15" urx="516" ury="538"/>
<char name="eacute" width="556" llx="40" lly="-15" urx="516" ury="734"/>
<char name="ecircumflex" width="556" llx="40" lly="-15" urx="516" ury="734"/>
<char name="edieresis" width="556" llx="40" lly="-15" urx="516" ury="706"/>
<char name="egrave" width="556" llx="40" lly="-15" urx="516" ury="734"/>
<char name="eight" width="556" llx="38" lly="-19" urx="517" ury="703"/>
<char name="ellipsis" width="1000" llx="115" lly="0" urx="885" ury="106"/>
<char name="emdash" width="1000" llx="0" lly="240" urx="1000" ury="313"/>
<char name="endash" width="556" llx="0" lly="240" urx="556" ury="313"/>
<char name="equal" width="584" llx="39" lly="115" urx="545" ury="390"/>
<char name="eth" width="556" llx="35" lly="-15" urx="522" ury="737"/>
<char name="exclam" width="278" llx="90" lly="0" urx="187" ury="718"/>
<char name="exclamdown" width="333" llx="118" lly="-195" urx="215" ury="523"/>
<char name="f" width="278" llx="14" lly="0" urx="262" ury="728"/>
<char name="fi" width="500" llx="14" lly="0" urx="434" ury="728"/>
<char name="five" width="556" llx="32" lly="-19" urx="514" ury="688"/>
<char name="fl" width="500" llx="14" lly="0" urx="432" ury="728"/>
<char name="florin" width="556" llx="-11" lly="-207" urx="501" ury="737"/>
<char name="four" width="556" llx="25" lly="0" urx="523" ury="703"/>
<char name="fraction" width="167" llx="-166" lly="-19" urx="333" ury="703"/>
<char name="g" width="556" llx="40" lly="-220" urx="499" ury="538"/>
<char name="germandbls" width="611" llx="67" lly="-15" urx="571" ury="728"/>
<char name="grave" width="333" llx="14" lly="593" urx="211" ury="734"/>
<char name="greater" width="584" llx="48" lly="11" urx="536" ury="495"/>
<char name="guillemotleft" width="556" llx="97" lly="108" urx="459" ury="446"/>
<char name="guillemotright" width="556" llx="97" lly="108" urx="459" ury="446"/>
<char name="guilsinglleft" width="333" llx="88" lly="108" urx="245" ury="446"/>
<char name="guilsinglright" width="333" llx="88" lly="108" urx="245" ury="446"/>
<char name="h" width="556" llx="65" lly="0" urx="491" ury="718"/>
<char name="hungarumlaut" width="333" llx="31" lly="593" urx="409" ury="734"/>
<char name="hyphen" width="333" llx="44" lly="232" urx="289" ury="322"/>
<char name="i" width="222" llx="67" lly="0" urx="155" ury="718"/>
<char name="iacute" width="278" llx="95" lly="0" urx="292" ury="734"/>
<char name="icircumflex" width="278" llx="-6" lly="0" urx="285" ury="734"/>
<char name="idieresis" width="278" llx="13" lly="0" urx="266" ury="706"/>
<char name="igrave" width="278" llx="-13" lly="0" urx="184" ury="734"/>
<char name="j" width="222" llx="-16" lly="-210" urx="155" ury="718"/>
<char name="k" width="500" llx="67" lly="0" urx="501" ury="718"/>
<char name="l" width="222" llx="67" lly="0" urx="155" ury="718"/>
<char name="less" width="584" llx="48" lly="11" urx="536" ury="495"/>
<char name="logicalnot" width="584" llx="39" lly="108" urx="545" ury="390"/>
<char name="lslash" width="222" llx="-20" lly="0" urx="242" ury="718"/>
<char name="m" width="833" llx="65" lly="0" urx="769" ury="538"/>
<char name="macron" width="333" llx="10" lly="627" urx="323" ury="684"/>
<char name="minus" width="324" llx="39" lly="216" urx="545" ury="289"/>
<char name="mu" width="556" llx="68" lly="-207" urx="489" ury="523"/>
<char name="multiply" width="584" llx="39" lly="0" urx="545" ury="506"/>
<char name="n" width="556" llx="65" lly="0" urx="491" ury="538"/>
<char name="nine" width="556" llx="42" lly="-19" urx="514" ury="703"/>
<char name="ntilde" width="556" llx="65" lly="0" urx="491" ury="722"/>
<char name="numbersign" width="556" llx="28" lly="0" urx="529" ury="688"/>
<char name="o" width="556" llx="35" lly="-14" urx="521" ury="538"/>
<char name="oacute" width="556" llx="35" lly="-14" urx="521" ury="734"/>
<char name="ocircumflex" width="556" llx="35" lly="-14" urx="521" ury="734"/>
<char name="odieresis" width="556" llx="35" lly="-14" urx="521" ury="706"/>
<char name="oe" width="944" llx="35" lly="-15" urx="902" ury="538"/>
<char name="ogonek" width="333" llx="73" lly="-225" urx="287" ury="0"/>
<char name="ograve" width="556" llx="35" lly="-14" urx="521" ury="734"/>
<char name="one" width="556" llx="101" lly="0" urx="359" ury="703"/>
<char name="onehalf" width="834" llx="43" lly="-19" urx="773" ury="703"/>
<char name="onequarter" width="834" llx="73" lly="-19" urx="756" ury="703"/>
<char name="onesuperior" width="333" llx="43" lly="281" urx="222" ury="703"/>
<char name="ordfeminine" width="370" llx="24" lly="405" urx="346" ury="737"/>
<char name="ordmasculine" width="365" llx="25" lly="405" urx="341" ury="737"/>
<char name="oslash" width="611" llx="28" lly="-22" urx="537" ury="545"/>
<char name="otilde" width="556" llx="35" lly="-14" urx="521" ury="722"/>
<char name="p" width="556" llx="58" lly="-207" urx="517" ury="538"/>
<char name="paragraph" width="537" llx="18" lly="-173" urx="497" ury="718"/>
<char name="parenleft" width="333" llx="68" lly="-207" urx="299" ury="733"/>
<char name="parenright" width="333" llx="34" lly="-207" urx="265" ury="733"/>
<char name="percent" width="889" llx="39" lly="-19" urx="850" ury="703"/>
<char name="period" width="278" llx="87" lly="0" urx="191" ury="106"/>
<char name="periodcentered" width="278" llx="77" lly="190" urx="202" ury="315"/>
<char name="perthousand" width="1000" llx="7" lly="-19" urx="994" ury="703"/>
<char name="plus" width="584" llx="39" lly="0" urx="545" ury="505"/>
<char name="plusminus" width="584" llx="39" lly="0" urx="545" ury="506"/>
<char name="q" width="556" llx="35" lly="-207" urx="494" ury="538"/>
<char name="question" width="556" llx="56" lly="0" urx="492" ury="727"/>
<char name="questiondown" width="611" llx="91" lly="-201" urx="527" ury="525"/>
<char name="quotedbl" width="355" llx="70" lly="463" urx="285" ury="718"/>
<char name="quotedblbase" width="333" llx="26" lly="-149" urx="295" ury="106"/>
<char name="quotedblleft" width="333" llx="38" lly="470" urx="307" ury="725"/>
<char name="quotedblright" width="333" llx="26" lly="463" urx="295" ury="718"/>
<char name="quoteleft" width="222" llx="65" lly="470" urx="169" ury="725"/>
<char name="quoteright" width="222" llx="53" lly="463" urx="157" ury="718"/>
<char name="quotesinglbase" width="222" llx="53" lly="-149" urx="157" ury="106"/>
<char name="quotesingle" width="191" llx="59" lly="463" urx="132" ury="718"/>
<char name="r" width="333" llx="77" lly="0" urx="332" ury="538"/>
<char name="registered" width="737" llx="-14" lly="-19" urx="752" ury="737"/>
<char name="ring" width="333" llx="75" lly="572" urx="259" ury="756"/>
<char name="s" width="500" llx="32" lly="-15" urx="464" ury="538"/>
<char name="scaron" width="500" llx="32" lly="-15" urx="464" ury="734"/>
<char name="section" width="556" llx="43" lly="-191" urx="512" ury="737"/>
<char name="semicolon" width="278" llx="87" lly="-147" urx="191" ury="516"/>
<char name="seven" width="556" llx="37" lly="0" urx="523" ury="688"/>
<char name="six" width="556" llx="38" lly="-19" urx="518" ury="703"/>
<char name="slash" width="278" llx="-17" lly="-19" urx="295" ury="737"/>
<char name="space" width="278" llx="0" lly="0" urx="0" ury="0"/>
<!-- JKT: the following has been manually added -->
<char name="sterling" width="556" llx="33" lly="-16" urx="539" ury="718"/>
<char name="t" width="278" llx="14" lly="-7" urx="257" ury="669"/>
<char name="thorn" width="556" llx="58" lly="-207" urx="517" ury="718"/>
<char name="three" width="556" llx="34" lly="-19" urx="522" ury="703"/>
<char name="threequarters" width="834" llx="45" lly="-19" urx="810" ury="703"/>
<char name="threesuperior" width="333" llx="5" lly="270" urx="325" ury="703"/>
<char name="tilde" width="333" llx="-4" lly="606" urx="337" ury="722"/>
<char name="trademark" width="1000" llx="46" lly="306" urx="903" ury="718"/>
<char name="two" width="556" llx="26" lly="0" urx="507" ury="703"/>
<char name="twosuperior" width="333" llx="4" lly="281" urx="323" ury="703"/>
<char name="u" width="556" llx="68" lly="-15" urx="489" ury="523"/>
<char name="uacute" width="556" llx="68" lly="-15" urx="489" ury="734"/>
<char name="ucircumflex" width="556" llx="68" lly="-15" urx="489" ury="734"/>
<char name="udieresis" width="556" llx="68" lly="-15" urx="489" ury="706"/>
<char name="ugrave" width="556" llx="68" lly="-15" urx="489" ury="734"/>
<char name="underscore" width="556" llx="0" lly="-125" urx="556" ury="-75"/>
<char name="v" width="500" llx="8" lly="0" urx="492" ury="523"/>
<char name="w" width="722" llx="14" lly="0" urx="709" ury="523"/>
<char name="x" width="500" llx="11" lly="0" urx="490" ury="523"/>
<char name="y" width="500" llx="11" lly="-214" urx="489" ury="523"/>
<char name="yacute" width="500" llx="11" lly="-214" urx="489" ury="734"/>
<char name="ydieresis" width="500" llx="11" lly="-214" urx="489" ury="706"/>
<char name="yen" width="556" llx="3" lly="0" urx="553" ury="688"/>
<char name="z" width="500" llx="31" lly="0" urx="469" ury="523"/>
<char name="zcaron" width="500" llx="31" lly="0" urx="469" ury="734"/>
<char name="zero" width="556" llx="37" lly="-19" urx="519" ury="703"/>
</char-metrics>
<kerning kpx1="107">
<pair kern="-20" kpx2="111"/>
<pair kern="-20" kpx2="101"/>
</kerning>
<kerning kpx1="79">
<pair kern="-20" kpx2="65"/>
<pair kern="-30" kpx2="87"/>
<pair kern="-70" kpx2="89"/>
<pair kern="-40" kpx2="84"/>
<pair kern="-40" kpx2="46"/>
<pair kern="-50" kpx2="86"/>
<pair kern="-60" kpx2="88"/>
<pair kern="-40" kpx2="44"/>
</kerning>
<kerning kpx1="104">
<pair kern="-30" kpx2="121"/>
</kerning>
<kerning kpx1="87">
<pair kern="-30" kpx2="111"/>
<pair kern="-40" kpx2="45"/>
<pair kern="-20" kpx2="79"/>
<pair kern="-40" kpx2="97"/>
<pair kern="-50" kpx2="65"/>
<pair kern="-30" kpx2="117"/>
<pair kern="-20" kpx2="121"/>
<pair kern="-80" kpx2="46"/>
<pair kern="-30" kpx2="101"/>
<pair kern="-80" kpx2="44"/>
</kerning>
<kerning kpx1="99">
<pair kern="-20" kpx2="107"/>
<pair kern="-15" kpx2="44"/>
</kerning>
<kerning kpx1="112">
<pair kern="-30" kpx2="121"/>
<pair kern="-35" kpx2="46"/>
<pair kern="-35" kpx2="44"/>
</kerning>
<kerning kpx1="80">
<pair kern="-50" kpx2="111"/>
<pair kern="-40" kpx2="97"/>
<pair kern="-120" kpx2="65"/>
<pair kern="-180" kpx2="46"/>
<pair kern="-50" kpx2="101"/>
<pair kern="-180" kpx2="44"/>
</kerning>
<kerning kpx1="86">
<pair kern="-80" kpx2="111"/>
<pair kern="-80" kpx2="45"/>
<pair kern="-40" kpx2="79"/>
<pair kern="-40" kpx2="58"/>
<pair kern="-70" kpx2="97"/>
<pair kern="-80" kpx2="65"/>
<pair kern="-70" kpx2="117"/>
<pair kern="-125" kpx2="46"/>
<pair kern="-40" kpx2="71"/>
<pair kern="-80" kpx2="101"/>
<pair kern="-40" kpx2="59"/>
<pair kern="-125" kpx2="44"/>
</kerning>
<kerning kpx1="118">
<pair kern="-25" kpx2="111"/>
<pair kern="-25" kpx2="97"/>
<pair kern="-80" kpx2="46"/>
<pair kern="-25" kpx2="101"/>
<pair kern="-80" kpx2="44"/>
</kerning>
<kerning kpx1="59">
<pair kern="-50" kpx2="32"/>
</kerning>
<kerning kpx1="32">
<pair kern="-40" kpx2="87"/>
<pair kern="-30" kpx2="147"/>
<pair kern="-90" kpx2="89"/>
<pair kern="-50" kpx2="84"/>
<pair kern="-60" kpx2="145"/>
<pair kern="-50" kpx2="86"/>
</kerning>
<kerning kpx1="97">
<pair kern="-20" kpx2="119"/>
<pair kern="-30" kpx2="121"/>
<pair kern="-20" kpx2="118"/>
</kerning>
<kerning kpx1="65">
<pair kern="-30" kpx2="79"/>
<pair kern="-40" kpx2="119"/>
<pair kern="-50" kpx2="87"/>
<pair kern="-30" kpx2="67"/>
<pair kern="-30" kpx2="81"/>
<pair kern="-30" kpx2="71"/>
<pair kern="-70" kpx2="86"/>
<pair kern="-40" kpx2="118"/>
<pair kern="-50" kpx2="85"/>
<pair kern="-30" kpx2="117"/>
<pair kern="-100" kpx2="89"/>
<pair kern="-120" kpx2="84"/>
<pair kern="-40" kpx2="121"/>
</kerning>
<kerning kpx1="70">
<pair kern="-30" kpx2="111"/>
<pair kern="-45" kpx2="114"/>
<pair kern="-50" kpx2="97"/>
<pair kern="-80" kpx2="65"/>
<pair kern="-150" kpx2="46"/>
<pair kern="-30" kpx2="101"/>
<pair kern="-150" kpx2="44"/>
</kerning>
<kerning kpx1="85">
<pair kern="-40" kpx2="65"/>
<pair kern="-40" kpx2="46"/>
<pair kern="-40" kpx2="44"/>
</kerning>
<kerning kpx1="115">
<pair kern="-30" kpx2="119"/>
<pair kern="-15" kpx2="46"/>
<pair kern="-15" kpx2="44"/>
</kerning>
<kerning kpx1="122">
<pair kern="-15" kpx2="111"/>
<pair kern="-15" kpx2="101"/>
</kerning>
<kerning kpx1="83">
<pair kern="-20" kpx2="46"/>
<pair kern="-20" kpx2="44"/>
</kerning>
<kerning kpx1="111">
<pair kern="-15" kpx2="119"/>
<pair kern="-30" kpx2="121"/>
<pair kern="-40" kpx2="46"/>
<pair kern="-30" kpx2="120"/>
<pair kern="-15" kpx2="118"/>
<pair kern="-40" kpx2="44"/>
</kerning>
<kerning kpx1="68">
<pair kern="-40" kpx2="65"/>
<pair kern="-40" kpx2="87"/>
<pair kern="-90" kpx2="89"/>
<pair kern="-70" kpx2="46"/>
<pair kern="-70" kpx2="86"/>
<pair kern="-70" kpx2="44"/>
</kerning>
<kerning kpx1="146">
<pair kern="-50" kpx2="100"/>
<pair kern="-70" kpx2="32"/>
<pair kern="-57" kpx2="146"/>
<pair kern="-50" kpx2="114"/>
<pair kern="-50" kpx2="115"/>
</kerning>
<kerning kpx1="82">
<pair kern="-20" kpx2="79"/>
<pair kern="-30" kpx2="87"/>
<pair kern="-40" kpx2="85"/>
<pair kern="-50" kpx2="89"/>
<pair kern="-30" kpx2="84"/>
<pair kern="-50" kpx2="86"/>
</kerning>
<kerning kpx1="75">
<pair kern="-40" kpx2="111"/>
<pair kern="-50" kpx2="79"/>
<pair kern="-30" kpx2="117"/>
<pair kern="-50" kpx2="121"/>
<pair kern="-40" kpx2="101"/>
</kerning>
<kerning kpx1="119">
<pair kern="-10" kpx2="111"/>
<pair kern="-15" kpx2="97"/>
<pair kern="-60" kpx2="46"/>
<pair kern="-10" kpx2="101"/>
<pair kern="-60" kpx2="44"/>
</kerning>
<kerning kpx1="58">
<pair kern="-50" kpx2="32"/>
</kerning>
<kerning kpx1="114">
<pair kern="15" kpx2="107"/>
<pair kern="30" kpx2="58"/>
<pair kern="30" kpx2="112"/>
<pair kern="15" kpx2="108"/>
<pair kern="30" kpx2="118"/>
<pair kern="-50" kpx2="44"/>
<pair kern="30" kpx2="59"/>
<pair kern="15" kpx2="105"/>
<pair kern="25" kpx2="109"/>
<pair kern="-10" kpx2="97"/>
<pair kern="15" kpx2="117"/>
<pair kern="40" kpx2="116"/>
<pair kern="30" kpx2="121"/>
<pair kern="-50" kpx2="46"/>
<pair kern="25" kpx2="110"/>
</kerning>
<kerning kpx1="67">
<pair kern="-30" kpx2="46"/>
<pair kern="-30" kpx2="44"/>
</kerning>
<kerning kpx1="145">
<pair kern="-57" kpx2="145"/>
</kerning>
<kerning kpx1="103">
<pair kern="-10" kpx2="114"/>
</kerning>
<kerning kpx1="66">
<pair kern="-10" kpx2="85"/>
<pair kern="-20" kpx2="46"/>
<pair kern="-20" kpx2="44"/>
</kerning>
<kerning kpx1="81">
<pair kern="-10" kpx2="85"/>
</kerning>
<kerning kpx1="76">
<pair kern="-140" kpx2="148"/>
<pair kern="-160" kpx2="146"/>
<pair kern="-70" kpx2="87"/>
<pair kern="-140" kpx2="89"/>
<pair kern="-30" kpx2="121"/>
<pair kern="-110" kpx2="84"/>
<pair kern="-110" kpx2="86"/>
</kerning>
<kerning kpx1="98">
<pair kern="-20" kpx2="117"/>
<pair kern="-20" kpx2="121"/>
<pair kern="-40" kpx2="46"/>
<pair kern="-20" kpx2="108"/>
<pair kern="-10" kpx2="98"/>
<pair kern="-20" kpx2="118"/>
<pair kern="-40" kpx2="44"/>
</kerning>
<kerning kpx1="44">
<pair kern="-100" kpx2="148"/>
<pair kern="-100" kpx2="146"/>
</kerning>
<kerning kpx1="148">
<pair kern="-40" kpx2="32"/>
</kerning>
<kerning kpx1="109">
<pair kern="-10" kpx2="117"/>
<pair kern="-15" kpx2="121"/>
</kerning>
<kerning kpx1="248">
<pair kern="-55" kpx2="107"/>
<pair kern="-55" kpx2="104"/>
<pair kern="-55" kpx2="99"/>
<pair kern="-55" kpx2="112"/>
<pair kern="-55" kpx2="113"/>
<pair kern="-70" kpx2="118"/>
<pair kern="-55" kpx2="105"/>
<pair kern="-55" kpx2="97"/>
<pair kern="-55" kpx2="117"/>
<pair kern="-55" kpx2="116"/>
<pair kern="-55" kpx2="106"/>
<pair kern="-55" kpx2="115"/>
<pair kern="-55" kpx2="122"/>
<pair kern="-55" kpx2="100"/>
<pair kern="-55" kpx2="111"/>
<pair kern="-70" kpx2="119"/>
<pair kern="-55" kpx2="114"/>
<pair kern="-55" kpx2="103"/>
<pair kern="-55" kpx2="108"/>
<pair kern="-55" kpx2="98"/>
<pair kern="-95" kpx2="44"/>
<pair kern="-55" kpx2="109"/>
<pair kern="-55" kpx2="102"/>
<pair kern="-70" kpx2="121"/>
<pair kern="-95" kpx2="46"/>
<pair kern="-55" kpx2="110"/>
<pair kern="-85" kpx2="120"/>
<pair kern="-55" kpx2="101"/>
</kerning>
<kerning kpx1="102">
<pair kern="60" kpx2="148"/>
<pair kern="-30" kpx2="111"/>
<pair kern="50" kpx2="146"/>
<pair kern="-30" kpx2="97"/>
<pair kern="-30" kpx2="46"/>
<pair kern="-30" kpx2="101"/>
<pair kern="-30" kpx2="44"/>
</kerning>
<kerning kpx1="74">
<pair kern="-20" kpx2="97"/>
<pair kern="-20" kpx2="65"/>
<pair kern="-20" kpx2="117"/>
<pair kern="-30" kpx2="46"/>
<pair kern="-30" kpx2="44"/>
</kerning>
<kerning kpx1="89">
<pair kern="-140" kpx2="111"/>
<pair kern="-140" kpx2="45"/>
<pair kern="-20" kpx2="105"/>
<pair kern="-85" kpx2="79"/>
<pair kern="-60" kpx2="58"/>
<pair kern="-140" kpx2="97"/>
<pair kern="-110" kpx2="65"/>
<pair kern="-110" kpx2="117"/>
<pair kern="-140" kpx2="46"/>
<pair kern="-140" kpx2="101"/>
<pair kern="-60" kpx2="59"/>
<pair kern="-140" kpx2="44"/>
</kerning>
<kerning kpx1="121">
<pair kern="-20" kpx2="111"/>
<pair kern="-20" kpx2="97"/>
<pair kern="-100" kpx2="46"/>
<pair kern="-20" kpx2="101"/>
<pair kern="-100" kpx2="44"/>
</kerning>
<kerning kpx1="84">
<pair kern="-120" kpx2="111"/>
<pair kern="-40" kpx2="79"/>
<pair kern="-20" kpx2="58"/>
<pair kern="-120" kpx2="119"/>
<pair kern="-120" kpx2="114"/>
<pair kern="-120" kpx2="44"/>
<pair kern="-20" kpx2="59"/>
<pair kern="-140" kpx2="45"/>
<pair kern="-120" kpx2="65"/>
<pair kern="-120" kpx2="97"/>
<pair kern="-120" kpx2="117"/>
<pair kern="-120" kpx2="121"/>
<pair kern="-120" kpx2="46"/>
<pair kern="-120" kpx2="101"/>
</kerning>
<kerning kpx1="46">
<pair kern="-100" kpx2="148"/>
<pair kern="-60" kpx2="32"/>
<pair kern="-100" kpx2="146"/>
</kerning>
<kerning kpx1="110">
<pair kern="-10" kpx2="117"/>
<pair kern="-15" kpx2="121"/>
<pair kern="-20" kpx2="118"/>
</kerning>
<kerning kpx1="120">
<pair kern="-30" kpx2="101"/>
</kerning>
<kerning kpx1="101">
<pair kern="-20" kpx2="119"/>
<pair kern="-20" kpx2="121"/>
<pair kern="-15" kpx2="46"/>
<pair kern="-30" kpx2="120"/>
<pair kern="-30" kpx2="118"/>
<pair kern="-15" kpx2="44"/>
</kerning>
</font-metrics>
@@ -0,0 +1,564 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- $Id$ -->
<!-- JKT: these metrics in XML were kindly produced by Fotis Jannidis -->
<font-metrics>
<font-name>Helvetica-Bold</font-name>
<full-name>Helvetica Bold</full-name>
<family-name>Helvetica</family-name>
<class-name>HelveticaBold</class-name>
<encoding>StandardEncoding</encoding>
<underline-position>-100</underline-position>
<underline-thickness>50</underline-thickness>
<cap-height>718</cap-height>
<x-height>532</x-height>
<ascender>718</ascender>
<descender>-207</descender>
<first-char>32</first-char>
<last-char>255</last-char>
<char-metrics>
<char name="A" width="722" llx="20" lly="0" urx="702" ury="718"/>
<char name="AE" width="1000" llx="5" lly="0" urx="954" ury="718"/>
<char name="Aacute" width="722" llx="20" lly="0" urx="702" ury="936"/>
<char name="Acircumflex" width="722" llx="20" lly="0" urx="702" ury="936"/>
<char name="Adieresis" width="722" llx="20" lly="0" urx="702" ury="915"/>
<char name="Agrave" width="722" llx="20" lly="0" urx="702" ury="936"/>
<char name="Aring" width="722" llx="20" lly="0" urx="702" ury="962"/>
<char name="Atilde" width="722" llx="20" lly="0" urx="702" ury="923"/>
<char name="B" width="722" llx="76" lly="0" urx="669" ury="718"/>
<char name="C" width="722" llx="44" lly="-19" urx="684" ury="737"/>
<char name="Ccedilla" width="722" llx="44" lly="-228" urx="684" ury="737"/>
<char name="D" width="722" llx="76" lly="0" urx="685" ury="718"/>
<char name="E" width="667" llx="76" lly="0" urx="621" ury="718"/>
<char name="Eacute" width="667" llx="76" lly="0" urx="621" ury="936"/>
<char name="Ecircumflex" width="667" llx="76" lly="0" urx="621" ury="936"/>
<char name="Edieresis" width="667" llx="76" lly="0" urx="621" ury="915"/>
<char name="Egrave" width="667" llx="76" lly="0" urx="621" ury="936"/>
<char name="Eth" width="722" llx="-5" lly="0" urx="685" ury="718"/>
<char name="Euro" width="556" llx="0" lly="0" urx="0" ury="0"/>
<char name="F" width="611" llx="76" lly="0" urx="587" ury="718"/>
<char name="G" width="778" llx="44" lly="-19" urx="713" ury="737"/>
<char name="H" width="722" llx="71" lly="0" urx="651" ury="718"/>
<char name="I" width="278" llx="64" lly="0" urx="214" ury="718"/>
<char name="Iacute" width="278" llx="64" lly="0" urx="329" ury="936"/>
<char name="Icircumflex" width="278" llx="-37" lly="0" urx="316" ury="936"/>
<char name="Idieresis" width="278" llx="-21" lly="0" urx="300" ury="915"/>
<char name="Igrave" width="278" llx="-50" lly="0" urx="214" ury="936"/>
<char name="J" width="556" llx="22" lly="-18" urx="484" ury="718"/>
<char name="K" width="722" llx="87" lly="0" urx="722" ury="718"/>
<char name="L" width="611" llx="76" lly="0" urx="583" ury="718"/>
<char name="Lslash" width="611" llx="-20" lly="0" urx="583" ury="718"/>
<char name="M" width="833" llx="69" lly="0" urx="765" ury="718"/>
<char name="N" width="722" llx="69" lly="0" urx="654" ury="718"/>
<char name="Ntilde" width="722" llx="69" lly="0" urx="654" ury="923"/>
<char name="O" width="778" llx="44" lly="-19" urx="734" ury="737"/>
<char name="OE" width="1000" llx="37" lly="-19" urx="961" ury="737"/>
<char name="Oacute" width="778" llx="44" lly="-19" urx="734" ury="936"/>
<char name="Ocircumflex" width="778" llx="44" lly="-19" urx="734" ury="936"/>
<char name="Odieresis" width="778" llx="44" lly="-19" urx="734" ury="915"/>
<char name="Ograve" width="778" llx="44" lly="-19" urx="734" ury="936"/>
<char name="Oslash" width="778" llx="33" lly="-27" urx="744" ury="745"/>
<char name="Otilde" width="778" llx="44" lly="-19" urx="734" ury="923"/>
<char name="P" width="667" llx="76" lly="0" urx="627" ury="718"/>
<char name="Q" width="778" llx="44" lly="-52" urx="737" ury="737"/>
<char name="R" width="722" llx="76" lly="0" urx="677" ury="718"/>
<char name="S" width="667" llx="39" lly="-19" urx="629" ury="737"/>
<char name="Scaron" width="667" llx="39" lly="-19" urx="629" ury="936"/>
<char name="T" width="611" llx="14" lly="0" urx="598" ury="718"/>
<char name="Thorn" width="667" llx="76" lly="0" urx="627" ury="718"/>
<char name="U" width="722" llx="72" lly="-19" urx="651" ury="718"/>
<char name="Uacute" width="722" llx="72" lly="-19" urx="651" ury="936"/>
<char name="Ucircumflex" width="722" llx="72" lly="-19" urx="651" ury="936"/>
<char name="Udieresis" width="722" llx="72" lly="-19" urx="651" ury="915"/>
<char name="Ugrave" width="722" llx="72" lly="-19" urx="651" ury="936"/>
<char name="V" width="667" llx="19" lly="0" urx="648" ury="718"/>
<char name="W" width="944" llx="16" lly="0" urx="929" ury="718"/>
<char name="X" width="667" llx="14" lly="0" urx="653" ury="718"/>
<char name="Y" width="667" llx="15" lly="0" urx="653" ury="718"/>
<char name="Yacute" width="667" llx="15" lly="0" urx="653" ury="936"/>
<char name="Ydieresis" width="667" llx="15" lly="0" urx="653" ury="915"/>
<char name="Z" width="611" llx="25" lly="0" urx="586" ury="718"/>
<char name="Zcaron" width="611" llx="25" lly="0" urx="586" ury="936"/>
<char name="a" width="556" llx="29" lly="-14" urx="527" ury="546"/>
<char name="aacute" width="556" llx="29" lly="-14" urx="527" ury="750"/>
<char name="acircumflex" width="556" llx="29" lly="-14" urx="527" ury="750"/>
<char name="acute" width="333" llx="108" lly="604" urx="356" ury="750"/>
<char name="adieresis" width="556" llx="29" lly="-14" urx="527" ury="729"/>
<char name="ae" width="889" llx="29" lly="-14" urx="858" ury="546"/>
<char name="agrave" width="556" llx="29" lly="-14" urx="527" ury="750"/>
<char name="ampersand" width="722" llx="54" lly="-19" urx="701" ury="718"/>
<char name="aring" width="556" llx="29" lly="-14" urx="527" ury="776"/>
<char name="asciicircum" width="584" llx="62" lly="323" urx="522" ury="698"/>
<char name="asciitilde" width="584" llx="61" lly="163" urx="523" ury="343"/>
<char name="asterisk" width="389" llx="27" lly="387" urx="362" ury="718"/>
<char name="at" width="975" llx="118" lly="-19" urx="856" ury="737"/>
<char name="atilde" width="556" llx="29" lly="-14" urx="527" ury="737"/>
<char name="b" width="611" llx="61" lly="-14" urx="578" ury="718"/>
<char name="backslash" width="278" llx="-33" lly="-19" urx="311" ury="737"/>
<char name="bar" width="280" llx="84" lly="-225" urx="196" ury="775"/>
<char name="braceleft" width="389" llx="48" lly="-196" urx="365" ury="722"/>
<char name="braceright" width="389" llx="24" lly="-196" urx="341" ury="722"/>
<char name="bracketleft" width="333" llx="63" lly="-196" urx="309" ury="722"/>
<char name="bracketright" width="333" llx="24" lly="-196" urx="270" ury="722"/>
<char name="breve" width="333" llx="-2" lly="604" urx="335" ury="750"/>
<char name="brokenbar" width="280" llx="84" lly="-150" urx="196" ury="700"/>
<char name="bullet" width="350" llx="10" lly="194" urx="340" ury="524"/>
<char name="c" width="556" llx="34" lly="-14" urx="524" ury="546"/>
<char name="caron" width="333" llx="-10" lly="604" urx="343" ury="750"/>
<char name="ccedilla" width="556" llx="34" lly="-228" urx="524" ury="546"/>
<char name="cedilla" width="333" llx="6" lly="-228" urx="245" ury="0"/>
<char name="cent" width="556" llx="34" lly="-118" urx="524" ury="628"/>
<char name="circumflex" width="333" llx="-10" lly="604" urx="343" ury="750"/>
<char name="colon" width="333" llx="92" lly="0" urx="242" ury="512"/>
<char name="comma" width="278" llx="64" lly="-168" urx="214" ury="146"/>
<char name="copyright" width="737" llx="-11" lly="-19" urx="749" ury="737"/>
<char name="currency" width="556" llx="-3" lly="76" urx="559" ury="636"/>
<char name="d" width="611" llx="34" lly="-14" urx="551" ury="718"/>
<char name="dagger" width="556" llx="36" lly="-171" urx="520" ury="718"/>
<char name="daggerdbl" width="556" llx="36" lly="-171" urx="520" ury="718"/>
<char name="degree" width="400" llx="57" lly="426" urx="343" ury="712"/>
<char name="dieresis" width="333" llx="6" lly="614" urx="327" ury="729"/>
<char name="divide" width="584" llx="40" lly="-42" urx="544" ury="548"/>
<char name="dollar" width="556" llx="30" lly="-115" urx="523" ury="775"/>
<char name="dotaccent" width="333" llx="104" lly="614" urx="230" ury="729"/>
<char name="dotlessi" width="278" llx="69" lly="0" urx="209" ury="532"/>
<char name="e" width="556" llx="23" lly="-14" urx="528" ury="546"/>
<char name="eacute" width="556" llx="23" lly="-14" urx="528" ury="750"/>
<char name="ecircumflex" width="556" llx="23" lly="-14" urx="528" ury="750"/>
<char name="edieresis" width="556" llx="23" lly="-14" urx="528" ury="729"/>
<char name="egrave" width="556" llx="23" lly="-14" urx="528" ury="750"/>
<char name="eight" width="556" llx="32" lly="-19" urx="524" ury="710"/>
<char name="ellipsis" width="1000" llx="92" lly="0" urx="908" ury="146"/>
<char name="emdash" width="1000" llx="0" lly="227" urx="1000" ury="333"/>
<char name="endash" width="556" llx="0" lly="227" urx="556" ury="333"/>
<char name="equal" width="584" llx="40" lly="87" urx="544" ury="419"/>
<char name="eth" width="611" llx="34" lly="-14" urx="578" ury="737"/>
<char name="exclam" width="333" llx="90" lly="0" urx="244" ury="718"/>
<char name="exclamdown" width="333" llx="90" lly="-186" urx="244" ury="532"/>
<char name="f" width="333" llx="10" lly="0" urx="318" ury="727"/>
<char name="fi" width="611" llx="10" lly="0" urx="542" ury="727"/>
<char name="five" width="556" llx="27" lly="-19" urx="516" ury="698"/>
<char name="fl" width="611" llx="10" lly="0" urx="542" ury="727"/>
<char name="florin" width="556" llx="-10" lly="-210" urx="516" ury="737"/>
<char name="four" width="556" llx="27" lly="0" urx="526" ury="710"/>
<char name="fraction" width="167" llx="-170" lly="-19" urx="336" ury="710"/>
<char name="g" width="611" llx="40" lly="-217" urx="553" ury="546"/>
<char name="germandbls" width="611" llx="69" lly="-14" urx="579" ury="731"/>
<char name="grave" width="333" llx="-23" lly="604" urx="225" ury="750"/>
<char name="greater" width="584" llx="38" lly="-8" urx="546" ury="514"/>
<char name="guillemotleft" width="556" llx="88" lly="76" urx="468" ury="484"/>
<char name="guillemotright" width="556" llx="88" lly="76" urx="468" ury="484"/>
<char name="guilsinglleft" width="333" llx="83" lly="76" urx="250" ury="484"/>
<char name="guilsinglright" width="333" llx="83" lly="76" urx="250" ury="484"/>
<char name="h" width="611" llx="65" lly="0" urx="546" ury="718"/>
<char name="hungarumlaut" width="333" llx="9" lly="604" urx="486" ury="750"/>
<char name="hyphen" width="333" llx="27" lly="215" urx="306" ury="345"/>
<char name="i" width="278" llx="69" lly="0" urx="209" ury="725"/>
<char name="iacute" width="278" llx="69" lly="0" urx="329" ury="750"/>
<char name="icircumflex" width="278" llx="-37" lly="0" urx="316" ury="750"/>
<char name="idieresis" width="278" llx="-21" lly="0" urx="300" ury="729"/>
<char name="igrave" width="278" llx="-50" lly="0" urx="209" ury="750"/>
<char name="j" width="278" llx="3" lly="-214" urx="209" ury="725"/>
<char name="k" width="556" llx="69" lly="0" urx="562" ury="718"/>
<char name="l" width="278" llx="69" lly="0" urx="209" ury="718"/>
<char name="less" width="584" llx="38" lly="-8" urx="546" ury="514"/>
<char name="logicalnot" width="584" llx="40" lly="108" urx="544" ury="419"/>
<char name="lslash" width="278" llx="-18" lly="0" urx="296" ury="718"/>
<char name="m" width="889" llx="64" lly="0" urx="826" ury="546"/>
<char name="macron" width="333" llx="-6" lly="604" urx="339" ury="678"/>
<char name="minus" width="324" llx="40" lly="197" urx="544" ury="309"/>
<char name="mu" width="611" llx="66" lly="-207" urx="545" ury="532"/>
<char name="multiply" width="584" llx="40" lly="1" urx="545" ury="505"/>
<char name="n" width="611" llx="65" lly="0" urx="546" ury="546"/>
<char name="nine" width="556" llx="30" lly="-19" urx="522" ury="710"/>
<char name="ntilde" width="611" llx="65" lly="0" urx="546" ury="737"/>
<char name="numbersign" width="556" llx="18" lly="0" urx="538" ury="698"/>
<char name="o" width="611" llx="34" lly="-14" urx="578" ury="546"/>
<char name="oacute" width="611" llx="34" lly="-14" urx="578" ury="750"/>
<char name="ocircumflex" width="611" llx="34" lly="-14" urx="578" ury="750"/>
<char name="odieresis" width="611" llx="34" lly="-14" urx="578" ury="729"/>
<char name="oe" width="944" llx="34" lly="-14" urx="912" ury="546"/>
<char name="ogonek" width="333" llx="71" lly="-228" urx="304" ury="0"/>
<char name="ograve" width="611" llx="34" lly="-14" urx="578" ury="750"/>
<char name="one" width="556" llx="69" lly="0" urx="378" ury="710"/>
<char name="onehalf" width="834" llx="26" lly="-19" urx="794" ury="710"/>
<char name="onequarter" width="834" llx="26" lly="-19" urx="766" ury="710"/>
<char name="onesuperior" width="333" llx="26" lly="283" urx="237" ury="710"/>
<char name="ordfeminine" width="370" llx="22" lly="401" urx="347" ury="737"/>
<char name="ordmasculine" width="365" llx="6" lly="401" urx="360" ury="737"/>
<char name="oslash" width="611" llx="22" lly="-29" urx="589" ury="560"/>
<char name="otilde" width="611" llx="34" lly="-14" urx="578" ury="737"/>
<char name="p" width="611" llx="62" lly="-207" urx="578" ury="546"/>
<char name="paragraph" width="556" llx="-8" lly="-191" urx="539" ury="700"/>
<char name="parenleft" width="333" llx="35" lly="-208" urx="314" ury="734"/>
<char name="parenright" width="333" llx="19" lly="-208" urx="298" ury="734"/>
<char name="percent" width="889" llx="28" lly="-19" urx="861" ury="710"/>
<char name="period" width="278" llx="64" lly="0" urx="214" ury="146"/>
<char name="periodcentered" width="278" llx="58" lly="172" urx="220" ury="334"/>
<char name="perthousand" width="1000" llx="-3" lly="-19" urx="1003" ury="710"/>
<char name="plus" width="584" llx="40" lly="0" urx="544" ury="506"/>
<char name="plusminus" width="584" llx="40" lly="0" urx="544" ury="506"/>
<char name="q" width="611" llx="34" lly="-207" urx="552" ury="546"/>
<char name="question" width="611" llx="60" lly="0" urx="556" ury="727"/>
<char name="questiondown" width="611" llx="55" lly="-195" urx="551" ury="532"/>
<char name="quotedbl" width="474" llx="98" lly="447" urx="376" ury="718"/>
<char name="quotedblbase" width="500" llx="64" lly="-146" urx="436" ury="127"/>
<char name="quotedblleft" width="500" llx="64" lly="454" urx="436" ury="727"/>
<char name="quotedblright" width="500" llx="64" lly="445" urx="436" ury="718"/>
<char name="quoteleft" width="278" llx="69" lly="454" urx="209" ury="727"/>
<char name="quoteright" width="278" llx="69" lly="445" urx="209" ury="718"/>
<char name="quotesinglbase" width="278" llx="69" lly="-146" urx="209" ury="127"/>
<char name="quotesingle" width="238" llx="70" lly="447" urx="168" ury="718"/>
<char name="r" width="389" llx="64" lly="0" urx="373" ury="546"/>
<char name="registered" width="737" llx="-11" lly="-19" urx="748" ury="737"/>
<char name="ring" width="333" llx="59" lly="568" urx="275" ury="776"/>
<char name="s" width="556" llx="30" lly="-14" urx="519" ury="546"/>
<char name="scaron" width="556" llx="30" lly="-14" urx="519" ury="750"/>
<char name="section" width="556" llx="34" lly="-184" urx="522" ury="727"/>
<char name="semicolon" width="333" llx="92" lly="-168" urx="242" ury="512"/>
<char name="seven" width="556" llx="25" lly="0" urx="528" ury="698"/>
<char name="six" width="556" llx="31" lly="-19" urx="520" ury="710"/>
<char name="slash" width="278" llx="-33" lly="-19" urx="311" ury="737"/>
<char name="space" width="278" llx="0" lly="0" urx="0" ury="0"/>
<!-- JKT: the following has been manually added -->
<char name="sterling" width="556" llx="28" lly="-16" urx="541" ury="718"/>
<char name="t" width="333" llx="10" lly="-6" urx="309" ury="676"/>
<char name="thorn" width="611" llx="62" lly="-208" urx="578" ury="718"/>
<char name="three" width="556" llx="27" lly="-19" urx="516" ury="710"/>
<char name="threequarters" width="834" llx="16" lly="-19" urx="799" ury="710"/>
<char name="threesuperior" width="333" llx="8" lly="271" urx="326" ury="710"/>
<char name="tilde" width="333" llx="-17" lly="610" urx="350" ury="737"/>
<char name="trademark" width="1000" llx="44" lly="306" urx="956" ury="718"/>
<char name="two" width="556" llx="26" lly="0" urx="511" ury="710"/>
<char name="twosuperior" width="333" llx="9" lly="283" urx="324" ury="710"/>
<char name="u" width="611" llx="66" lly="-14" urx="545" ury="532"/>
<char name="uacute" width="611" llx="66" lly="-14" urx="545" ury="750"/>
<char name="ucircumflex" width="611" llx="66" lly="-14" urx="545" ury="750"/>
<char name="udieresis" width="611" llx="66" lly="-14" urx="545" ury="729"/>
<char name="ugrave" width="611" llx="66" lly="-14" urx="545" ury="750"/>
<char name="underscore" width="556" llx="0" lly="-125" urx="556" ury="-75"/>
<char name="v" width="556" llx="13" lly="0" urx="543" ury="532"/>
<char name="w" width="778" llx="10" lly="0" urx="769" ury="532"/>
<char name="x" width="556" llx="15" lly="0" urx="541" ury="532"/>
<char name="y" width="556" llx="10" lly="-214" urx="539" ury="532"/>
<char name="yacute" width="556" llx="10" lly="-214" urx="539" ury="750"/>
<char name="ydieresis" width="556" llx="10" lly="-214" urx="539" ury="729"/>
<char name="yen" width="556" llx="-9" lly="0" urx="565" ury="698"/>
<char name="z" width="500" llx="20" lly="0" urx="480" ury="532"/>
<char name="zcaron" width="500" llx="20" lly="0" urx="480" ury="750"/>
<char name="zero" width="556" llx="32" lly="-19" urx="524" ury="710"/>
</char-metrics>
<kerning kpx1="107">
<pair kern="-15" kpx2="111"/>
</kerning>
<kerning kpx1="79">
<pair kern="-50" kpx2="65"/>
<pair kern="-50" kpx2="87"/>
<pair kern="-70" kpx2="89"/>
<pair kern="-40" kpx2="84"/>
<pair kern="-40" kpx2="46"/>
<pair kern="-50" kpx2="86"/>
<pair kern="-50" kpx2="88"/>
<pair kern="-40" kpx2="44"/>
</kerning>
<kerning kpx1="104">
<pair kern="-20" kpx2="121"/>
</kerning>
<kerning kpx1="99">
<pair kern="-20" kpx2="107"/>
<pair kern="-10" kpx2="104"/>
<pair kern="-10" kpx2="121"/>
<pair kern="-20" kpx2="108"/>
</kerning>
<kerning kpx1="87">
<pair kern="-60" kpx2="111"/>
<pair kern="-40" kpx2="45"/>
<pair kern="-20" kpx2="79"/>
<pair kern="-10" kpx2="58"/>
<pair kern="-40" kpx2="97"/>
<pair kern="-60" kpx2="65"/>
<pair kern="-45" kpx2="117"/>
<pair kern="-20" kpx2="121"/>
<pair kern="-80" kpx2="46"/>
<pair kern="-35" kpx2="101"/>
<pair kern="-10" kpx2="59"/>
<pair kern="-80" kpx2="44"/>
</kerning>
<kerning kpx1="112">
<pair kern="-15" kpx2="121"/>
</kerning>
<kerning kpx1="80">
<pair kern="-40" kpx2="111"/>
<pair kern="-30" kpx2="97"/>
<pair kern="-100" kpx2="65"/>
<pair kern="-120" kpx2="46"/>
<pair kern="-30" kpx2="101"/>
<pair kern="-120" kpx2="44"/>
</kerning>
<kerning kpx1="86">
<pair kern="-90" kpx2="111"/>
<pair kern="-80" kpx2="45"/>
<pair kern="-50" kpx2="79"/>
<pair kern="-40" kpx2="58"/>
<pair kern="-60" kpx2="97"/>
<pair kern="-80" kpx2="65"/>
<pair kern="-60" kpx2="117"/>
<pair kern="-120" kpx2="46"/>
<pair kern="-50" kpx2="71"/>
<pair kern="-50" kpx2="101"/>
<pair kern="-40" kpx2="59"/>
<pair kern="-120" kpx2="44"/>
</kerning>
<kerning kpx1="59">
<pair kern="-40" kpx2="32"/>
</kerning>
<kerning kpx1="118">
<pair kern="-30" kpx2="111"/>
<pair kern="-20" kpx2="97"/>
<pair kern="-80" kpx2="46"/>
<pair kern="-80" kpx2="44"/>
</kerning>
<kerning kpx1="32">
<pair kern="-80" kpx2="87"/>
<pair kern="-80" kpx2="147"/>
<pair kern="-120" kpx2="89"/>
<pair kern="-100" kpx2="84"/>
<pair kern="-60" kpx2="145"/>
<pair kern="-80" kpx2="86"/>
</kerning>
<kerning kpx1="97">
<pair kern="-15" kpx2="119"/>
<pair kern="-20" kpx2="121"/>
<pair kern="-10" kpx2="103"/>
<pair kern="-15" kpx2="118"/>
</kerning>
<kerning kpx1="65">
<pair kern="-40" kpx2="79"/>
<pair kern="-30" kpx2="119"/>
<pair kern="-60" kpx2="87"/>
<pair kern="-40" kpx2="67"/>
<pair kern="-40" kpx2="81"/>
<pair kern="-50" kpx2="71"/>
<pair kern="-80" kpx2="86"/>
<pair kern="-40" kpx2="118"/>
<pair kern="-50" kpx2="85"/>
<pair kern="-30" kpx2="117"/>
<pair kern="-110" kpx2="89"/>
<pair kern="-90" kpx2="84"/>
<pair kern="-30" kpx2="121"/>
</kerning>
<kerning kpx1="70">
<pair kern="-20" kpx2="97"/>
<pair kern="-80" kpx2="65"/>
<pair kern="-100" kpx2="46"/>
<pair kern="-100" kpx2="44"/>
</kerning>
<kerning kpx1="85">
<pair kern="-50" kpx2="65"/>
<pair kern="-30" kpx2="46"/>
<pair kern="-30" kpx2="44"/>
</kerning>
<kerning kpx1="115">
<pair kern="-15" kpx2="119"/>
</kerning>
<kerning kpx1="111">
<pair kern="-15" kpx2="119"/>
<pair kern="-20" kpx2="121"/>
<pair kern="-30" kpx2="120"/>
<pair kern="-20" kpx2="118"/>
</kerning>
<kerning kpx1="122">
<pair kern="10" kpx2="101"/>
</kerning>
<kerning kpx1="100">
<pair kern="-10" kpx2="100"/>
<pair kern="-15" kpx2="119"/>
<pair kern="-15" kpx2="121"/>
<pair kern="-15" kpx2="118"/>
</kerning>
<kerning kpx1="68">
<pair kern="-40" kpx2="65"/>
<pair kern="-40" kpx2="87"/>
<pair kern="-70" kpx2="89"/>
<pair kern="-30" kpx2="46"/>
<pair kern="-40" kpx2="86"/>
<pair kern="-30" kpx2="44"/>
</kerning>
<kerning kpx1="146">
<pair kern="-80" kpx2="100"/>
<pair kern="-80" kpx2="32"/>
<pair kern="-46" kpx2="146"/>
<pair kern="-40" kpx2="114"/>
<pair kern="-20" kpx2="108"/>
<pair kern="-60" kpx2="115"/>
<pair kern="-20" kpx2="118"/>
</kerning>
<kerning kpx1="82">
<pair kern="-20" kpx2="79"/>
<pair kern="-40" kpx2="87"/>
<pair kern="-20" kpx2="85"/>
<pair kern="-50" kpx2="89"/>
<pair kern="-20" kpx2="84"/>
<pair kern="-50" kpx2="86"/>
</kerning>
<kerning kpx1="75">
<pair kern="-35" kpx2="111"/>
<pair kern="-30" kpx2="79"/>
<pair kern="-30" kpx2="117"/>
<pair kern="-40" kpx2="121"/>
<pair kern="-15" kpx2="101"/>
</kerning>
<kerning kpx1="58">
<pair kern="-40" kpx2="32"/>
</kerning>
<kerning kpx1="119">
<pair kern="-20" kpx2="111"/>
<pair kern="-40" kpx2="46"/>
<pair kern="-40" kpx2="44"/>
</kerning>
<kerning kpx1="114">
<pair kern="-20" kpx2="111"/>
<pair kern="-20" kpx2="100"/>
<pair kern="-20" kpx2="45"/>
<pair kern="-20" kpx2="99"/>
<pair kern="20" kpx2="116"/>
<pair kern="10" kpx2="121"/>
<pair kern="-60" kpx2="46"/>
<pair kern="-15" kpx2="103"/>
<pair kern="-20" kpx2="113"/>
<pair kern="-15" kpx2="115"/>
<pair kern="10" kpx2="118"/>
<pair kern="-60" kpx2="44"/>
</kerning>
<kerning kpx1="145">
<pair kern="-46" kpx2="145"/>
</kerning>
<kerning kpx1="108">
<pair kern="-15" kpx2="119"/>
<pair kern="-15" kpx2="121"/>
</kerning>
<kerning kpx1="103">
<pair kern="-10" kpx2="103"/>
<pair kern="10" kpx2="101"/>
</kerning>
<kerning kpx1="66">
<pair kern="-30" kpx2="65"/>
<pair kern="-10" kpx2="85"/>
</kerning>
<kerning kpx1="98">
<pair kern="-20" kpx2="117"/>
<pair kern="-20" kpx2="121"/>
<pair kern="-10" kpx2="108"/>
<pair kern="-20" kpx2="118"/>
</kerning>
<kerning kpx1="76">
<pair kern="-140" kpx2="148"/>
<pair kern="-140" kpx2="146"/>
<pair kern="-80" kpx2="87"/>
<pair kern="-120" kpx2="89"/>
<pair kern="-30" kpx2="121"/>
<pair kern="-90" kpx2="84"/>
<pair kern="-110" kpx2="86"/>
</kerning>
<kerning kpx1="81">
<pair kern="-10" kpx2="85"/>
<pair kern="20" kpx2="46"/>
<pair kern="20" kpx2="44"/>
</kerning>
<kerning kpx1="44">
<pair kern="-120" kpx2="148"/>
<pair kern="-40" kpx2="32"/>
<pair kern="-120" kpx2="146"/>
</kerning>
<kerning kpx1="148">
<pair kern="-80" kpx2="32"/>
</kerning>
<kerning kpx1="109">
<pair kern="-20" kpx2="117"/>
<pair kern="-30" kpx2="121"/>
</kerning>
<kerning kpx1="102">
<pair kern="30" kpx2="148"/>
<pair kern="-20" kpx2="111"/>
<pair kern="30" kpx2="146"/>
<pair kern="-10" kpx2="46"/>
<pair kern="-10" kpx2="101"/>
<pair kern="-10" kpx2="44"/>
</kerning>
<kerning kpx1="74">
<pair kern="-20" kpx2="65"/>
<pair kern="-20" kpx2="117"/>
<pair kern="-20" kpx2="46"/>
<pair kern="-20" kpx2="44"/>
</kerning>
<kerning kpx1="89">
<pair kern="-100" kpx2="111"/>
<pair kern="-70" kpx2="79"/>
<pair kern="-50" kpx2="58"/>
<pair kern="-90" kpx2="97"/>
<pair kern="-110" kpx2="65"/>
<pair kern="-100" kpx2="117"/>
<pair kern="-100" kpx2="46"/>
<pair kern="-80" kpx2="101"/>
<pair kern="-50" kpx2="59"/>
<pair kern="-100" kpx2="44"/>
</kerning>
<kerning kpx1="84">
<pair kern="-80" kpx2="111"/>
<pair kern="-40" kpx2="79"/>
<pair kern="-40" kpx2="58"/>
<pair kern="-60" kpx2="119"/>
<pair kern="-80" kpx2="114"/>
<pair kern="-80" kpx2="44"/>
<pair kern="-40" kpx2="59"/>
<pair kern="-120" kpx2="45"/>
<pair kern="-90" kpx2="65"/>
<pair kern="-80" kpx2="97"/>
<pair kern="-90" kpx2="117"/>
<pair kern="-60" kpx2="121"/>
<pair kern="-80" kpx2="46"/>
<pair kern="-60" kpx2="101"/>
</kerning>
<kerning kpx1="121">
<pair kern="-25" kpx2="111"/>
<pair kern="-30" kpx2="97"/>
<pair kern="-80" kpx2="46"/>
<pair kern="-10" kpx2="101"/>
<pair kern="-80" kpx2="44"/>
</kerning>
<kerning kpx1="46">
<pair kern="-120" kpx2="148"/>
<pair kern="-40" kpx2="32"/>
<pair kern="-120" kpx2="146"/>
</kerning>
<kerning kpx1="110">
<pair kern="-10" kpx2="117"/>
<pair kern="-20" kpx2="121"/>
<pair kern="-40" kpx2="118"/>
</kerning>
<kerning kpx1="120">
<pair kern="-10" kpx2="101"/>
</kerning>
<kerning kpx1="101">
<pair kern="-15" kpx2="119"/>
<pair kern="-15" kpx2="121"/>
<pair kern="20" kpx2="46"/>
<pair kern="-15" kpx2="120"/>
<pair kern="-15" kpx2="118"/>
<pair kern="10" kpx2="44"/>
</kerning>
</font-metrics>
@@ -0,0 +1,564 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- $Id$ -->
<!-- JKT: these metrics in XML were kindly produced by Fotis Jannidis -->
<font-metrics>
<font-name>Helvetica-BoldOblique</font-name>
<full-name>Helvetica Bold Oblique</full-name>
<family-name>Helvetica</family-name>
<class-name>HelveticaBoldOblique</class-name>
<encoding>StandardEncoding</encoding>
<underline-position>-100</underline-position>
<underline-thickness>50</underline-thickness>
<cap-height>718</cap-height>
<x-height>532</x-height>
<ascender>718</ascender>
<descender>-207</descender>
<first-char>32</first-char>
<last-char>255</last-char>
<char-metrics>
<char name="A" width="722" llx="20" lly="0" urx="702" ury="718"/>
<char name="AE" width="1000" llx="5" lly="0" urx="1100" ury="718"/>
<char name="Aacute" width="722" llx="20" lly="0" urx="750" ury="936"/>
<char name="Acircumflex" width="722" llx="20" lly="0" urx="706" ury="936"/>
<char name="Adieresis" width="722" llx="20" lly="0" urx="716" ury="915"/>
<char name="Agrave" width="722" llx="20" lly="0" urx="702" ury="936"/>
<char name="Aring" width="722" llx="20" lly="0" urx="702" ury="962"/>
<char name="Atilde" width="722" llx="20" lly="0" urx="741" ury="923"/>
<char name="B" width="722" llx="76" lly="0" urx="764" ury="718"/>
<char name="C" width="722" llx="107" lly="-19" urx="789" ury="737"/>
<char name="Ccedilla" width="722" llx="107" lly="-228" urx="789" ury="737"/>
<char name="D" width="722" llx="76" lly="0" urx="777" ury="718"/>
<char name="E" width="667" llx="76" lly="0" urx="757" ury="718"/>
<char name="Eacute" width="667" llx="76" lly="0" urx="757" ury="936"/>
<char name="Ecircumflex" width="667" llx="76" lly="0" urx="757" ury="936"/>
<char name="Edieresis" width="667" llx="76" lly="0" urx="757" ury="915"/>
<char name="Egrave" width="667" llx="76" lly="0" urx="757" ury="936"/>
<char name="Eth" width="722" llx="62" lly="0" urx="777" ury="718"/>
<char name="Euro" width="556" llx="0" lly="0" urx="0" ury="0"/>
<char name="F" width="611" llx="76" lly="0" urx="740" ury="718"/>
<char name="G" width="778" llx="108" lly="-19" urx="817" ury="737"/>
<char name="H" width="722" llx="71" lly="0" urx="804" ury="718"/>
<char name="I" width="278" llx="64" lly="0" urx="367" ury="718"/>
<char name="Iacute" width="278" llx="64" lly="0" urx="528" ury="936"/>
<char name="Icircumflex" width="278" llx="64" lly="0" urx="484" ury="936"/>
<char name="Idieresis" width="278" llx="64" lly="0" urx="494" ury="915"/>
<char name="Igrave" width="278" llx="64" lly="0" urx="367" ury="936"/>
<char name="J" width="556" llx="60" lly="-18" urx="637" ury="718"/>
<char name="K" width="722" llx="87" lly="0" urx="858" ury="718"/>
<char name="L" width="611" llx="76" lly="0" urx="611" ury="718"/>
<char name="Lslash" width="611" llx="34" lly="0" urx="611" ury="718"/>
<char name="M" width="833" llx="69" lly="0" urx="918" ury="718"/>
<char name="N" width="722" llx="69" lly="0" urx="807" ury="718"/>
<char name="Ntilde" width="722" llx="69" lly="0" urx="807" ury="923"/>
<char name="O" width="778" llx="107" lly="-19" urx="823" ury="737"/>
<char name="OE" width="1000" llx="99" lly="-19" urx="1114" ury="737"/>
<char name="Oacute" width="778" llx="107" lly="-19" urx="823" ury="936"/>
<char name="Ocircumflex" width="778" llx="107" lly="-19" urx="823" ury="936"/>
<char name="Odieresis" width="778" llx="107" lly="-19" urx="823" ury="915"/>
<char name="Ograve" width="778" llx="107" lly="-19" urx="823" ury="936"/>
<char name="Oslash" width="778" llx="35" lly="-27" urx="894" ury="745"/>
<char name="Otilde" width="778" llx="107" lly="-19" urx="823" ury="923"/>
<char name="P" width="667" llx="76" lly="0" urx="738" ury="718"/>
<char name="Q" width="778" llx="107" lly="-52" urx="823" ury="737"/>
<char name="R" width="722" llx="76" lly="0" urx="778" ury="718"/>
<char name="S" width="667" llx="81" lly="-19" urx="718" ury="737"/>
<char name="Scaron" width="667" llx="81" lly="-19" urx="718" ury="936"/>
<char name="T" width="611" llx="140" lly="0" urx="751" ury="718"/>
<char name="Thorn" width="667" llx="76" lly="0" urx="716" ury="718"/>
<char name="U" width="722" llx="116" lly="-19" urx="804" ury="718"/>
<char name="Uacute" width="722" llx="116" lly="-19" urx="804" ury="936"/>
<char name="Ucircumflex" width="722" llx="116" lly="-19" urx="804" ury="936"/>
<char name="Udieresis" width="722" llx="116" lly="-19" urx="804" ury="915"/>
<char name="Ugrave" width="722" llx="116" lly="-19" urx="804" ury="936"/>
<char name="V" width="667" llx="172" lly="0" urx="801" ury="718"/>
<char name="W" width="944" llx="169" lly="0" urx="1082" ury="718"/>
<char name="X" width="667" llx="14" lly="0" urx="791" ury="718"/>
<char name="Y" width="667" llx="168" lly="0" urx="806" ury="718"/>
<char name="Yacute" width="667" llx="168" lly="0" urx="806" ury="936"/>
<char name="Ydieresis" width="667" llx="168" lly="0" urx="806" ury="915"/>
<char name="Z" width="611" llx="25" lly="0" urx="737" ury="718"/>
<char name="Zcaron" width="611" llx="25" lly="0" urx="737" ury="936"/>
<char name="a" width="556" llx="55" lly="-14" urx="583" ury="546"/>
<char name="aacute" width="556" llx="55" lly="-14" urx="627" ury="750"/>
<char name="acircumflex" width="556" llx="55" lly="-14" urx="583" ury="750"/>
<char name="acute" width="333" llx="236" lly="604" urx="515" ury="750"/>
<char name="adieresis" width="556" llx="55" lly="-14" urx="594" ury="729"/>
<char name="ae" width="889" llx="56" lly="-14" urx="923" ury="546"/>
<char name="agrave" width="556" llx="55" lly="-14" urx="583" ury="750"/>
<char name="ampersand" width="722" llx="89" lly="-19" urx="732" ury="718"/>
<char name="aring" width="556" llx="55" lly="-14" urx="583" ury="776"/>
<char name="asciicircum" width="584" llx="131" lly="323" urx="591" ury="698"/>
<char name="asciitilde" width="584" llx="115" lly="163" urx="577" ury="343"/>
<char name="asterisk" width="389" llx="146" lly="387" urx="481" ury="718"/>
<char name="at" width="975" llx="186" lly="-19" urx="954" ury="737"/>
<char name="atilde" width="556" llx="55" lly="-14" urx="619" ury="737"/>
<char name="b" width="611" llx="61" lly="-14" urx="645" ury="718"/>
<char name="backslash" width="278" llx="124" lly="-19" urx="307" ury="737"/>
<char name="bar" width="280" llx="36" lly="-225" urx="361" ury="775"/>
<char name="braceleft" width="389" llx="94" lly="-196" urx="518" ury="722"/>
<char name="braceright" width="389" llx="-18" lly="-196" urx="407" ury="722"/>
<char name="bracketleft" width="333" llx="21" lly="-196" urx="462" ury="722"/>
<char name="bracketright" width="333" llx="-18" lly="-196" urx="423" ury="722"/>
<char name="breve" width="333" llx="156" lly="604" urx="494" ury="750"/>
<char name="brokenbar" width="280" llx="52" lly="-150" urx="345" ury="700"/>
<char name="bullet" width="350" llx="83" lly="194" urx="420" ury="524"/>
<char name="c" width="556" llx="79" lly="-14" urx="599" ury="546"/>
<char name="caron" width="333" llx="149" lly="604" urx="502" ury="750"/>
<char name="ccedilla" width="556" llx="79" lly="-228" urx="599" ury="546"/>
<char name="cedilla" width="333" llx="-37" lly="-228" urx="220" ury="0"/>
<char name="cent" width="556" llx="79" lly="-118" urx="599" ury="628"/>
<char name="circumflex" width="333" llx="118" lly="604" urx="471" ury="750"/>
<char name="colon" width="333" llx="92" lly="0" urx="351" ury="512"/>
<char name="comma" width="278" llx="28" lly="-168" urx="245" ury="146"/>
<char name="copyright" width="737" llx="56" lly="-19" urx="835" ury="737"/>
<char name="currency" width="556" llx="27" lly="76" urx="680" ury="636"/>
<char name="d" width="611" llx="82" lly="-14" urx="704" ury="718"/>
<char name="dagger" width="556" llx="118" lly="-171" urx="626" ury="718"/>
<char name="daggerdbl" width="556" llx="46" lly="-171" urx="628" ury="718"/>
<char name="degree" width="400" llx="175" lly="426" urx="467" ury="712"/>
<char name="dieresis" width="333" llx="137" lly="614" urx="482" ury="729"/>
<char name="divide" width="584" llx="82" lly="-42" urx="610" ury="548"/>
<char name="dollar" width="556" llx="67" lly="-115" urx="622" ury="775"/>
<char name="dotaccent" width="333" llx="235" lly="614" urx="385" ury="729"/>
<char name="dotlessi" width="278" llx="69" lly="0" urx="322" ury="532"/>
<char name="e" width="556" llx="70" lly="-14" urx="593" ury="546"/>
<char name="eacute" width="556" llx="70" lly="-14" urx="627" ury="750"/>
<char name="ecircumflex" width="556" llx="70" lly="-14" urx="593" ury="750"/>
<char name="edieresis" width="556" llx="70" lly="-14" urx="594" ury="729"/>
<char name="egrave" width="556" llx="70" lly="-14" urx="593" ury="750"/>
<char name="eight" width="556" llx="69" lly="-19" urx="616" ury="710"/>
<char name="ellipsis" width="1000" llx="92" lly="0" urx="939" ury="146"/>
<char name="emdash" width="1000" llx="48" lly="227" urx="1071" ury="333"/>
<char name="endash" width="556" llx="48" lly="227" urx="627" ury="333"/>
<char name="equal" width="584" llx="58" lly="87" urx="633" ury="419"/>
<char name="eth" width="611" llx="82" lly="-14" urx="670" ury="737"/>
<char name="exclam" width="333" llx="94" lly="0" urx="397" ury="718"/>
<char name="exclamdown" width="333" llx="50" lly="-186" urx="353" ury="532"/>
<char name="f" width="333" llx="87" lly="0" urx="469" ury="727"/>
<char name="fi" width="611" llx="87" lly="0" urx="696" ury="727"/>
<char name="five" width="556" llx="64" lly="-19" urx="636" ury="698"/>
<char name="fl" width="611" llx="87" lly="0" urx="695" ury="727"/>
<char name="florin" width="556" llx="-50" lly="-210" urx="669" ury="737"/>
<char name="four" width="556" llx="60" lly="0" urx="598" ury="710"/>
<char name="fraction" width="167" llx="-174" lly="-19" urx="487" ury="710"/>
<char name="g" width="611" llx="38" lly="-217" urx="666" ury="546"/>
<char name="germandbls" width="611" llx="69" lly="-14" urx="657" ury="731"/>
<char name="grave" width="333" llx="136" lly="604" urx="353" ury="750"/>
<char name="greater" width="584" llx="36" lly="-8" urx="609" ury="514"/>
<char name="guillemotleft" width="556" llx="135" lly="76" urx="571" ury="484"/>
<char name="guillemotright" width="556" llx="104" lly="76" urx="540" ury="484"/>
<char name="guilsinglleft" width="333" llx="130" lly="76" urx="353" ury="484"/>
<char name="guilsinglright" width="333" llx="99" lly="76" urx="322" ury="484"/>
<char name="h" width="611" llx="65" lly="0" urx="629" ury="718"/>
<char name="hungarumlaut" width="333" llx="137" lly="604" urx="645" ury="750"/>
<char name="hyphen" width="333" llx="73" lly="215" urx="379" ury="345"/>
<char name="i" width="278" llx="69" lly="0" urx="363" ury="725"/>
<char name="iacute" width="278" llx="69" lly="0" urx="488" ury="750"/>
<char name="icircumflex" width="278" llx="69" lly="0" urx="444" ury="750"/>
<char name="idieresis" width="278" llx="69" lly="0" urx="455" ury="729"/>
<char name="igrave" width="278" llx="69" lly="0" urx="326" ury="750"/>
<char name="j" width="278" llx="-42" lly="-214" urx="363" ury="725"/>
<char name="k" width="556" llx="69" lly="0" urx="670" ury="718"/>
<char name="l" width="278" llx="69" lly="0" urx="362" ury="718"/>
<char name="less" width="584" llx="82" lly="-8" urx="655" ury="514"/>
<char name="logicalnot" width="584" llx="105" lly="108" urx="633" ury="419"/>
<char name="lslash" width="278" llx="40" lly="0" urx="407" ury="718"/>
<char name="m" width="889" llx="64" lly="0" urx="909" ury="546"/>
<char name="macron" width="333" llx="122" lly="604" urx="483" ury="678"/>
<char name="minus" width="324" llx="82" lly="197" urx="610" ury="309"/>
<char name="mu" width="611" llx="22" lly="-207" urx="658" ury="532"/>
<char name="multiply" width="584" llx="57" lly="1" urx="635" ury="505"/>
<char name="n" width="611" llx="65" lly="0" urx="629" ury="546"/>
<char name="nine" width="556" llx="78" lly="-19" urx="615" ury="710"/>
<char name="ntilde" width="611" llx="65" lly="0" urx="646" ury="737"/>
<char name="numbersign" width="556" llx="60" lly="0" urx="644" ury="698"/>
<char name="o" width="611" llx="82" lly="-14" urx="643" ury="546"/>
<char name="oacute" width="611" llx="82" lly="-14" urx="654" ury="750"/>
<char name="ocircumflex" width="611" llx="82" lly="-14" urx="643" ury="750"/>
<char name="odieresis" width="611" llx="82" lly="-14" urx="643" ury="729"/>
<char name="oe" width="944" llx="82" lly="-14" urx="977" ury="546"/>
<char name="ogonek" width="333" llx="41" lly="-228" urx="264" ury="0"/>
<char name="ograve" width="611" llx="82" lly="-14" urx="643" ury="750"/>
<char name="one" width="556" llx="173" lly="0" urx="529" ury="710"/>
<char name="onehalf" width="834" llx="132" lly="-19" urx="858" ury="710"/>
<char name="onequarter" width="834" llx="132" lly="-19" urx="806" ury="710"/>
<char name="onesuperior" width="333" llx="148" lly="283" urx="388" ury="710"/>
<char name="ordfeminine" width="370" llx="125" lly="401" urx="465" ury="737"/>
<char name="ordmasculine" width="365" llx="123" lly="401" urx="485" ury="737"/>
<char name="oslash" width="611" llx="22" lly="-29" urx="701" ury="560"/>
<char name="otilde" width="611" llx="82" lly="-14" urx="646" ury="737"/>
<char name="p" width="611" llx="18" lly="-207" urx="645" ury="546"/>
<char name="paragraph" width="556" llx="98" lly="-191" urx="688" ury="700"/>
<char name="parenleft" width="333" llx="76" lly="-208" urx="470" ury="734"/>
<char name="parenright" width="333" llx="-25" lly="-208" urx="369" ury="734"/>
<char name="percent" width="889" llx="136" lly="-19" urx="901" ury="710"/>
<char name="period" width="278" llx="64" lly="0" urx="245" ury="146"/>
<char name="periodcentered" width="278" llx="110" lly="172" urx="276" ury="334"/>
<char name="perthousand" width="1000" llx="76" lly="-19" urx="1038" ury="710"/>
<char name="plus" width="584" llx="82" lly="0" urx="610" ury="506"/>
<char name="plusminus" width="584" llx="40" lly="0" urx="625" ury="506"/>
<char name="q" width="611" llx="80" lly="-207" urx="665" ury="546"/>
<char name="question" width="611" llx="165" lly="0" urx="671" ury="727"/>
<char name="questiondown" width="611" llx="53" lly="-195" urx="559" ury="532"/>
<char name="quotedbl" width="474" llx="193" lly="447" urx="529" ury="718"/>
<char name="quotedblbase" width="500" llx="36" lly="-146" urx="463" ury="127"/>
<char name="quotedblleft" width="500" llx="160" lly="454" urx="588" ury="727"/>
<char name="quotedblright" width="500" llx="162" lly="445" urx="589" ury="718"/>
<char name="quoteleft" width="278" llx="165" lly="454" urx="361" ury="727"/>
<char name="quoteright" width="278" llx="167" lly="445" urx="362" ury="718"/>
<char name="quotesinglbase" width="278" llx="41" lly="-146" urx="236" ury="127"/>
<char name="quotesingle" width="238" llx="165" lly="447" urx="321" ury="718"/>
<char name="r" width="389" llx="64" lly="0" urx="489" ury="546"/>
<char name="registered" width="737" llx="55" lly="-19" urx="834" ury="737"/>
<char name="ring" width="333" llx="200" lly="568" urx="420" ury="776"/>
<char name="s" width="556" llx="63" lly="-14" urx="584" ury="546"/>
<char name="scaron" width="556" llx="63" lly="-14" urx="614" ury="750"/>
<char name="section" width="556" llx="61" lly="-184" urx="598" ury="727"/>
<char name="semicolon" width="333" llx="56" lly="-168" urx="351" ury="512"/>
<char name="seven" width="556" llx="125" lly="0" urx="676" ury="698"/>
<char name="six" width="556" llx="85" lly="-19" urx="619" ury="710"/>
<char name="slash" width="278" llx="-37" lly="-19" urx="468" ury="737"/>
<char name="space" width="278" llx="0" lly="0" urx="0" ury="0"/>
<!-- JKT: the following has been manually added -->
<char name="sterling" width="556" llx="50" lly="-16" urx="635" ury="718"/>
<char name="t" width="333" llx="100" lly="-6" urx="422" ury="676"/>
<char name="thorn" width="611" llx="18" lly="-208" urx="645" ury="718"/>
<char name="three" width="556" llx="65" lly="-19" urx="608" ury="710"/>
<char name="threequarters" width="834" llx="99" lly="-19" urx="839" ury="710"/>
<char name="threesuperior" width="333" llx="91" lly="271" urx="441" ury="710"/>
<char name="tilde" width="333" llx="113" lly="610" urx="507" ury="737"/>
<char name="trademark" width="1000" llx="179" lly="306" urx="1109" ury="718"/>
<char name="two" width="556" llx="26" lly="0" urx="619" ury="710"/>
<char name="twosuperior" width="333" llx="69" lly="283" urx="449" ury="710"/>
<char name="u" width="611" llx="98" lly="-14" urx="658" ury="532"/>
<char name="uacute" width="611" llx="98" lly="-14" urx="658" ury="750"/>
<char name="ucircumflex" width="611" llx="98" lly="-14" urx="658" ury="750"/>
<char name="udieresis" width="611" llx="98" lly="-14" urx="658" ury="729"/>
<char name="ugrave" width="611" llx="98" lly="-14" urx="658" ury="750"/>
<char name="underscore" width="556" llx="-27" lly="-125" urx="540" ury="-75"/>
<char name="v" width="556" llx="126" lly="0" urx="656" ury="532"/>
<char name="w" width="778" llx="123" lly="0" urx="882" ury="532"/>
<char name="x" width="556" llx="15" lly="0" urx="648" ury="532"/>
<char name="y" width="556" llx="42" lly="-214" urx="652" ury="532"/>
<char name="yacute" width="556" llx="42" lly="-214" urx="652" ury="750"/>
<char name="ydieresis" width="556" llx="42" lly="-214" urx="652" ury="729"/>
<char name="yen" width="556" llx="60" lly="0" urx="713" ury="698"/>
<char name="z" width="500" llx="20" lly="0" urx="583" ury="532"/>
<char name="zcaron" width="500" llx="20" lly="0" urx="586" ury="750"/>
<char name="zero" width="556" llx="86" lly="-19" urx="617" ury="710"/>
</char-metrics>
<kerning kpx1="107">
<pair kern="-15" kpx2="111"/>
</kerning>
<kerning kpx1="79">
<pair kern="-50" kpx2="65"/>
<pair kern="-50" kpx2="87"/>
<pair kern="-70" kpx2="89"/>
<pair kern="-40" kpx2="84"/>
<pair kern="-40" kpx2="46"/>
<pair kern="-50" kpx2="86"/>
<pair kern="-50" kpx2="88"/>
<pair kern="-40" kpx2="44"/>
</kerning>
<kerning kpx1="104">
<pair kern="-20" kpx2="121"/>
</kerning>
<kerning kpx1="99">
<pair kern="-20" kpx2="107"/>
<pair kern="-10" kpx2="104"/>
<pair kern="-10" kpx2="121"/>
<pair kern="-20" kpx2="108"/>
</kerning>
<kerning kpx1="87">
<pair kern="-60" kpx2="111"/>
<pair kern="-40" kpx2="45"/>
<pair kern="-20" kpx2="79"/>
<pair kern="-10" kpx2="58"/>
<pair kern="-40" kpx2="97"/>
<pair kern="-60" kpx2="65"/>
<pair kern="-45" kpx2="117"/>
<pair kern="-20" kpx2="121"/>
<pair kern="-80" kpx2="46"/>
<pair kern="-35" kpx2="101"/>
<pair kern="-10" kpx2="59"/>
<pair kern="-80" kpx2="44"/>
</kerning>
<kerning kpx1="112">
<pair kern="-15" kpx2="121"/>
</kerning>
<kerning kpx1="80">
<pair kern="-40" kpx2="111"/>
<pair kern="-30" kpx2="97"/>
<pair kern="-100" kpx2="65"/>
<pair kern="-120" kpx2="46"/>
<pair kern="-30" kpx2="101"/>
<pair kern="-120" kpx2="44"/>
</kerning>
<kerning kpx1="86">
<pair kern="-90" kpx2="111"/>
<pair kern="-80" kpx2="45"/>
<pair kern="-50" kpx2="79"/>
<pair kern="-40" kpx2="58"/>
<pair kern="-60" kpx2="97"/>
<pair kern="-80" kpx2="65"/>
<pair kern="-60" kpx2="117"/>
<pair kern="-120" kpx2="46"/>
<pair kern="-50" kpx2="71"/>
<pair kern="-50" kpx2="101"/>
<pair kern="-40" kpx2="59"/>
<pair kern="-120" kpx2="44"/>
</kerning>
<kerning kpx1="59">
<pair kern="-40" kpx2="32"/>
</kerning>
<kerning kpx1="118">
<pair kern="-30" kpx2="111"/>
<pair kern="-20" kpx2="97"/>
<pair kern="-80" kpx2="46"/>
<pair kern="-80" kpx2="44"/>
</kerning>
<kerning kpx1="32">
<pair kern="-80" kpx2="87"/>
<pair kern="-80" kpx2="147"/>
<pair kern="-120" kpx2="89"/>
<pair kern="-100" kpx2="84"/>
<pair kern="-60" kpx2="145"/>
<pair kern="-80" kpx2="86"/>
</kerning>
<kerning kpx1="97">
<pair kern="-15" kpx2="119"/>
<pair kern="-20" kpx2="121"/>
<pair kern="-10" kpx2="103"/>
<pair kern="-15" kpx2="118"/>
</kerning>
<kerning kpx1="65">
<pair kern="-40" kpx2="79"/>
<pair kern="-30" kpx2="119"/>
<pair kern="-60" kpx2="87"/>
<pair kern="-40" kpx2="67"/>
<pair kern="-40" kpx2="81"/>
<pair kern="-50" kpx2="71"/>
<pair kern="-80" kpx2="86"/>
<pair kern="-40" kpx2="118"/>
<pair kern="-50" kpx2="85"/>
<pair kern="-30" kpx2="117"/>
<pair kern="-110" kpx2="89"/>
<pair kern="-90" kpx2="84"/>
<pair kern="-30" kpx2="121"/>
</kerning>
<kerning kpx1="70">
<pair kern="-20" kpx2="97"/>
<pair kern="-80" kpx2="65"/>
<pair kern="-100" kpx2="46"/>
<pair kern="-100" kpx2="44"/>
</kerning>
<kerning kpx1="85">
<pair kern="-50" kpx2="65"/>
<pair kern="-30" kpx2="46"/>
<pair kern="-30" kpx2="44"/>
</kerning>
<kerning kpx1="115">
<pair kern="-15" kpx2="119"/>
</kerning>
<kerning kpx1="111">
<pair kern="-15" kpx2="119"/>
<pair kern="-20" kpx2="121"/>
<pair kern="-30" kpx2="120"/>
<pair kern="-20" kpx2="118"/>
</kerning>
<kerning kpx1="122">
<pair kern="10" kpx2="101"/>
</kerning>
<kerning kpx1="100">
<pair kern="-10" kpx2="100"/>
<pair kern="-15" kpx2="119"/>
<pair kern="-15" kpx2="121"/>
<pair kern="-15" kpx2="118"/>
</kerning>
<kerning kpx1="68">
<pair kern="-40" kpx2="65"/>
<pair kern="-40" kpx2="87"/>
<pair kern="-70" kpx2="89"/>
<pair kern="-30" kpx2="46"/>
<pair kern="-40" kpx2="86"/>
<pair kern="-30" kpx2="44"/>
</kerning>
<kerning kpx1="146">
<pair kern="-80" kpx2="100"/>
<pair kern="-80" kpx2="32"/>
<pair kern="-46" kpx2="146"/>
<pair kern="-40" kpx2="114"/>
<pair kern="-20" kpx2="108"/>
<pair kern="-60" kpx2="115"/>
<pair kern="-20" kpx2="118"/>
</kerning>
<kerning kpx1="82">
<pair kern="-20" kpx2="79"/>
<pair kern="-40" kpx2="87"/>
<pair kern="-20" kpx2="85"/>
<pair kern="-50" kpx2="89"/>
<pair kern="-20" kpx2="84"/>
<pair kern="-50" kpx2="86"/>
</kerning>
<kerning kpx1="75">
<pair kern="-35" kpx2="111"/>
<pair kern="-30" kpx2="79"/>
<pair kern="-30" kpx2="117"/>
<pair kern="-40" kpx2="121"/>
<pair kern="-15" kpx2="101"/>
</kerning>
<kerning kpx1="58">
<pair kern="-40" kpx2="32"/>
</kerning>
<kerning kpx1="119">
<pair kern="-20" kpx2="111"/>
<pair kern="-40" kpx2="46"/>
<pair kern="-40" kpx2="44"/>
</kerning>
<kerning kpx1="114">
<pair kern="-20" kpx2="111"/>
<pair kern="-20" kpx2="100"/>
<pair kern="-20" kpx2="45"/>
<pair kern="-20" kpx2="99"/>
<pair kern="20" kpx2="116"/>
<pair kern="10" kpx2="121"/>
<pair kern="-60" kpx2="46"/>
<pair kern="-15" kpx2="103"/>
<pair kern="-20" kpx2="113"/>
<pair kern="-15" kpx2="115"/>
<pair kern="10" kpx2="118"/>
<pair kern="-60" kpx2="44"/>
</kerning>
<kerning kpx1="145">
<pair kern="-46" kpx2="145"/>
</kerning>
<kerning kpx1="108">
<pair kern="-15" kpx2="119"/>
<pair kern="-15" kpx2="121"/>
</kerning>
<kerning kpx1="103">
<pair kern="-10" kpx2="103"/>
<pair kern="10" kpx2="101"/>
</kerning>
<kerning kpx1="66">
<pair kern="-30" kpx2="65"/>
<pair kern="-10" kpx2="85"/>
</kerning>
<kerning kpx1="98">
<pair kern="-20" kpx2="117"/>
<pair kern="-20" kpx2="121"/>
<pair kern="-10" kpx2="108"/>
<pair kern="-20" kpx2="118"/>
</kerning>
<kerning kpx1="76">
<pair kern="-140" kpx2="148"/>
<pair kern="-140" kpx2="146"/>
<pair kern="-80" kpx2="87"/>
<pair kern="-120" kpx2="89"/>
<pair kern="-30" kpx2="121"/>
<pair kern="-90" kpx2="84"/>
<pair kern="-110" kpx2="86"/>
</kerning>
<kerning kpx1="81">
<pair kern="-10" kpx2="85"/>
<pair kern="20" kpx2="46"/>
<pair kern="20" kpx2="44"/>
</kerning>
<kerning kpx1="44">
<pair kern="-120" kpx2="148"/>
<pair kern="-40" kpx2="32"/>
<pair kern="-120" kpx2="146"/>
</kerning>
<kerning kpx1="148">
<pair kern="-80" kpx2="32"/>
</kerning>
<kerning kpx1="109">
<pair kern="-20" kpx2="117"/>
<pair kern="-30" kpx2="121"/>
</kerning>
<kerning kpx1="102">
<pair kern="30" kpx2="148"/>
<pair kern="-20" kpx2="111"/>
<pair kern="30" kpx2="146"/>
<pair kern="-10" kpx2="46"/>
<pair kern="-10" kpx2="101"/>
<pair kern="-10" kpx2="44"/>
</kerning>
<kerning kpx1="74">
<pair kern="-20" kpx2="65"/>
<pair kern="-20" kpx2="117"/>
<pair kern="-20" kpx2="46"/>
<pair kern="-20" kpx2="44"/>
</kerning>
<kerning kpx1="89">
<pair kern="-100" kpx2="111"/>
<pair kern="-70" kpx2="79"/>
<pair kern="-50" kpx2="58"/>
<pair kern="-90" kpx2="97"/>
<pair kern="-110" kpx2="65"/>
<pair kern="-100" kpx2="117"/>
<pair kern="-100" kpx2="46"/>
<pair kern="-80" kpx2="101"/>
<pair kern="-50" kpx2="59"/>
<pair kern="-100" kpx2="44"/>
</kerning>
<kerning kpx1="84">
<pair kern="-80" kpx2="111"/>
<pair kern="-40" kpx2="79"/>
<pair kern="-40" kpx2="58"/>
<pair kern="-60" kpx2="119"/>
<pair kern="-80" kpx2="114"/>
<pair kern="-80" kpx2="44"/>
<pair kern="-40" kpx2="59"/>
<pair kern="-120" kpx2="45"/>
<pair kern="-90" kpx2="65"/>
<pair kern="-80" kpx2="97"/>
<pair kern="-90" kpx2="117"/>
<pair kern="-60" kpx2="121"/>
<pair kern="-80" kpx2="46"/>
<pair kern="-60" kpx2="101"/>
</kerning>
<kerning kpx1="121">
<pair kern="-25" kpx2="111"/>
<pair kern="-30" kpx2="97"/>
<pair kern="-80" kpx2="46"/>
<pair kern="-10" kpx2="101"/>
<pair kern="-80" kpx2="44"/>
</kerning>
<kerning kpx1="46">
<pair kern="-120" kpx2="148"/>
<pair kern="-40" kpx2="32"/>
<pair kern="-120" kpx2="146"/>
</kerning>
<kerning kpx1="110">
<pair kern="-10" kpx2="117"/>
<pair kern="-20" kpx2="121"/>
<pair kern="-40" kpx2="118"/>
</kerning>
<kerning kpx1="120">
<pair kern="-10" kpx2="101"/>
</kerning>
<kerning kpx1="101">
<pair kern="-15" kpx2="119"/>
<pair kern="-15" kpx2="121"/>
<pair kern="20" kpx2="46"/>
<pair kern="-15" kpx2="120"/>
<pair kern="-15" kpx2="118"/>
<pair kern="10" kpx2="44"/>
</kerning>
</font-metrics>
@@ -0,0 +1,606 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- $Id$ -->
<!-- JKT: these metrics in XML were kindly produced by Fotis Jannidis -->
<font-metrics>
<font-name>Helvetica-Oblique</font-name>
<full-name>Helvetica Oblique</full-name>
<family-name>Helvetica</family-name>
<class-name>HelveticaOblique</class-name>
<encoding>StandardEncoding</encoding>
<underline-position>-100</underline-position>
<underline-thickness>50</underline-thickness>
<cap-height>718</cap-height>
<x-height>523</x-height>
<ascender>718</ascender>
<descender>-207</descender>
<first-char>32</first-char>
<last-char>255</last-char>
<char-metrics>
<char name="A" width="667" llx="14" lly="0" urx="654" ury="718"/>
<char name="AE" width="1000" llx="8" lly="0" urx="1097" ury="718"/>
<char name="Aacute" width="667" llx="14" lly="0" urx="683" ury="929"/>
<char name="Acircumflex" width="667" llx="14" lly="0" urx="654" ury="929"/>
<char name="Adieresis" width="667" llx="14" lly="0" urx="654" ury="901"/>
<char name="Agrave" width="667" llx="14" lly="0" urx="654" ury="929"/>
<char name="Aring" width="667" llx="14" lly="0" urx="654" ury="931"/>
<char name="Atilde" width="667" llx="14" lly="0" urx="699" ury="917"/>
<char name="B" width="667" llx="74" lly="0" urx="712" ury="718"/>
<char name="C" width="722" llx="108" lly="-19" urx="782" ury="737"/>
<char name="Ccedilla" width="722" llx="108" lly="-225" urx="782" ury="737"/>
<char name="D" width="722" llx="81" lly="0" urx="764" ury="718"/>
<char name="E" width="667" llx="86" lly="0" urx="762" ury="718"/>
<char name="Eacute" width="667" llx="86" lly="0" urx="762" ury="929"/>
<char name="Ecircumflex" width="667" llx="86" lly="0" urx="762" ury="929"/>
<char name="Edieresis" width="667" llx="86" lly="0" urx="762" ury="901"/>
<char name="Egrave" width="667" llx="86" lly="0" urx="762" ury="929"/>
<char name="Eth" width="722" llx="69" lly="0" urx="764" ury="718"/>
<char name="Euro" width="556" llx="0" lly="0" urx="0" ury="0"/>
<char name="F" width="611" llx="86" lly="0" urx="736" ury="718"/>
<char name="G" width="778" llx="111" lly="-19" urx="799" ury="737"/>
<char name="H" width="722" llx="77" lly="0" urx="799" ury="718"/>
<char name="I" width="278" llx="91" lly="0" urx="341" ury="718"/>
<char name="Iacute" width="278" llx="91" lly="0" urx="489" ury="929"/>
<char name="Icircumflex" width="278" llx="91" lly="0" urx="452" ury="929"/>
<char name="Idieresis" width="278" llx="91" lly="0" urx="458" ury="901"/>
<char name="Igrave" width="278" llx="91" lly="0" urx="351" ury="929"/>
<char name="J" width="500" llx="47" lly="-19" urx="581" ury="718"/>
<char name="K" width="667" llx="76" lly="0" urx="808" ury="718"/>
<char name="L" width="556" llx="76" lly="0" urx="555" ury="718"/>
<char name="Lslash" width="556" llx="41" lly="0" urx="555" ury="718"/>
<char name="M" width="833" llx="73" lly="0" urx="914" ury="718"/>
<char name="N" width="722" llx="76" lly="0" urx="799" ury="718"/>
<char name="Ntilde" width="722" llx="76" lly="0" urx="799" ury="917"/>
<char name="O" width="778" llx="105" lly="-19" urx="826" ury="737"/>
<char name="OE" width="1000" llx="98" lly="-19" urx="1116" ury="737"/>
<char name="Oacute" width="778" llx="105" lly="-19" urx="826" ury="929"/>
<char name="Ocircumflex" width="778" llx="105" lly="-19" urx="826" ury="929"/>
<char name="Odieresis" width="778" llx="105" lly="-19" urx="826" ury="901"/>
<char name="Ograve" width="778" llx="105" lly="-19" urx="826" ury="929"/>
<char name="Oslash" width="778" llx="43" lly="-19" urx="890" ury="737"/>
<char name="Otilde" width="778" llx="105" lly="-19" urx="826" ury="917"/>
<char name="P" width="667" llx="86" lly="0" urx="737" ury="718"/>
<char name="Q" width="778" llx="105" lly="-56" urx="826" ury="737"/>
<char name="R" width="722" llx="88" lly="0" urx="773" ury="718"/>
<char name="S" width="667" llx="90" lly="-19" urx="713" ury="737"/>
<char name="Scaron" width="667" llx="90" lly="-19" urx="713" ury="929"/>
<char name="T" width="611" llx="148" lly="0" urx="750" ury="718"/>
<char name="Thorn" width="667" llx="86" lly="0" urx="712" ury="718"/>
<char name="U" width="722" llx="123" lly="-19" urx="797" ury="718"/>
<char name="Uacute" width="722" llx="123" lly="-19" urx="797" ury="929"/>
<char name="Ucircumflex" width="722" llx="123" lly="-19" urx="797" ury="929"/>
<char name="Udieresis" width="722" llx="123" lly="-19" urx="797" ury="901"/>
<char name="Ugrave" width="722" llx="123" lly="-19" urx="797" ury="929"/>
<char name="V" width="667" llx="173" lly="0" urx="800" ury="718"/>
<char name="W" width="944" llx="169" lly="0" urx="1081" ury="718"/>
<char name="X" width="667" llx="19" lly="0" urx="790" ury="718"/>
<char name="Y" width="667" llx="167" lly="0" urx="806" ury="718"/>
<char name="Yacute" width="667" llx="167" lly="0" urx="806" ury="929"/>
<char name="Ydieresis" width="667" llx="167" lly="0" urx="806" ury="901"/>
<char name="Z" width="611" llx="23" lly="0" urx="741" ury="718"/>
<char name="Zcaron" width="611" llx="23" lly="0" urx="741" ury="929"/>
<char name="a" width="556" llx="61" lly="-15" urx="559" ury="538"/>
<char name="aacute" width="556" llx="61" lly="-15" urx="587" ury="734"/>
<char name="acircumflex" width="556" llx="61" lly="-15" urx="559" ury="734"/>
<char name="acute" width="333" llx="248" lly="593" urx="475" ury="734"/>
<char name="adieresis" width="556" llx="61" lly="-15" urx="559" ury="706"/>
<char name="ae" width="889" llx="61" lly="-15" urx="909" ury="538"/>
<char name="agrave" width="556" llx="61" lly="-15" urx="559" ury="734"/>
<char name="ampersand" width="667" llx="77" lly="-15" urx="647" ury="718"/>
<char name="aring" width="556" llx="61" lly="-15" urx="559" ury="756"/>
<char name="asciicircum" width="469" llx="42" lly="264" urx="539" ury="688"/>
<char name="asciitilde" width="584" llx="111" lly="180" urx="580" ury="326"/>
<char name="asterisk" width="389" llx="165" lly="431" urx="475" ury="718"/>
<char name="at" width="1015" llx="215" lly="-19" urx="965" ury="737"/>
<char name="atilde" width="556" llx="61" lly="-15" urx="592" ury="722"/>
<char name="b" width="556" llx="58" lly="-15" urx="584" ury="718"/>
<char name="backslash" width="278" llx="140" lly="-19" urx="291" ury="737"/>
<char name="bar" width="260" llx="46" lly="-225" urx="332" ury="775"/>
<char name="braceleft" width="334" llx="92" lly="-196" urx="445" ury="722"/>
<char name="braceright" width="334" llx="0" lly="-196" urx="354" ury="722"/>
<char name="bracketleft" width="278" llx="21" lly="-196" urx="403" ury="722"/>
<char name="bracketright" width="278" llx="-14" lly="-196" urx="368" ury="722"/>
<char name="breve" width="333" llx="167" lly="595" urx="476" ury="731"/>
<char name="brokenbar" width="260" llx="62" lly="-150" urx="316" ury="700"/>
<char name="bullet" width="350" llx="91" lly="202" urx="413" ury="517"/>
<char name="c" width="500" llx="74" lly="-15" urx="553" ury="538"/>
<char name="caron" width="333" llx="177" lly="593" urx="468" ury="734"/>
<char name="ccedilla" width="500" llx="74" lly="-225" urx="553" ury="538"/>
<char name="cedilla" width="333" llx="2" lly="-225" urx="232" ury="0"/>
<char name="cent" width="556" llx="95" lly="-115" urx="584" ury="623"/>
<char name="circumflex" width="333" llx="147" lly="593" urx="438" ury="734"/>
<char name="colon" width="278" llx="87" lly="0" urx="301" ury="516"/>
<char name="comma" width="278" llx="56" lly="-147" urx="214" ury="106"/>
<char name="copyright" width="737" llx="54" lly="-19" urx="837" ury="737"/>
<char name="currency" width="556" llx="60" lly="99" urx="646" ury="603"/>
<char name="d" width="556" llx="84" lly="-15" urx="652" ury="718"/>
<char name="dagger" width="556" llx="135" lly="-159" urx="622" ury="718"/>
<char name="daggerdbl" width="556" llx="52" lly="-159" urx="623" ury="718"/>
<char name="degree" width="400" llx="169" lly="411" urx="468" ury="703"/>
<char name="dieresis" width="333" llx="168" lly="604" urx="443" ury="706"/>
<char name="divide" width="584" llx="85" lly="-19" urx="606" ury="524"/>
<char name="dollar" width="556" llx="69" lly="-115" urx="617" ury="775"/>
<char name="dotaccent" width="333" llx="249" lly="604" urx="362" ury="706"/>
<char name="dotlessi" width="278" llx="95" lly="0" urx="294" ury="523"/>
<char name="e" width="556" llx="84" lly="-15" urx="578" ury="538"/>
<char name="eacute" width="556" llx="84" lly="-15" urx="587" ury="734"/>
<char name="ecircumflex" width="556" llx="84" lly="-15" urx="578" ury="734"/>
<char name="edieresis" width="556" llx="84" lly="-15" urx="578" ury="706"/>
<char name="egrave" width="556" llx="84" lly="-15" urx="578" ury="734"/>
<char name="eight" width="556" llx="74" lly="-19" urx="607" ury="703"/>
<char name="ellipsis" width="1000" llx="115" lly="0" urx="908" ury="106"/>
<char name="emdash" width="1000" llx="51" lly="240" urx="1067" ury="313"/>
<char name="endash" width="556" llx="51" lly="240" urx="623" ury="313"/>
<char name="equal" width="584" llx="63" lly="115" urx="628" ury="390"/>
<char name="eth" width="556" llx="81" lly="-15" urx="617" ury="737"/>
<char name="exclam" width="278" llx="90" lly="0" urx="340" ury="718"/>
<char name="exclamdown" width="333" llx="77" lly="-195" urx="326" ury="523"/>
<char name="f" width="278" llx="86" lly="0" urx="416" ury="728"/>
<char name="fi" width="500" llx="86" lly="0" urx="587" ury="728"/>
<char name="five" width="556" llx="68" lly="-19" urx="621" ury="688"/>
<char name="fl" width="500" llx="86" lly="0" urx="585" ury="728"/>
<char name="florin" width="556" llx="-52" lly="-207" urx="654" ury="737"/>
<char name="four" width="556" llx="61" lly="0" urx="576" ury="703"/>
<char name="fraction" width="167" llx="-170" lly="-19" urx="482" ury="703"/>
<char name="g" width="556" llx="42" lly="-220" urx="610" ury="538"/>
<char name="germandbls" width="611" llx="67" lly="-15" urx="658" ury="728"/>
<char name="grave" width="333" llx="170" lly="593" urx="337" ury="734"/>
<char name="greater" width="584" llx="50" lly="11" urx="597" ury="495"/>
<char name="guillemotleft" width="556" llx="146" lly="108" urx="554" ury="446"/>
<char name="guillemotright" width="556" llx="120" lly="108" urx="528" ury="446"/>
<char name="guilsinglleft" width="333" llx="137" lly="108" urx="340" ury="446"/>
<char name="guilsinglright" width="333" llx="111" lly="108" urx="314" ury="446"/>
<char name="h" width="556" llx="65" lly="0" urx="573" ury="718"/>
<char name="hungarumlaut" width="333" llx="157" lly="593" urx="565" ury="734"/>
<char name="hyphen" width="333" llx="93" lly="232" urx="357" ury="322"/>
<char name="i" width="222" llx="67" lly="0" urx="308" ury="718"/>
<char name="iacute" width="278" llx="95" lly="0" urx="448" ury="734"/>
<char name="icircumflex" width="278" llx="95" lly="0" urx="411" ury="734"/>
<char name="idieresis" width="278" llx="95" lly="0" urx="416" ury="706"/>
<char name="igrave" width="278" llx="95" lly="0" urx="310" ury="734"/>
<char name="j" width="222" llx="-60" lly="-210" urx="308" ury="718"/>
<char name="k" width="500" llx="67" lly="0" urx="600" ury="718"/>
<char name="l" width="222" llx="67" lly="0" urx="308" ury="718"/>
<char name="less" width="584" llx="94" lly="11" urx="641" ury="495"/>
<char name="logicalnot" width="584" llx="106" lly="108" urx="628" ury="390"/>
<char name="lslash" width="222" llx="41" lly="0" urx="347" ury="718"/>
<char name="m" width="833" llx="65" lly="0" urx="852" ury="538"/>
<char name="macron" width="333" llx="143" lly="627" urx="468" ury="684"/>
<char name="minus" width="584" llx="85" lly="216" urx="606" ury="289"/>
<char name="mu" width="556" llx="24" lly="-207" urx="600" ury="523"/>
<char name="multiply" width="584" llx="50" lly="0" urx="642" ury="506"/>
<char name="n" width="556" llx="65" lly="0" urx="573" ury="538"/>
<char name="nine" width="556" llx="82" lly="-19" urx="609" ury="703"/>
<char name="ntilde" width="556" llx="65" lly="0" urx="592" ury="722"/>
<char name="numbersign" width="556" llx="73" lly="0" urx="631" ury="688"/>
<char name="o" width="556" llx="83" lly="-14" urx="585" ury="538"/>
<char name="oacute" width="556" llx="83" lly="-14" urx="587" ury="734"/>
<char name="ocircumflex" width="556" llx="83" lly="-14" urx="585" ury="734"/>
<char name="odieresis" width="556" llx="83" lly="-14" urx="585" ury="706"/>
<char name="oe" width="944" llx="83" lly="-15" urx="964" ury="538"/>
<char name="ogonek" width="333" llx="43" lly="-225" urx="249" ury="0"/>
<char name="ograve" width="556" llx="83" lly="-14" urx="585" ury="734"/>
<char name="one" width="556" llx="207" lly="0" urx="508" ury="703"/>
<char name="onehalf" width="834" llx="114" lly="-19" urx="839" ury="703"/>
<char name="onequarter" width="834" llx="150" lly="-19" urx="802" ury="703"/>
<char name="onesuperior" width="333" llx="166" lly="281" urx="371" ury="703"/>
<char name="ordfeminine" width="370" llx="127" lly="405" urx="449" ury="737"/>
<char name="ordmasculine" width="365" llx="141" lly="405" urx="468" ury="737"/>
<char name="oslash" width="611" llx="29" lly="-22" urx="647" ury="545"/>
<char name="otilde" width="556" llx="83" lly="-14" urx="602" ury="722"/>
<char name="p" width="556" llx="14" lly="-207" urx="584" ury="538"/>
<char name="paragraph" width="537" llx="126" lly="-173" urx="650" ury="718"/>
<char name="parenleft" width="333" llx="108" lly="-207" urx="454" ury="733"/>
<char name="parenright" width="333" llx="-9" lly="-207" urx="337" ury="733"/>
<char name="percent" width="889" llx="147" lly="-19" urx="889" ury="703"/>
<char name="period" width="278" llx="87" lly="0" urx="214" ury="106"/>
<char name="periodcentered" width="278" llx="129" lly="190" urx="257" ury="315"/>
<char name="perthousand" width="1000" llx="88" lly="-19" urx="1029" ury="703"/>
<char name="plus" width="584" llx="85" lly="0" urx="606" ury="505"/>
<char name="plusminus" width="584" llx="39" lly="0" urx="618" ury="506"/>
<char name="q" width="556" llx="84" lly="-207" urx="605" ury="538"/>
<char name="question" width="556" llx="161" lly="0" urx="610" ury="727"/>
<char name="questiondown" width="611" llx="85" lly="-201" urx="534" ury="525"/>
<char name="quotedbl" width="355" llx="168" lly="463" urx="438" ury="718"/>
<char name="quotedblbase" width="333" llx="-6" lly="-149" urx="318" ury="106"/>
<char name="quotedblleft" width="333" llx="138" lly="470" urx="461" ury="725"/>
<char name="quotedblright" width="333" llx="124" lly="463" urx="448" ury="718"/>
<char name="quoteleft" width="222" llx="165" lly="470" urx="323" ury="725"/>
<char name="quoteright" width="222" llx="151" lly="463" urx="310" ury="718"/>
<char name="quotesinglbase" width="222" llx="21" lly="-149" urx="180" ury="106"/>
<char name="quotesingle" width="191" llx="157" lly="463" urx="285" ury="718"/>
<char name="r" width="333" llx="77" lly="0" urx="446" ury="538"/>
<char name="registered" width="737" llx="54" lly="-19" urx="837" ury="737"/>
<char name="ring" width="333" llx="214" lly="572" urx="402" ury="756"/>
<char name="s" width="500" llx="63" lly="-15" urx="529" ury="538"/>
<char name="scaron" width="500" llx="63" lly="-15" urx="552" ury="734"/>
<char name="section" width="556" llx="76" lly="-191" urx="584" ury="737"/>
<char name="semicolon" width="278" llx="56" lly="-147" urx="301" ury="516"/>
<char name="seven" width="556" llx="137" lly="0" urx="669" ury="688"/>
<char name="six" width="556" llx="91" lly="-19" urx="615" ury="703"/>
<char name="slash" width="278" llx="-21" lly="-19" urx="452" ury="737"/>
<char name="space" width="278" llx="0" lly="0" urx="0" ury="0"/>
<!-- JKT: the following has been manually added -->
<char name="sterling" width="556" llx="49" lly="-16" urx="634" ury="718"/>
<char name="t" width="278" llx="102" lly="-7" urx="368" ury="669"/>
<char name="thorn" width="556" llx="14" lly="-207" urx="584" ury="718"/>
<char name="three" width="556" llx="75" lly="-19" urx="610" ury="703"/>
<char name="threequarters" width="834" llx="130" lly="-19" urx="861" ury="703"/>
<char name="threesuperior" width="333" llx="90" lly="270" urx="436" ury="703"/>
<char name="tilde" width="333" llx="125" lly="606" urx="490" ury="722"/>
<char name="trademark" width="1000" llx="186" lly="306" urx="1056" ury="718"/>
<char name="two" width="556" llx="26" lly="0" urx="617" ury="703"/>
<char name="twosuperior" width="333" llx="64" lly="281" urx="449" ury="703"/>
<char name="u" width="556" llx="94" lly="-15" urx="600" ury="523"/>
<char name="uacute" width="556" llx="94" lly="-15" urx="600" ury="734"/>
<char name="ucircumflex" width="556" llx="94" lly="-15" urx="600" ury="734"/>
<char name="udieresis" width="556" llx="94" lly="-15" urx="600" ury="706"/>
<char name="ugrave" width="556" llx="94" lly="-15" urx="600" ury="734"/>
<char name="underscore" width="556" llx="-27" lly="-125" urx="540" ury="-75"/>
<char name="v" width="500" llx="119" lly="0" urx="603" ury="523"/>
<char name="w" width="722" llx="125" lly="0" urx="820" ury="523"/>
<char name="x" width="500" llx="11" lly="0" urx="594" ury="523"/>
<char name="y" width="500" llx="15" lly="-214" urx="600" ury="523"/>
<char name="yacute" width="500" llx="15" lly="-214" urx="600" ury="734"/>
<char name="ydieresis" width="500" llx="15" lly="-214" urx="600" ury="706"/>
<char name="yen" width="556" llx="81" lly="0" urx="699" ury="688"/>
<char name="z" width="500" llx="31" lly="0" urx="571" ury="523"/>
<char name="zcaron" width="500" llx="31" lly="0" urx="571" ury="734"/>
<char name="zero" width="556" llx="93" lly="-19" urx="608" ury="703"/>
</char-metrics>
<kerning kpx1="107">
<pair kern="-20" kpx2="111"/>
<pair kern="-20" kpx2="101"/>
</kerning>
<kerning kpx1="79">
<pair kern="-20" kpx2="65"/>
<pair kern="-30" kpx2="87"/>
<pair kern="-70" kpx2="89"/>
<pair kern="-40" kpx2="84"/>
<pair kern="-40" kpx2="46"/>
<pair kern="-50" kpx2="86"/>
<pair kern="-60" kpx2="88"/>
<pair kern="-40" kpx2="44"/>
</kerning>
<kerning kpx1="104">
<pair kern="-30" kpx2="121"/>
</kerning>
<kerning kpx1="87">
<pair kern="-30" kpx2="111"/>
<pair kern="-40" kpx2="45"/>
<pair kern="-20" kpx2="79"/>
<pair kern="-40" kpx2="97"/>
<pair kern="-50" kpx2="65"/>
<pair kern="-30" kpx2="117"/>
<pair kern="-20" kpx2="121"/>
<pair kern="-80" kpx2="46"/>
<pair kern="-30" kpx2="101"/>
<pair kern="-80" kpx2="44"/>
</kerning>
<kerning kpx1="99">
<pair kern="-20" kpx2="107"/>
<pair kern="-15" kpx2="44"/>
</kerning>
<kerning kpx1="112">
<pair kern="-30" kpx2="121"/>
<pair kern="-35" kpx2="46"/>
<pair kern="-35" kpx2="44"/>
</kerning>
<kerning kpx1="80">
<pair kern="-50" kpx2="111"/>
<pair kern="-40" kpx2="97"/>
<pair kern="-120" kpx2="65"/>
<pair kern="-180" kpx2="46"/>
<pair kern="-50" kpx2="101"/>
<pair kern="-180" kpx2="44"/>
</kerning>
<kerning kpx1="86">
<pair kern="-80" kpx2="111"/>
<pair kern="-80" kpx2="45"/>
<pair kern="-40" kpx2="79"/>
<pair kern="-40" kpx2="58"/>
<pair kern="-70" kpx2="97"/>
<pair kern="-80" kpx2="65"/>
<pair kern="-70" kpx2="117"/>
<pair kern="-125" kpx2="46"/>
<pair kern="-40" kpx2="71"/>
<pair kern="-80" kpx2="101"/>
<pair kern="-40" kpx2="59"/>
<pair kern="-125" kpx2="44"/>
</kerning>
<kerning kpx1="118">
<pair kern="-25" kpx2="111"/>
<pair kern="-25" kpx2="97"/>
<pair kern="-80" kpx2="46"/>
<pair kern="-25" kpx2="101"/>
<pair kern="-80" kpx2="44"/>
</kerning>
<kerning kpx1="59">
<pair kern="-50" kpx2="32"/>
</kerning>
<kerning kpx1="32">
<pair kern="-40" kpx2="87"/>
<pair kern="-30" kpx2="147"/>
<pair kern="-90" kpx2="89"/>
<pair kern="-50" kpx2="84"/>
<pair kern="-60" kpx2="145"/>
<pair kern="-50" kpx2="86"/>
</kerning>
<kerning kpx1="97">
<pair kern="-20" kpx2="119"/>
<pair kern="-30" kpx2="121"/>
<pair kern="-20" kpx2="118"/>
</kerning>
<kerning kpx1="65">
<pair kern="-30" kpx2="79"/>
<pair kern="-40" kpx2="119"/>
<pair kern="-50" kpx2="87"/>
<pair kern="-30" kpx2="67"/>
<pair kern="-30" kpx2="81"/>
<pair kern="-30" kpx2="71"/>
<pair kern="-70" kpx2="86"/>
<pair kern="-40" kpx2="118"/>
<pair kern="-50" kpx2="85"/>
<pair kern="-30" kpx2="117"/>
<pair kern="-100" kpx2="89"/>
<pair kern="-120" kpx2="84"/>
<pair kern="-40" kpx2="121"/>
</kerning>
<kerning kpx1="70">
<pair kern="-30" kpx2="111"/>
<pair kern="-45" kpx2="114"/>
<pair kern="-50" kpx2="97"/>
<pair kern="-80" kpx2="65"/>
<pair kern="-150" kpx2="46"/>
<pair kern="-30" kpx2="101"/>
<pair kern="-150" kpx2="44"/>
</kerning>
<kerning kpx1="85">
<pair kern="-40" kpx2="65"/>
<pair kern="-40" kpx2="46"/>
<pair kern="-40" kpx2="44"/>
</kerning>
<kerning kpx1="115">
<pair kern="-30" kpx2="119"/>
<pair kern="-15" kpx2="46"/>
<pair kern="-15" kpx2="44"/>
</kerning>
<kerning kpx1="122">
<pair kern="-15" kpx2="111"/>
<pair kern="-15" kpx2="101"/>
</kerning>
<kerning kpx1="83">
<pair kern="-20" kpx2="46"/>
<pair kern="-20" kpx2="44"/>
</kerning>
<kerning kpx1="111">
<pair kern="-15" kpx2="119"/>
<pair kern="-30" kpx2="121"/>
<pair kern="-40" kpx2="46"/>
<pair kern="-30" kpx2="120"/>
<pair kern="-15" kpx2="118"/>
<pair kern="-40" kpx2="44"/>
</kerning>
<kerning kpx1="68">
<pair kern="-40" kpx2="65"/>
<pair kern="-40" kpx2="87"/>
<pair kern="-90" kpx2="89"/>
<pair kern="-70" kpx2="46"/>
<pair kern="-70" kpx2="86"/>
<pair kern="-70" kpx2="44"/>
</kerning>
<kerning kpx1="146">
<pair kern="-50" kpx2="100"/>
<pair kern="-70" kpx2="32"/>
<pair kern="-57" kpx2="146"/>
<pair kern="-50" kpx2="114"/>
<pair kern="-50" kpx2="115"/>
</kerning>
<kerning kpx1="82">
<pair kern="-20" kpx2="79"/>
<pair kern="-30" kpx2="87"/>
<pair kern="-40" kpx2="85"/>
<pair kern="-50" kpx2="89"/>
<pair kern="-30" kpx2="84"/>
<pair kern="-50" kpx2="86"/>
</kerning>
<kerning kpx1="75">
<pair kern="-40" kpx2="111"/>
<pair kern="-50" kpx2="79"/>
<pair kern="-30" kpx2="117"/>
<pair kern="-50" kpx2="121"/>
<pair kern="-40" kpx2="101"/>
</kerning>
<kerning kpx1="119">
<pair kern="-10" kpx2="111"/>
<pair kern="-15" kpx2="97"/>
<pair kern="-60" kpx2="46"/>
<pair kern="-10" kpx2="101"/>
<pair kern="-60" kpx2="44"/>
</kerning>
<kerning kpx1="58">
<pair kern="-50" kpx2="32"/>
</kerning>
<kerning kpx1="114">
<pair kern="15" kpx2="107"/>
<pair kern="30" kpx2="58"/>
<pair kern="30" kpx2="112"/>
<pair kern="15" kpx2="108"/>
<pair kern="30" kpx2="118"/>
<pair kern="-50" kpx2="44"/>
<pair kern="30" kpx2="59"/>
<pair kern="15" kpx2="105"/>
<pair kern="25" kpx2="109"/>
<pair kern="-10" kpx2="97"/>
<pair kern="15" kpx2="117"/>
<pair kern="40" kpx2="116"/>
<pair kern="30" kpx2="121"/>
<pair kern="-50" kpx2="46"/>
<pair kern="25" kpx2="110"/>
</kerning>
<kerning kpx1="67">
<pair kern="-30" kpx2="46"/>
<pair kern="-30" kpx2="44"/>
</kerning>
<kerning kpx1="145">
<pair kern="-57" kpx2="145"/>
</kerning>
<kerning kpx1="103">
<pair kern="-10" kpx2="114"/>
</kerning>
<kerning kpx1="66">
<pair kern="-10" kpx2="85"/>
<pair kern="-20" kpx2="46"/>
<pair kern="-20" kpx2="44"/>
</kerning>
<kerning kpx1="81">
<pair kern="-10" kpx2="85"/>
</kerning>
<kerning kpx1="76">
<pair kern="-140" kpx2="148"/>
<pair kern="-160" kpx2="146"/>
<pair kern="-70" kpx2="87"/>
<pair kern="-140" kpx2="89"/>
<pair kern="-30" kpx2="121"/>
<pair kern="-110" kpx2="84"/>
<pair kern="-110" kpx2="86"/>
</kerning>
<kerning kpx1="98">
<pair kern="-20" kpx2="117"/>
<pair kern="-20" kpx2="121"/>
<pair kern="-40" kpx2="46"/>
<pair kern="-20" kpx2="108"/>
<pair kern="-10" kpx2="98"/>
<pair kern="-20" kpx2="118"/>
<pair kern="-40" kpx2="44"/>
</kerning>
<kerning kpx1="44">
<pair kern="-100" kpx2="148"/>
<pair kern="-100" kpx2="146"/>
</kerning>
<kerning kpx1="148">
<pair kern="-40" kpx2="32"/>
</kerning>
<kerning kpx1="109">
<pair kern="-10" kpx2="117"/>
<pair kern="-15" kpx2="121"/>
</kerning>
<kerning kpx1="248">
<pair kern="-55" kpx2="107"/>
<pair kern="-55" kpx2="104"/>
<pair kern="-55" kpx2="99"/>
<pair kern="-55" kpx2="112"/>
<pair kern="-55" kpx2="113"/>
<pair kern="-70" kpx2="118"/>
<pair kern="-55" kpx2="105"/>
<pair kern="-55" kpx2="97"/>
<pair kern="-55" kpx2="117"/>
<pair kern="-55" kpx2="116"/>
<pair kern="-55" kpx2="106"/>
<pair kern="-55" kpx2="115"/>
<pair kern="-55" kpx2="122"/>
<pair kern="-55" kpx2="100"/>
<pair kern="-55" kpx2="111"/>
<pair kern="-70" kpx2="119"/>
<pair kern="-55" kpx2="114"/>
<pair kern="-55" kpx2="103"/>
<pair kern="-55" kpx2="108"/>
<pair kern="-55" kpx2="98"/>
<pair kern="-95" kpx2="44"/>
<pair kern="-55" kpx2="109"/>
<pair kern="-55" kpx2="102"/>
<pair kern="-70" kpx2="121"/>
<pair kern="-95" kpx2="46"/>
<pair kern="-55" kpx2="110"/>
<pair kern="-85" kpx2="120"/>
<pair kern="-55" kpx2="101"/>
</kerning>
<kerning kpx1="102">
<pair kern="60" kpx2="148"/>
<pair kern="-30" kpx2="111"/>
<pair kern="50" kpx2="146"/>
<pair kern="-30" kpx2="97"/>
<pair kern="-30" kpx2="46"/>
<pair kern="-30" kpx2="101"/>
<pair kern="-30" kpx2="44"/>
</kerning>
<kerning kpx1="74">
<pair kern="-20" kpx2="97"/>
<pair kern="-20" kpx2="65"/>
<pair kern="-20" kpx2="117"/>
<pair kern="-30" kpx2="46"/>
<pair kern="-30" kpx2="44"/>
</kerning>
<kerning kpx1="89">
<pair kern="-140" kpx2="111"/>
<pair kern="-140" kpx2="45"/>
<pair kern="-20" kpx2="105"/>
<pair kern="-85" kpx2="79"/>
<pair kern="-60" kpx2="58"/>
<pair kern="-140" kpx2="97"/>
<pair kern="-110" kpx2="65"/>
<pair kern="-110" kpx2="117"/>
<pair kern="-140" kpx2="46"/>
<pair kern="-140" kpx2="101"/>
<pair kern="-60" kpx2="59"/>
<pair kern="-140" kpx2="44"/>
</kerning>
<kerning kpx1="121">
<pair kern="-20" kpx2="111"/>
<pair kern="-20" kpx2="97"/>
<pair kern="-100" kpx2="46"/>
<pair kern="-20" kpx2="101"/>
<pair kern="-100" kpx2="44"/>
</kerning>
<kerning kpx1="84">
<pair kern="-120" kpx2="111"/>
<pair kern="-40" kpx2="79"/>
<pair kern="-20" kpx2="58"/>
<pair kern="-120" kpx2="119"/>
<pair kern="-120" kpx2="114"/>
<pair kern="-120" kpx2="44"/>
<pair kern="-20" kpx2="59"/>
<pair kern="-140" kpx2="45"/>
<pair kern="-120" kpx2="65"/>
<pair kern="-120" kpx2="97"/>
<pair kern="-120" kpx2="117"/>
<pair kern="-120" kpx2="121"/>
<pair kern="-120" kpx2="46"/>
<pair kern="-120" kpx2="101"/>
</kerning>
<kerning kpx1="46">
<pair kern="-100" kpx2="148"/>
<pair kern="-60" kpx2="32"/>
<pair kern="-100" kpx2="146"/>
</kerning>
<kerning kpx1="110">
<pair kern="-10" kpx2="117"/>
<pair kern="-15" kpx2="121"/>
<pair kern="-20" kpx2="118"/>
</kerning>
<kerning kpx1="120">
<pair kern="-30" kpx2="101"/>
</kerning>
<kerning kpx1="101">
<pair kern="-20" kpx2="119"/>
<pair kern="-20" kpx2="121"/>
<pair kern="-15" kpx2="46"/>
<pair kern="-30" kpx2="120"/>
<pair kern="-30" kpx2="118"/>
<pair kern="-15" kpx2="44"/>
</kerning>
</font-metrics>
+224
View File
@@ -0,0 +1,224 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- $Id$ -->
<font-metrics>
<font-name>Symbol</font-name>
<full-name>Symbol</full-name>
<family-name>Symbol</family-name>
<class-name>Symbol</class-name>
<encoding>SymbolEncoding</encoding>
<underline-position>-100</underline-position>
<underline-thickness>50</underline-thickness>
<cap-height>1010</cap-height>
<x-height>520</x-height>
<ascender>1010</ascender>
<descender>-293</descender>
<first-char>32</first-char>
<last-char>255</last-char>
<char-metrics>
<char name="space" width="250" llx="0" lly="0" urx="0" ury="0"/>
<char name="exclam" width="333" llx="128" lly="-17" urx="240" ury="672"/>
<char name="universal" width="713" llx="31" lly="0" urx="681" ury="705"/>
<char name="numbersign" width="500" llx="20" lly="-16" urx="481" ury="673"/>
<char name="existential" width="549" llx="25" lly="0" urx="478" ury="707"/>
<char name="percent" width="833" llx="63" lly="-36" urx="771" ury="655"/>
<char name="ampersand" width="778" llx="41" lly="-18" urx="750" ury="661"/>
<char name="suchthat" width="439" llx="48" lly="-17" urx="414" ury="500"/>
<char name="parenleft" width="333" llx="53" lly="-191" urx="300" ury="673"/>
<char name="parenright" width="333" llx="30" lly="-191" urx="277" ury="673"/>
<char name="asteriskmath" width="500" llx="65" lly="134" urx="427" ury="551"/>
<char name="plus" width="549" llx="10" lly="0" urx="539" ury="533"/>
<char name="comma" width="250" llx="56" lly="-152" urx="194" ury="104"/>
<char name="minus" width="549" llx="11" lly="233" urx="535" ury="288"/>
<char name="period" width="250" llx="69" lly="-17" urx="181" ury="95"/>
<char name="slash" width="278" llx="0" lly="-18" urx="254" ury="646"/>
<char name="zero" width="500" llx="24" lly="-14" urx="476" ury="685"/>
<char name="one" width="500" llx="117" lly="0" urx="390" ury="673"/>
<char name="two" width="500" llx="25" lly="0" urx="475" ury="685"/>
<char name="three" width="500" llx="43" lly="-14" urx="435" ury="685"/>
<char name="four" width="500" llx="15" lly="0" urx="469" ury="685"/>
<char name="five" width="500" llx="32" lly="-14" urx="445" ury="690"/>
<char name="six" width="500" llx="34" lly="-14" urx="468" ury="685"/>
<char name="seven" width="500" llx="24" lly="-16" urx="448" ury="673"/>
<char name="eight" width="500" llx="56" lly="-14" urx="445" ury="685"/>
<char name="nine" width="500" llx="30" lly="-18" urx="459" ury="685"/>
<char name="colon" width="278" llx="81" lly="-17" urx="193" ury="460"/>
<char name="semicolon" width="278" llx="83" lly="-152" urx="221" ury="460"/>
<char name="less" width="549" llx="26" lly="0" urx="523" ury="522"/>
<char name="equal" width="549" llx="11" lly="141" urx="537" ury="390"/>
<char name="greater" width="549" llx="26" lly="0" urx="523" ury="522"/>
<char name="question" width="444" llx="70" lly="-17" urx="412" ury="686"/>
<char name="congruent" width="549" llx="11" lly="0" urx="537" ury="475"/>
<char name="Alpha" width="722" llx="4" lly="0" urx="684" ury="673"/>
<char name="Beta" width="667" llx="29" lly="0" urx="592" ury="673"/>
<char name="Chi" width="722" llx="-9" lly="0" urx="704" ury="673"/>
<char name="Delta" width="612" llx="6" lly="0" urx="608" ury="688"/>
<char name="Epsilon" width="611" llx="32" lly="0" urx="617" ury="673"/>
<char name="Phi" width="763" llx="26" lly="0" urx="741" ury="673"/>
<char name="Gamma" width="603" llx="24" lly="0" urx="609" ury="673"/>
<char name="Eta" width="722" llx="39" lly="0" urx="729" ury="673"/>
<char name="Iota" width="333" llx="32" lly="0" urx="316" ury="673"/>
<char name="theta1" width="631" llx="18" lly="-18" urx="623" ury="689"/>
<char name="Kappa" width="722" llx="35" lly="0" urx="722" ury="673"/>
<char name="Lambda" width="686" llx="6" lly="0" urx="680" ury="688"/>
<char name="Mu" width="889" llx="28" lly="0" urx="887" ury="673"/>
<char name="Nu" width="722" llx="29" lly="-8" urx="720" ury="673"/>
<char name="Omicron" width="722" llx="41" lly="-17" urx="715" ury="685"/>
<char name="Pi" width="768" llx="25" lly="0" urx="745" ury="673"/>
<char name="Theta" width="741" llx="41" lly="-17" urx="715" ury="685"/>
<char name="Rho" width="556" llx="28" lly="0" urx="563" ury="673"/>
<char name="Sigma" width="592" llx="5" lly="0" urx="589" ury="673"/>
<char name="Tau" width="611" llx="33" lly="0" urx="607" ury="673"/>
<char name="Upsilon" width="690" llx="-8" lly="0" urx="694" ury="673"/>
<char name="sigma1" width="439" llx="40" lly="-233" urx="436" ury="500"/>
<char name="Omega" width="768" llx="34" lly="0" urx="736" ury="688"/>
<char name="Xi" width="645" llx="40" lly="0" urx="599" ury="673"/>
<char name="Psi" width="795" llx="15" lly="0" urx="781" ury="684"/>
<char name="Zeta" width="611" llx="44" lly="0" urx="636" ury="673"/>
<char name="bracketleft" width="333" llx="86" lly="-155" urx="299" ury="674"/>
<char name="therefore" width="863" llx="163" lly="0" urx="701" ury="487"/>
<char name="bracketright" width="333" llx="33" lly="-155" urx="246" ury="674"/>
<char name="perpendicular" width="658" llx="15" lly="0" urx="652" ury="674"/>
<char name="underscore" width="500" llx="-2" lly="-125" urx="502" ury="-75"/>
<char name="radicalex" width="500" llx="480" lly="881" urx="1090" ury="917"/>
<char name="alpha" width="631" llx="41" lly="-18" urx="622" ury="500"/>
<char name="beta" width="549" llx="61" lly="-223" urx="515" ury="741"/>
<char name="chi" width="549" llx="12" lly="-231" urx="522" ury="499"/>
<char name="delta" width="494" llx="40" lly="-19" urx="481" ury="740"/>
<char name="epsilon" width="439" llx="22" lly="-19" urx="427" ury="502"/>
<char name="phi" width="521" llx="28" lly="-224" urx="492" ury="673"/>
<char name="gamma" width="411" llx="5" lly="-225" urx="484" ury="499"/>
<char name="eta" width="603" llx="0" lly="-202" urx="527" ury="514"/>
<char name="iota" width="329" llx="0" lly="-17" urx="301" ury="503"/>
<char name="phi1" width="603" llx="36" lly="-224" urx="587" ury="499"/>
<char name="kappa" width="549" llx="33" lly="0" urx="558" ury="501"/>
<char name="lambda" width="549" llx="24" lly="-17" urx="548" ury="739"/>
<char name="mu" width="576" llx="33" lly="-223" urx="567" ury="500"/>
<char name="nu" width="521" llx="-9" lly="-16" urx="475" ury="507"/>
<char name="omicron" width="549" llx="35" lly="-19" urx="501" ury="499"/>
<char name="pi" width="549" llx="10" lly="-19" urx="530" ury="487"/>
<char name="theta" width="521" llx="43" lly="-17" urx="485" ury="690"/>
<char name="rho" width="549" llx="50" lly="-230" urx="490" ury="499"/>
<char name="sigma" width="603" llx="30" lly="-21" urx="588" ury="500"/>
<char name="tau" width="439" llx="10" lly="-19" urx="418" ury="500"/>
<char name="upsilon" width="576" llx="7" lly="-18" urx="535" ury="507"/>
<char name="omega1" width="713" llx="12" lly="-18" urx="671" ury="583"/>
<char name="omega" width="686" llx="42" lly="-17" urx="684" ury="500"/>
<char name="xi" width="493" llx="27" lly="-224" urx="469" ury="766"/>
<char name="psi" width="686" llx="12" lly="-228" urx="701" ury="500"/>
<char name="zeta" width="494" llx="60" lly="-225" urx="467" ury="756"/>
<char name="braceleft" width="480" llx="58" lly="-183" urx="397" ury="673"/>
<char name="bar" width="200" llx="65" lly="-293" urx="135" ury="707"/>
<char name="braceright" width="480" llx="79" lly="-183" urx="418" ury="673"/>
<char name="similar" width="549" llx="17" lly="203" urx="529" ury="307"/>
<char name="Euro" width="750" llx="20" lly="-12" urx="714" ury="685"/>
<char name="Upsilon1" width="620" llx="-2" lly="0" urx="610" ury="685"/>
<char name="minute" width="247" llx="27" lly="459" urx="228" ury="735"/>
<char name="lessequal" width="549" llx="29" lly="0" urx="526" ury="639"/>
<char name="fraction" width="167" llx="-180" lly="-12" urx="340" ury="677"/>
<char name="infinity" width="713" llx="26" lly="124" urx="688" ury="404"/>
<char name="florin" width="500" llx="2" lly="-193" urx="494" ury="686"/>
<char name="club" width="753" llx="86" lly="-26" urx="660" ury="533"/>
<char name="diamond" width="753" llx="142" lly="-36" urx="600" ury="550"/>
<char name="heart" width="753" llx="117" lly="-33" urx="631" ury="532"/>
<char name="spade" width="753" llx="113" lly="-36" urx="629" ury="548"/>
<char name="arrowboth" width="1042" llx="24" lly="-15" urx="1024" ury="511"/>
<char name="arrowleft" width="987" llx="32" lly="-15" urx="942" ury="511"/>
<char name="arrowup" width="603" llx="45" lly="0" urx="571" ury="910"/>
<char name="arrowright" width="987" llx="49" lly="-15" urx="959" ury="511"/>
<char name="arrowdown" width="603" llx="45" lly="-22" urx="571" ury="888"/>
<char name="degree" width="400" llx="50" lly="385" urx="350" ury="685"/>
<char name="plusminus" width="549" llx="10" lly="0" urx="539" ury="645"/>
<char name="second" width="411" llx="20" lly="459" urx="413" ury="737"/>
<char name="greaterequal" width="549" llx="29" lly="0" urx="526" ury="639"/>
<char name="multiply" width="549" llx="17" lly="8" urx="533" ury="524"/>
<char name="proportional" width="713" llx="27" lly="123" urx="639" ury="404"/>
<char name="partialdiff" width="494" llx="26" lly="-20" urx="462" ury="746"/>
<char name="bullet" width="460" llx="50" lly="113" urx="410" ury="473"/>
<char name="divide" width="549" llx="10" lly="71" urx="536" ury="456"/>
<char name="notequal" width="549" llx="15" lly="-25" urx="540" ury="549"/>
<char name="equivalence" width="549" llx="14" lly="82" urx="538" ury="443"/>
<char name="approxequal" width="549" llx="14" lly="135" urx="527" ury="394"/>
<char name="ellipsis" width="1000" llx="111" lly="-17" urx="889" ury="95"/>
<char name="arrowvertex" width="603" llx="280" lly="-120" urx="336" ury="1010"/>
<char name="arrowhorizex" width="1000" llx="-60" lly="220" urx="1050" ury="276"/>
<char name="carriagereturn" width="658" llx="15" lly="-16" urx="602" ury="629"/>
<char name="aleph" width="823" llx="175" lly="-18" urx="661" ury="658"/>
<char name="Ifraktur" width="686" llx="10" lly="-53" urx="578" ury="740"/>
<char name="Rfraktur" width="795" llx="26" lly="-15" urx="759" ury="734"/>
<char name="weierstrass" width="987" llx="159" lly="-211" urx="870" ury="573"/>
<char name="circlemultiply" width="768" llx="43" lly="-17" urx="733" ury="673"/>
<char name="circleplus" width="768" llx="43" lly="-15" urx="733" ury="675"/>
<char name="emptyset" width="823" llx="39" lly="-24" urx="781" ury="719"/>
<char name="intersection" width="768" llx="40" lly="0" urx="732" ury="509"/>
<char name="union" width="768" llx="40" lly="-17" urx="732" ury="492"/>
<char name="propersuperset" width="713" llx="20" lly="0" urx="673" ury="470"/>
<char name="reflexsuperset" width="713" llx="20" lly="-125" urx="673" ury="470"/>
<char name="notsubset" width="713" llx="36" lly="-70" urx="690" ury="540"/>
<char name="propersubset" width="713" llx="37" lly="0" urx="690" ury="470"/>
<char name="reflexsubset" width="713" llx="37" lly="-125" urx="690" ury="470"/>
<char name="element" width="713" llx="45" lly="0" urx="505" ury="468"/>
<char name="notelement" width="713" llx="45" lly="-58" urx="505" ury="555"/>
<char name="angle" width="768" llx="26" lly="0" urx="738" ury="673"/>
<char name="gradient" width="713" llx="36" lly="-19" urx="681" ury="718"/>
<char name="registerserif" width="790" llx="50" lly="-17" urx="740" ury="673"/>
<char name="copyrightserif" width="790" llx="51" lly="-15" urx="741" ury="675"/>
<char name="trademarkserif" width="890" llx="18" lly="293" urx="855" ury="673"/>
<char name="product" width="823" llx="25" lly="-101" urx="803" ury="751"/>
<char name="radical" width="549" llx="10" lly="-38" urx="515" ury="917"/>
<char name="dotmath" width="250" llx="69" lly="210" urx="169" ury="310"/>
<char name="logicalnot" width="713" llx="15" lly="0" urx="680" ury="288"/>
<char name="logicaland" width="603" llx="23" lly="0" urx="583" ury="454"/>
<char name="logicalor" width="603" llx="30" lly="0" urx="578" ury="477"/>
<char name="arrowdblboth" width="1042" llx="27" lly="-20" urx="1023" ury="510"/>
<char name="arrowdblleft" width="987" llx="30" lly="-15" urx="939" ury="513"/>
<char name="arrowdblup" width="603" llx="39" lly="2" urx="567" ury="911"/>
<char name="arrowdblright" width="987" llx="45" lly="-20" urx="954" ury="508"/>
<char name="arrowdbldown" width="603" llx="44" lly="-19" urx="572" ury="890"/>
<char name="lozenge" width="494" llx="18" lly="0" urx="466" ury="745"/>
<char name="angleleft" width="329" llx="25" lly="-198" urx="306" ury="746"/>
<char name="registersans" width="790" llx="50" lly="-20" urx="740" ury="670"/>
<char name="copyrightsans" width="790" llx="49" lly="-15" urx="739" ury="675"/>
<char name="trademarksans" width="786" llx="5" lly="293" urx="725" ury="673"/>
<char name="summation" width="713" llx="14" lly="-108" urx="695" ury="752"/>
<char name="parenlefttp" width="384" llx="24" lly="-293" urx="436" ury="926"/>
<char name="parenleftex" width="384" llx="24" lly="-85" urx="108" ury="925"/>
<char name="parenleftbt" width="384" llx="24" lly="-293" urx="436" ury="926"/>
<char name="bracketlefttp" width="384" llx="0" lly="-80" urx="349" ury="926"/>
<char name="bracketleftex" width="384" llx="0" lly="-79" urx="77" ury="925"/>
<char name="bracketleftbt" width="384" llx="0" lly="-80" urx="349" ury="926"/>
<char name="bracelefttp" width="494" llx="209" lly="-85" urx="445" ury="925"/>
<char name="braceleftmid" width="494" llx="20" lly="-85" urx="284" ury="935"/>
<char name="braceleftbt" width="494" llx="209" lly="-75" urx="445" ury="935"/>
<char name="braceex" width="494" llx="209" lly="-85" urx="284" ury="935"/>
<char name="angleright" width="329" llx="21" lly="-198" urx="302" ury="746"/>
<char name="integral" width="274" llx="2" lly="-107" urx="291" ury="916"/>
<char name="integraltp" width="686" llx="308" lly="-88" urx="675" ury="920"/>
<char name="integralex" width="686" llx="308" lly="-88" urx="378" ury="975"/>
<char name="integralbt" width="686" llx="11" lly="-87" urx="378" ury="921"/>
<char name="parenrighttp" width="384" llx="54" lly="-293" urx="466" ury="926"/>
<char name="parenrightex" width="384" llx="382" lly="-85" urx="466" ury="925"/>
<char name="parenrightbt" width="384" llx="54" lly="-293" urx="466" ury="926"/>
<char name="bracketrighttp" width="384" llx="22" lly="-80" urx="371" ury="926"/>
<char name="bracketrightex" width="384" llx="294" lly="-79" urx="371" ury="925"/>
<char name="bracketrightbt" width="384" llx="22" lly="-80" urx="371" ury="926"/>
<char name="bracerighttp" width="494" llx="48" lly="-85" urx="284" ury="925"/>
<char name="bracerightmid" width="494" llx="209" lly="-85" urx="473" ury="935"/>
<char name="bracerightbt" width="494" llx="48" lly="-75" urx="284" ury="935"/>
<char name="apple" width="790" llx="56" lly="-3" urx="733" ury="808"/>
</char-metrics>
</font-metrics>
+645
View File
@@ -0,0 +1,645 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- $Id$ -->
<!-- JKT: these metrics in XML were kindly produced by Fotis Jannidis -->
<font-metrics>
<font-name>Times-Bold</font-name>
<full-name>Times Bold</full-name>
<family-name>Times</family-name>
<class-name>TimesBold</class-name>
<encoding>StandardEncoding</encoding>
<underline-position>-100</underline-position>
<underline-thickness>50</underline-thickness>
<cap-height>676</cap-height>
<x-height>461</x-height>
<ascender>676</ascender>
<descender>-205</descender>
<first-char>32</first-char>
<last-char>255</last-char>
<char-metrics>
<char name="A" width="722" llx="9" lly="0" urx="689" ury="690"/>
<char name="AE" width="1000" llx="4" lly="0" urx="951" ury="676"/>
<char name="Aacute" width="722" llx="9" lly="0" urx="689" ury="923"/>
<char name="Acircumflex" width="722" llx="9" lly="0" urx="689" ury="914"/>
<char name="Adieresis" width="722" llx="9" lly="0" urx="689" ury="877"/>
<char name="Agrave" width="722" llx="9" lly="0" urx="689" ury="923"/>
<char name="Aring" width="722" llx="9" lly="0" urx="689" ury="935"/>
<char name="Atilde" width="722" llx="9" lly="0" urx="689" ury="884"/>
<char name="B" width="667" llx="16" lly="0" urx="619" ury="676"/>
<char name="C" width="722" llx="49" lly="-19" urx="687" ury="691"/>
<char name="Ccedilla" width="722" llx="49" lly="-218" urx="687" ury="691"/>
<char name="D" width="722" llx="14" lly="0" urx="690" ury="676"/>
<char name="E" width="667" llx="16" lly="0" urx="641" ury="676"/>
<char name="Eacute" width="667" llx="16" lly="0" urx="641" ury="923"/>
<char name="Ecircumflex" width="667" llx="16" lly="0" urx="641" ury="914"/>
<char name="Edieresis" width="667" llx="16" lly="0" urx="641" ury="877"/>
<char name="Egrave" width="667" llx="16" lly="0" urx="641" ury="923"/>
<char name="Eth" width="722" llx="6" lly="0" urx="690" ury="676"/>
<char name="Euro" width="500" llx="0" lly="0" urx="0" ury="0"/>
<char name="F" width="611" llx="16" lly="0" urx="583" ury="676"/>
<char name="G" width="778" llx="37" lly="-19" urx="755" ury="691"/>
<char name="H" width="778" llx="21" lly="0" urx="759" ury="676"/>
<char name="I" width="389" llx="20" lly="0" urx="370" ury="676"/>
<char name="Iacute" width="389" llx="20" lly="0" urx="370" ury="923"/>
<char name="Icircumflex" width="389" llx="20" lly="0" urx="370" ury="914"/>
<char name="Idieresis" width="389" llx="20" lly="0" urx="370" ury="877"/>
<char name="Igrave" width="389" llx="20" lly="0" urx="370" ury="923"/>
<char name="J" width="500" llx="3" lly="-96" urx="479" ury="676"/>
<char name="K" width="778" llx="30" lly="0" urx="769" ury="676"/>
<char name="L" width="667" llx="19" lly="0" urx="638" ury="676"/>
<char name="Lslash" width="667" llx="19" lly="0" urx="638" ury="676"/>
<char name="M" width="944" llx="14" lly="0" urx="921" ury="676"/>
<char name="N" width="722" llx="16" lly="-18" urx="701" ury="676"/>
<char name="Ntilde" width="722" llx="16" lly="-18" urx="701" ury="884"/>
<char name="O" width="778" llx="35" lly="-19" urx="743" ury="691"/>
<char name="OE" width="1000" llx="22" lly="-5" urx="981" ury="684"/>
<char name="Oacute" width="778" llx="35" lly="-19" urx="743" ury="923"/>
<char name="Ocircumflex" width="778" llx="35" lly="-19" urx="743" ury="914"/>
<char name="Odieresis" width="778" llx="35" lly="-19" urx="743" ury="877"/>
<char name="Ograve" width="778" llx="35" lly="-19" urx="743" ury="923"/>
<char name="Oslash" width="778" llx="35" lly="-74" urx="743" ury="737"/>
<char name="Otilde" width="778" llx="35" lly="-19" urx="743" ury="884"/>
<char name="P" width="611" llx="16" lly="0" urx="600" ury="676"/>
<char name="Q" width="778" llx="35" lly="-176" urx="743" ury="691"/>
<char name="R" width="722" llx="26" lly="0" urx="715" ury="676"/>
<char name="S" width="556" llx="35" lly="-19" urx="513" ury="692"/>
<char name="Scaron" width="556" llx="35" lly="-19" urx="513" ury="914"/>
<char name="T" width="667" llx="31" lly="0" urx="636" ury="676"/>
<char name="Thorn" width="611" llx="16" lly="0" urx="600" ury="676"/>
<char name="U" width="722" llx="16" lly="-19" urx="701" ury="676"/>
<char name="Uacute" width="722" llx="16" lly="-19" urx="701" ury="923"/>
<char name="Ucircumflex" width="722" llx="16" lly="-19" urx="701" ury="914"/>
<char name="Udieresis" width="722" llx="16" lly="-19" urx="701" ury="877"/>
<char name="Ugrave" width="722" llx="16" lly="-19" urx="701" ury="923"/>
<char name="V" width="722" llx="16" lly="-18" urx="701" ury="676"/>
<char name="W" width="1000" llx="19" lly="-15" urx="981" ury="676"/>
<char name="X" width="722" llx="16" lly="0" urx="699" ury="676"/>
<char name="Y" width="722" llx="15" lly="0" urx="699" ury="676"/>
<char name="Yacute" width="722" llx="15" lly="0" urx="699" ury="923"/>
<char name="Ydieresis" width="722" llx="15" lly="0" urx="699" ury="877"/>
<char name="Z" width="667" llx="28" lly="0" urx="634" ury="676"/>
<char name="Zcaron" width="667" llx="28" lly="0" urx="634" ury="914"/>
<char name="a" width="500" llx="25" lly="-14" urx="488" ury="473"/>
<char name="aacute" width="500" llx="25" lly="-14" urx="488" ury="713"/>
<char name="acircumflex" width="500" llx="25" lly="-14" urx="488" ury="704"/>
<char name="acute" width="333" llx="86" lly="528" urx="324" ury="713"/>
<char name="adieresis" width="500" llx="25" lly="-14" urx="488" ury="667"/>
<char name="ae" width="722" llx="33" lly="-14" urx="693" ury="473"/>
<char name="agrave" width="500" llx="25" lly="-14" urx="488" ury="713"/>
<char name="ampersand" width="833" llx="62" lly="-16" urx="787" ury="691"/>
<char name="aring" width="500" llx="25" lly="-14" urx="488" ury="740"/>
<char name="asciicircum" width="581" llx="73" lly="311" urx="509" ury="676"/>
<char name="asciitilde" width="520" llx="29" lly="173" urx="491" ury="333"/>
<char name="asterisk" width="500" llx="56" lly="255" urx="447" ury="691"/>
<char name="at" width="930" llx="108" lly="-19" urx="822" ury="691"/>
<char name="atilde" width="500" llx="25" lly="-14" urx="488" ury="674"/>
<char name="b" width="556" llx="17" lly="-14" urx="521" ury="676"/>
<char name="backslash" width="278" llx="-25" lly="-19" urx="303" ury="691"/>
<char name="bar" width="220" llx="66" lly="-218" urx="154" ury="782"/>
<char name="braceleft" width="394" llx="22" lly="-175" urx="340" ury="698"/>
<char name="braceright" width="394" llx="54" lly="-175" urx="372" ury="698"/>
<char name="bracketleft" width="333" llx="67" lly="-149" urx="301" ury="678"/>
<char name="bracketright" width="333" llx="32" lly="-149" urx="266" ury="678"/>
<char name="breve" width="333" llx="15" lly="528" urx="318" ury="691"/>
<char name="brokenbar" width="220" llx="66" lly="-143" urx="154" ury="707"/>
<char name="bullet" width="350" llx="35" lly="198" urx="315" ury="478"/>
<char name="c" width="444" llx="25" lly="-14" urx="430" ury="473"/>
<char name="caron" width="333" llx="-2" lly="528" urx="335" ury="704"/>
<char name="ccedilla" width="444" llx="25" lly="-218" urx="430" ury="473"/>
<char name="cedilla" width="333" llx="68" lly="-218" urx="294" ury="0"/>
<char name="cent" width="500" llx="53" lly="-140" urx="458" ury="588"/>
<char name="circumflex" width="333" llx="-2" lly="528" urx="335" ury="704"/>
<char name="colon" width="333" llx="82" lly="-13" urx="251" ury="472"/>
<char name="comma" width="250" llx="39" lly="-180" urx="223" ury="155"/>
<char name="copyright" width="747" llx="26" lly="-19" urx="721" ury="691"/>
<char name="currency" width="500" llx="-26" lly="61" urx="526" ury="613"/>
<char name="d" width="556" llx="25" lly="-14" urx="534" ury="676"/>
<char name="dagger" width="500" llx="47" lly="-134" urx="453" ury="691"/>
<char name="daggerdbl" width="500" llx="45" lly="-132" urx="456" ury="691"/>
<char name="degree" width="400" llx="57" lly="402" urx="343" ury="688"/>
<char name="dieresis" width="333" llx="-2" lly="537" urx="335" ury="667"/>
<char name="divide" width="570" llx="33" lly="-31" urx="537" ury="537"/>
<char name="dollar" width="500" llx="29" lly="-99" urx="472" ury="750"/>
<char name="dotaccent" width="333" llx="103" lly="536" urx="258" ury="691"/>
<char name="dotlessi" width="278" llx="16" lly="0" urx="255" ury="461"/>
<char name="e" width="444" llx="25" lly="-14" urx="426" ury="473"/>
<char name="eacute" width="444" llx="25" lly="-14" urx="426" ury="713"/>
<char name="ecircumflex" width="444" llx="25" lly="-14" urx="426" ury="704"/>
<char name="edieresis" width="444" llx="25" lly="-14" urx="426" ury="667"/>
<char name="egrave" width="444" llx="25" lly="-14" urx="426" ury="713"/>
<char name="eight" width="500" llx="28" lly="-13" urx="472" ury="688"/>
<char name="ellipsis" width="1000" llx="82" lly="-13" urx="917" ury="156"/>
<char name="emdash" width="1000" llx="0" lly="181" urx="1000" ury="271"/>
<char name="endash" width="500" llx="0" lly="181" urx="500" ury="271"/>
<char name="equal" width="570" llx="33" lly="107" urx="537" ury="399"/>
<char name="eth" width="500" llx="25" lly="-14" urx="476" ury="691"/>
<char name="exclam" width="333" llx="81" lly="-13" urx="251" ury="691"/>
<char name="exclamdown" width="333" llx="82" lly="-203" urx="252" ury="501"/>
<char name="f" width="333" llx="14" lly="0" urx="389" ury="691"/>
<char name="fi" width="556" llx="14" lly="0" urx="536" ury="691"/>
<char name="five" width="500" llx="22" lly="-8" urx="470" ury="676"/>
<char name="fl" width="556" llx="14" lly="0" urx="536" ury="691"/>
<char name="florin" width="500" llx="0" lly="-155" urx="498" ury="706"/>
<char name="four" width="500" llx="19" lly="0" urx="475" ury="688"/>
<char name="fraction" width="167" llx="-168" lly="-12" urx="329" ury="688"/>
<char name="g" width="500" llx="28" lly="-206" urx="483" ury="473"/>
<char name="germandbls" width="556" llx="19" lly="-12" urx="517" ury="691"/>
<char name="grave" width="333" llx="8" lly="528" urx="246" ury="713"/>
<char name="greater" width="570" llx="31" lly="-8" urx="539" ury="514"/>
<char name="guillemotleft" width="500" llx="23" lly="36" urx="473" ury="415"/>
<char name="guillemotright" width="500" llx="27" lly="36" urx="477" ury="415"/>
<char name="guilsinglleft" width="333" llx="51" lly="36" urx="305" ury="415"/>
<char name="guilsinglright" width="333" llx="28" lly="36" urx="282" ury="415"/>
<char name="h" width="556" llx="16" lly="0" urx="534" ury="676"/>
<char name="hungarumlaut" width="333" llx="-13" lly="528" urx="425" ury="713"/>
<char name="hyphen" width="333" llx="44" lly="171" urx="287" ury="287"/>
<char name="i" width="278" llx="16" lly="0" urx="255" ury="691"/>
<char name="iacute" width="278" llx="16" lly="0" urx="289" ury="713"/>
<char name="icircumflex" width="278" llx="-37" lly="0" urx="300" ury="704"/>
<char name="idieresis" width="278" llx="-37" lly="0" urx="300" ury="667"/>
<char name="igrave" width="278" llx="-27" lly="0" urx="255" ury="713"/>
<char name="j" width="333" llx="-57" lly="-203" urx="263" ury="691"/>
<char name="k" width="556" llx="22" lly="0" urx="543" ury="676"/>
<char name="l" width="278" llx="16" lly="0" urx="255" ury="676"/>
<char name="less" width="570" llx="31" lly="-8" urx="539" ury="514"/>
<char name="logicalnot" width="570" llx="33" lly="108" urx="537" ury="399"/>
<char name="lslash" width="278" llx="-22" lly="0" urx="303" ury="676"/>
<char name="m" width="833" llx="16" lly="0" urx="814" ury="473"/>
<char name="macron" width="333" llx="1" lly="565" urx="331" ury="637"/>
<char name="minus" width="324" llx="33" lly="209" urx="537" ury="297"/>
<char name="mu" width="556" llx="33" lly="-206" urx="536" ury="461"/>
<char name="multiply" width="570" llx="48" lly="16" urx="522" ury="490"/>
<char name="n" width="556" llx="21" lly="0" urx="539" ury="473"/>
<char name="nine" width="500" llx="26" lly="-13" urx="473" ury="688"/>
<char name="ntilde" width="556" llx="21" lly="0" urx="539" ury="674"/>
<char name="numbersign" width="500" llx="4" lly="0" urx="496" ury="700"/>
<char name="o" width="500" llx="25" lly="-14" urx="476" ury="473"/>
<char name="oacute" width="500" llx="25" lly="-14" urx="476" ury="713"/>
<char name="ocircumflex" width="500" llx="25" lly="-14" urx="476" ury="704"/>
<char name="odieresis" width="500" llx="25" lly="-14" urx="476" ury="667"/>
<char name="oe" width="722" llx="22" lly="-14" urx="696" ury="473"/>
<char name="ogonek" width="333" llx="90" lly="-193" urx="319" ury="24"/>
<char name="ograve" width="500" llx="25" lly="-14" urx="476" ury="713"/>
<char name="one" width="500" llx="65" lly="0" urx="442" ury="688"/>
<char name="onehalf" width="750" llx="-7" lly="-12" urx="775" ury="688"/>
<char name="onequarter" width="750" llx="28" lly="-12" urx="743" ury="688"/>
<char name="onesuperior" width="300" llx="28" lly="275" urx="273" ury="688"/>
<char name="ordfeminine" width="300" llx="-1" lly="397" urx="301" ury="688"/>
<char name="ordmasculine" width="330" llx="18" lly="397" urx="312" ury="688"/>
<char name="oslash" width="500" llx="25" lly="-92" urx="476" ury="549"/>
<char name="otilde" width="500" llx="25" lly="-14" urx="476" ury="674"/>
<char name="p" width="556" llx="19" lly="-205" urx="524" ury="473"/>
<char name="paragraph" width="540" llx="0" lly="-186" urx="519" ury="676"/>
<char name="parenleft" width="333" llx="46" lly="-168" urx="306" ury="694"/>
<char name="parenright" width="333" llx="27" lly="-168" urx="287" ury="694"/>
<char name="percent" width="1000" llx="124" lly="-14" urx="877" ury="692"/>
<char name="period" width="250" llx="41" lly="-13" urx="210" ury="156"/>
<char name="periodcentered" width="250" llx="41" lly="248" urx="210" ury="417"/>
<char name="perthousand" width="1000" llx="7" lly="-29" urx="995" ury="706"/>
<char name="plus" width="570" llx="33" lly="0" urx="537" ury="506"/>
<char name="plusminus" width="570" llx="33" lly="0" urx="537" ury="506"/>
<char name="q" width="556" llx="34" lly="-205" urx="536" ury="473"/>
<char name="question" width="500" llx="57" lly="-13" urx="445" ury="689"/>
<char name="questiondown" width="500" llx="55" lly="-201" urx="443" ury="501"/>
<char name="quotedbl" width="555" llx="83" lly="404" urx="472" ury="691"/>
<char name="quotedblbase" width="500" llx="14" lly="-180" urx="468" ury="155"/>
<char name="quotedblleft" width="500" llx="32" lly="356" urx="486" ury="691"/>
<char name="quotedblright" width="500" llx="14" lly="356" urx="468" ury="691"/>
<char name="quoteleft" width="333" llx="70" lly="356" urx="254" ury="691"/>
<char name="quoteright" width="333" llx="79" lly="356" urx="263" ury="691"/>
<char name="quotesinglbase" width="333" llx="79" lly="-180" urx="263" ury="155"/>
<char name="quotesingle" width="278" llx="75" lly="404" urx="204" ury="691"/>
<char name="r" width="444" llx="29" lly="0" urx="434" ury="473"/>
<char name="registered" width="747" llx="26" lly="-19" urx="721" ury="691"/>
<char name="ring" width="333" llx="60" lly="527" urx="273" ury="740"/>
<char name="s" width="389" llx="25" lly="-14" urx="361" ury="473"/>
<char name="scaron" width="389" llx="25" lly="-14" urx="363" ury="704"/>
<char name="section" width="500" llx="57" lly="-132" urx="443" ury="691"/>
<char name="semicolon" width="333" llx="82" lly="-180" urx="266" ury="472"/>
<char name="seven" width="500" llx="17" lly="0" urx="477" ury="676"/>
<char name="six" width="500" llx="28" lly="-13" urx="475" ury="688"/>
<char name="slash" width="278" llx="-24" lly="-19" urx="302" ury="691"/>
<char name="space" width="250" llx="0" lly="0" urx="0" ury="0"/>
<!-- JKT: the following has been manually added -->
<char name="sterling" width="500" llx="21" lly="-14" urx="477" ury="684"/>
<char name="t" width="333" llx="20" lly="-12" urx="332" ury="630"/>
<char name="thorn" width="556" llx="19" lly="-205" urx="524" ury="676"/>
<char name="three" width="500" llx="16" lly="-14" urx="468" ury="688"/>
<char name="threequarters" width="750" llx="23" lly="-12" urx="733" ury="688"/>
<char name="threesuperior" width="300" llx="3" lly="268" urx="297" ury="688"/>
<char name="tilde" width="333" llx="-16" lly="547" urx="349" ury="674"/>
<char name="trademark" width="1000" llx="24" lly="271" urx="977" ury="676"/>
<char name="two" width="500" llx="17" lly="0" urx="478" ury="688"/>
<char name="twosuperior" width="300" llx="0" lly="275" urx="300" ury="688"/>
<char name="u" width="556" llx="16" lly="-14" urx="537" ury="461"/>
<char name="uacute" width="556" llx="16" lly="-14" urx="537" ury="713"/>
<char name="ucircumflex" width="556" llx="16" lly="-14" urx="537" ury="704"/>
<char name="udieresis" width="556" llx="16" lly="-14" urx="537" ury="667"/>
<char name="ugrave" width="556" llx="16" lly="-14" urx="537" ury="713"/>
<char name="underscore" width="500" llx="0" lly="-125" urx="500" ury="-75"/>
<char name="v" width="500" llx="21" lly="-14" urx="485" ury="461"/>
<char name="w" width="722" llx="23" lly="-14" urx="707" ury="461"/>
<char name="x" width="500" llx="12" lly="0" urx="484" ury="461"/>
<char name="y" width="500" llx="16" lly="-205" urx="480" ury="461"/>
<char name="yacute" width="500" llx="16" lly="-205" urx="480" ury="713"/>
<char name="ydieresis" width="500" llx="16" lly="-205" urx="480" ury="667"/>
<char name="yen" width="500" llx="-64" lly="0" urx="547" ury="676"/>
<char name="z" width="444" llx="21" lly="0" urx="420" ury="461"/>
<char name="zcaron" width="444" llx="21" lly="0" urx="420" ury="704"/>
<char name="zero" width="500" llx="24" lly="-13" urx="476" ury="688"/>
</char-metrics>
<kerning kpx1="79">
<pair kern="-40" kpx2="65"/>
<pair kern="-50" kpx2="87"/>
<pair kern="-50" kpx2="89"/>
<pair kern="-40" kpx2="84"/>
<pair kern="0" kpx2="46"/>
<pair kern="-50" kpx2="86"/>
<pair kern="-40" kpx2="88"/>
<pair kern="0" kpx2="44"/>
</kerning>
<kerning kpx1="107">
<pair kern="-15" kpx2="111"/>
<pair kern="-15" kpx2="121"/>
<pair kern="-10" kpx2="101"/>
</kerning>
<kerning kpx1="112">
<pair kern="0" kpx2="121"/>
</kerning>
<kerning kpx1="80">
<pair kern="-20" kpx2="111"/>
<pair kern="-10" kpx2="97"/>
<pair kern="-74" kpx2="65"/>
<pair kern="-110" kpx2="46"/>
<pair kern="-20" kpx2="101"/>
<pair kern="-92" kpx2="44"/>
</kerning>
<kerning kpx1="86">
<pair kern="-100" kpx2="111"/>
<pair kern="-45" kpx2="79"/>
<pair kern="-92" kpx2="58"/>
<pair kern="-30" kpx2="71"/>
<pair kern="-129" kpx2="44"/>
<pair kern="-92" kpx2="59"/>
<pair kern="-74" kpx2="45"/>
<pair kern="-37" kpx2="105"/>
<pair kern="-135" kpx2="65"/>
<pair kern="-92" kpx2="97"/>
<pair kern="-92" kpx2="117"/>
<pair kern="-145" kpx2="46"/>
<pair kern="-100" kpx2="101"/>
</kerning>
<kerning kpx1="118">
<pair kern="-10" kpx2="111"/>
<pair kern="-10" kpx2="97"/>
<pair kern="-70" kpx2="46"/>
<pair kern="-10" kpx2="101"/>
<pair kern="-55" kpx2="44"/>
</kerning>
<kerning kpx1="32">
<pair kern="-55" kpx2="65"/>
<pair kern="-30" kpx2="87"/>
<pair kern="0" kpx2="147"/>
<pair kern="-55" kpx2="89"/>
<pair kern="-30" kpx2="84"/>
<pair kern="0" kpx2="145"/>
<pair kern="-45" kpx2="86"/>
</kerning>
<kerning kpx1="97">
<pair kern="0" kpx2="119"/>
<pair kern="0" kpx2="116"/>
<pair kern="0" kpx2="121"/>
<pair kern="0" kpx2="112"/>
<pair kern="0" kpx2="103"/>
<pair kern="0" kpx2="98"/>
<pair kern="-25" kpx2="118"/>
</kerning>
<kerning kpx1="70">
<pair kern="-25" kpx2="111"/>
<pair kern="0" kpx2="105"/>
<pair kern="0" kpx2="114"/>
<pair kern="-25" kpx2="97"/>
<pair kern="-90" kpx2="65"/>
<pair kern="-110" kpx2="46"/>
<pair kern="-25" kpx2="101"/>
<pair kern="-92" kpx2="44"/>
</kerning>
<kerning kpx1="85">
<pair kern="-60" kpx2="65"/>
<pair kern="-50" kpx2="46"/>
<pair kern="-50" kpx2="44"/>
</kerning>
<kerning kpx1="100">
<pair kern="0" kpx2="100"/>
<pair kern="-15" kpx2="119"/>
<pair kern="0" kpx2="121"/>
<pair kern="0" kpx2="46"/>
<pair kern="0" kpx2="118"/>
<pair kern="0" kpx2="44"/>
</kerning>
<kerning kpx1="83">
<pair kern="0" kpx2="46"/>
<pair kern="0" kpx2="44"/>
</kerning>
<kerning kpx1="122">
<pair kern="0" kpx2="111"/>
<pair kern="0" kpx2="101"/>
</kerning>
<kerning kpx1="68">
<pair kern="-35" kpx2="65"/>
<pair kern="-40" kpx2="87"/>
<pair kern="-40" kpx2="89"/>
<pair kern="-20" kpx2="46"/>
<pair kern="-40" kpx2="86"/>
<pair kern="0" kpx2="44"/>
</kerning>
<kerning kpx1="146">
<pair kern="0" kpx2="148"/>
<pair kern="-20" kpx2="100"/>
<pair kern="-74" kpx2="32"/>
<pair kern="-63" kpx2="146"/>
<pair kern="-20" kpx2="114"/>
<pair kern="0" kpx2="116"/>
<pair kern="0" kpx2="108"/>
<pair kern="-37" kpx2="115"/>
<pair kern="-20" kpx2="118"/>
</kerning>
<kerning kpx1="58">
<pair kern="0" kpx2="32"/>
</kerning>
<kerning kpx1="119">
<pair kern="-10" kpx2="111"/>
<pair kern="0" kpx2="97"/>
<pair kern="0" kpx2="104"/>
<pair kern="-70" kpx2="46"/>
<pair kern="0" kpx2="101"/>
<pair kern="-55" kpx2="44"/>
</kerning>
<kerning kpx1="75">
<pair kern="-25" kpx2="111"/>
<pair kern="-30" kpx2="79"/>
<pair kern="-15" kpx2="117"/>
<pair kern="-45" kpx2="121"/>
<pair kern="-25" kpx2="101"/>
</kerning>
<kerning kpx1="82">
<pair kern="-30" kpx2="79"/>
<pair kern="-35" kpx2="87"/>
<pair kern="-30" kpx2="85"/>
<pair kern="-35" kpx2="89"/>
<pair kern="-40" kpx2="84"/>
<pair kern="-55" kpx2="86"/>
</kerning>
<kerning kpx1="145">
<pair kern="-10" kpx2="65"/>
<pair kern="-63" kpx2="145"/>
</kerning>
<kerning kpx1="103">
<pair kern="0" kpx2="111"/>
<pair kern="0" kpx2="105"/>
<pair kern="0" kpx2="114"/>
<pair kern="0" kpx2="97"/>
<pair kern="0" kpx2="121"/>
<pair kern="-15" kpx2="46"/>
<pair kern="0" kpx2="103"/>
<pair kern="0" kpx2="101"/>
<pair kern="0" kpx2="44"/>
</kerning>
<kerning kpx1="66">
<pair kern="-30" kpx2="65"/>
<pair kern="-10" kpx2="85"/>
<pair kern="0" kpx2="46"/>
<pair kern="0" kpx2="44"/>
</kerning>
<kerning kpx1="98">
<pair kern="-20" kpx2="117"/>
<pair kern="0" kpx2="121"/>
<pair kern="-40" kpx2="46"/>
<pair kern="0" kpx2="108"/>
<pair kern="-10" kpx2="98"/>
<pair kern="-15" kpx2="118"/>
<pair kern="0" kpx2="44"/>
</kerning>
<kerning kpx1="81">
<pair kern="-10" kpx2="85"/>
<pair kern="-20" kpx2="46"/>
<pair kern="0" kpx2="44"/>
</kerning>
<kerning kpx1="44">
<pair kern="-45" kpx2="148"/>
<pair kern="0" kpx2="32"/>
<pair kern="-55" kpx2="146"/>
</kerning>
<kerning kpx1="102">
<pair kern="50" kpx2="148"/>
<pair kern="-25" kpx2="111"/>
<pair kern="-25" kpx2="105"/>
<pair kern="55" kpx2="146"/>
<pair kern="0" kpx2="97"/>
<pair kern="0" kpx2="102"/>
<pair kern="-15" kpx2="46"/>
<pair kern="0" kpx2="108"/>
<pair kern="0" kpx2="101"/>
<pair kern="-15" kpx2="44"/>
</kerning>
<kerning kpx1="84">
<pair kern="-92" kpx2="111"/>
<pair kern="-18" kpx2="79"/>
<pair kern="-74" kpx2="119"/>
<pair kern="-74" kpx2="58"/>
<pair kern="-74" kpx2="114"/>
<pair kern="0" kpx2="104"/>
<pair kern="-74" kpx2="44"/>
<pair kern="-74" kpx2="59"/>
<pair kern="-92" kpx2="45"/>
<pair kern="-18" kpx2="105"/>
<pair kern="-90" kpx2="65"/>
<pair kern="-92" kpx2="97"/>
<pair kern="-92" kpx2="117"/>
<pair kern="-74" kpx2="121"/>
<pair kern="-90" kpx2="46"/>
<pair kern="-92" kpx2="101"/>
</kerning>
<kerning kpx1="121">
<pair kern="-25" kpx2="111"/>
<pair kern="0" kpx2="97"/>
<pair kern="-70" kpx2="46"/>
<pair kern="-10" kpx2="101"/>
<pair kern="-55" kpx2="44"/>
</kerning>
<kerning kpx1="120">
<pair kern="0" kpx2="101"/>
</kerning>
<kerning kpx1="101">
<pair kern="0" kpx2="119"/>
<pair kern="0" kpx2="121"/>
<pair kern="0" kpx2="112"/>
<pair kern="0" kpx2="46"/>
<pair kern="0" kpx2="103"/>
<pair kern="0" kpx2="98"/>
<pair kern="0" kpx2="120"/>
<pair kern="-15" kpx2="118"/>
<pair kern="0" kpx2="44"/>
</kerning>
<kerning kpx1="99">
<pair kern="0" kpx2="107"/>
<pair kern="0" kpx2="104"/>
<pair kern="0" kpx2="121"/>
<pair kern="0" kpx2="46"/>
<pair kern="0" kpx2="108"/>
<pair kern="0" kpx2="44"/>
</kerning>
<kerning kpx1="87">
<pair kern="-75" kpx2="111"/>
<pair kern="-10" kpx2="79"/>
<pair kern="-55" kpx2="58"/>
<pair kern="0" kpx2="104"/>
<pair kern="-92" kpx2="44"/>
<pair kern="-55" kpx2="59"/>
<pair kern="-37" kpx2="45"/>
<pair kern="-18" kpx2="105"/>
<pair kern="-120" kpx2="65"/>
<pair kern="-65" kpx2="97"/>
<pair kern="-50" kpx2="117"/>
<pair kern="-60" kpx2="121"/>
<pair kern="-92" kpx2="46"/>
<pair kern="-65" kpx2="101"/>
</kerning>
<kerning kpx1="104">
<pair kern="-15" kpx2="121"/>
</kerning>
<kerning kpx1="71">
<pair kern="0" kpx2="46"/>
<pair kern="0" kpx2="44"/>
</kerning>
<kerning kpx1="105">
<pair kern="-10" kpx2="118"/>
</kerning>
<kerning kpx1="65">
<pair kern="-45" kpx2="79"/>
<pair kern="-74" kpx2="146"/>
<pair kern="-90" kpx2="119"/>
<pair kern="-130" kpx2="87"/>
<pair kern="-55" kpx2="67"/>
<pair kern="-25" kpx2="112"/>
<pair kern="-45" kpx2="81"/>
<pair kern="-55" kpx2="71"/>
<pair kern="-145" kpx2="86"/>
<pair kern="-100" kpx2="118"/>
<pair kern="0" kpx2="148"/>
<pair kern="-50" kpx2="85"/>
<pair kern="-50" kpx2="117"/>
<pair kern="-100" kpx2="89"/>
<pair kern="-74" kpx2="121"/>
<pair kern="-95" kpx2="84"/>
</kerning>
<kerning kpx1="147">
<pair kern="-10" kpx2="65"/>
<pair kern="0" kpx2="145"/>
</kerning>
<kerning kpx1="78">
<pair kern="-20" kpx2="65"/>
<pair kern="0" kpx2="46"/>
<pair kern="0" kpx2="44"/>
</kerning>
<kerning kpx1="115">
<pair kern="0" kpx2="119"/>
</kerning>
<kerning kpx1="111">
<pair kern="-10" kpx2="119"/>
<pair kern="0" kpx2="121"/>
<pair kern="0" kpx2="103"/>
<pair kern="0" kpx2="120"/>
<pair kern="-10" kpx2="118"/>
</kerning>
<kerning kpx1="114">
<pair kern="-18" kpx2="111"/>
<pair kern="0" kpx2="100"/>
<pair kern="0" kpx2="107"/>
<pair kern="0" kpx2="114"/>
<pair kern="-18" kpx2="99"/>
<pair kern="-10" kpx2="112"/>
<pair kern="-10" kpx2="103"/>
<pair kern="0" kpx2="108"/>
<pair kern="-18" kpx2="113"/>
<pair kern="-10" kpx2="118"/>
<pair kern="-92" kpx2="44"/>
<pair kern="-37" kpx2="45"/>
<pair kern="0" kpx2="105"/>
<pair kern="0" kpx2="109"/>
<pair kern="0" kpx2="97"/>
<pair kern="0" kpx2="117"/>
<pair kern="0" kpx2="116"/>
<pair kern="0" kpx2="121"/>
<pair kern="-100" kpx2="46"/>
<pair kern="-15" kpx2="110"/>
<pair kern="0" kpx2="115"/>
<pair kern="-18" kpx2="101"/>
</kerning>
<kerning kpx1="108">
<pair kern="0" kpx2="119"/>
<pair kern="0" kpx2="121"/>
</kerning>
<kerning kpx1="76">
<pair kern="-20" kpx2="148"/>
<pair kern="-110" kpx2="146"/>
<pair kern="-92" kpx2="87"/>
<pair kern="-92" kpx2="89"/>
<pair kern="-55" kpx2="121"/>
<pair kern="-92" kpx2="84"/>
<pair kern="-92" kpx2="86"/>
</kerning>
<kerning kpx1="148">
<pair kern="0" kpx2="32"/>
</kerning>
<kerning kpx1="109">
<pair kern="0" kpx2="117"/>
<pair kern="0" kpx2="121"/>
</kerning>
<kerning kpx1="89">
<pair kern="-111" kpx2="111"/>
<pair kern="-92" kpx2="45"/>
<pair kern="-37" kpx2="105"/>
<pair kern="-35" kpx2="79"/>
<pair kern="-92" kpx2="58"/>
<pair kern="-85" kpx2="97"/>
<pair kern="-110" kpx2="65"/>
<pair kern="-92" kpx2="117"/>
<pair kern="-92" kpx2="46"/>
<pair kern="-111" kpx2="101"/>
<pair kern="-92" kpx2="59"/>
<pair kern="-92" kpx2="44"/>
</kerning>
<kerning kpx1="74">
<pair kern="-15" kpx2="111"/>
<pair kern="-15" kpx2="97"/>
<pair kern="-30" kpx2="65"/>
<pair kern="-15" kpx2="117"/>
<pair kern="-20" kpx2="46"/>
<pair kern="-15" kpx2="101"/>
<pair kern="0" kpx2="44"/>
</kerning>
<kerning kpx1="46">
<pair kern="-55" kpx2="148"/>
<pair kern="-55" kpx2="146"/>
</kerning>
<kerning kpx1="110">
<pair kern="0" kpx2="117"/>
<pair kern="0" kpx2="121"/>
<pair kern="-40" kpx2="118"/>
</kerning>
</font-metrics>
@@ -0,0 +1,645 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- $Id$ -->
<!-- JKT: these metrics in XML were kindly produced by Fotis Jannidis -->
<font-metrics>
<font-name>Times-BoldItalic</font-name>
<full-name>Times Bold Italic</full-name>
<family-name>Times</family-name>
<class-name>TimesBoldItalic</class-name>
<encoding>StandardEncoding</encoding>
<underline-position>-100</underline-position>
<underline-thickness>50</underline-thickness>
<cap-height>669</cap-height>
<x-height>462</x-height>
<ascender>699</ascender>
<descender>-205</descender>
<first-char>32</first-char>
<last-char>255</last-char>
<char-metrics>
<char name="A" width="667" llx="-67" lly="0" urx="593" ury="683"/>
<char name="AE" width="944" llx="-64" lly="0" urx="918" ury="669"/>
<char name="Aacute" width="667" llx="-67" lly="0" urx="593" ury="904"/>
<char name="Acircumflex" width="667" llx="-67" lly="0" urx="593" ury="897"/>
<char name="Adieresis" width="667" llx="-67" lly="0" urx="593" ury="862"/>
<char name="Agrave" width="667" llx="-67" lly="0" urx="593" ury="904"/>
<char name="Aring" width="667" llx="-67" lly="0" urx="593" ury="921"/>
<char name="Atilde" width="667" llx="-67" lly="0" urx="593" ury="862"/>
<char name="B" width="667" llx="-24" lly="0" urx="624" ury="669"/>
<char name="C" width="667" llx="32" lly="-18" urx="677" ury="685"/>
<char name="Ccedilla" width="667" llx="32" lly="-218" urx="677" ury="685"/>
<char name="D" width="722" llx="-46" lly="0" urx="685" ury="669"/>
<char name="E" width="667" llx="-27" lly="0" urx="653" ury="669"/>
<char name="Eacute" width="667" llx="-27" lly="0" urx="653" ury="904"/>
<char name="Ecircumflex" width="667" llx="-27" lly="0" urx="653" ury="897"/>
<char name="Edieresis" width="667" llx="-27" lly="0" urx="653" ury="862"/>
<char name="Egrave" width="667" llx="-27" lly="0" urx="653" ury="904"/>
<char name="Eth" width="722" llx="-31" lly="0" urx="700" ury="669"/>
<char name="Euro" width="500" llx="0" lly="0" urx="0" ury="0"/>
<char name="F" width="667" llx="-13" lly="0" urx="660" ury="669"/>
<char name="G" width="722" llx="21" lly="-18" urx="706" ury="685"/>
<char name="H" width="778" llx="-24" lly="0" urx="799" ury="669"/>
<char name="I" width="389" llx="-32" lly="0" urx="406" ury="669"/>
<char name="Iacute" width="389" llx="-32" lly="0" urx="432" ury="904"/>
<char name="Icircumflex" width="389" llx="-32" lly="0" urx="450" ury="897"/>
<char name="Idieresis" width="389" llx="-32" lly="0" urx="450" ury="862"/>
<char name="Igrave" width="389" llx="-32" lly="0" urx="406" ury="904"/>
<char name="J" width="500" llx="-46" lly="-99" urx="524" ury="669"/>
<char name="K" width="667" llx="-21" lly="0" urx="702" ury="669"/>
<char name="L" width="611" llx="-22" lly="0" urx="590" ury="669"/>
<char name="Lslash" width="611" llx="-22" lly="0" urx="590" ury="669"/>
<char name="M" width="889" llx="-29" lly="-12" urx="917" ury="669"/>
<char name="N" width="722" llx="-27" lly="-15" urx="748" ury="669"/>
<char name="Ntilde" width="722" llx="-27" lly="-15" urx="748" ury="862"/>
<char name="O" width="722" llx="27" lly="-18" urx="691" ury="685"/>
<char name="OE" width="944" llx="23" lly="-8" urx="946" ury="677"/>
<char name="Oacute" width="722" llx="27" lly="-18" urx="691" ury="904"/>
<char name="Ocircumflex" width="722" llx="27" lly="-18" urx="691" ury="897"/>
<char name="Odieresis" width="722" llx="27" lly="-18" urx="691" ury="862"/>
<char name="Ograve" width="722" llx="27" lly="-18" urx="691" ury="904"/>
<char name="Oslash" width="722" llx="27" lly="-125" urx="691" ury="764"/>
<char name="Otilde" width="722" llx="27" lly="-18" urx="691" ury="862"/>
<char name="P" width="611" llx="-27" lly="0" urx="613" ury="669"/>
<char name="Q" width="722" llx="27" lly="-208" urx="691" ury="685"/>
<char name="R" width="667" llx="-29" lly="0" urx="623" ury="669"/>
<char name="S" width="556" llx="2" lly="-18" urx="526" ury="685"/>
<char name="Scaron" width="556" llx="2" lly="-18" urx="553" ury="897"/>
<char name="T" width="611" llx="50" lly="0" urx="650" ury="669"/>
<char name="Thorn" width="611" llx="-27" lly="0" urx="573" ury="669"/>
<char name="U" width="722" llx="67" lly="-18" urx="744" ury="669"/>
<char name="Uacute" width="722" llx="67" lly="-18" urx="744" ury="904"/>
<char name="Ucircumflex" width="722" llx="67" lly="-18" urx="744" ury="897"/>
<char name="Udieresis" width="722" llx="67" lly="-18" urx="744" ury="862"/>
<char name="Ugrave" width="722" llx="67" lly="-18" urx="744" ury="904"/>
<char name="V" width="667" llx="65" lly="-18" urx="715" ury="669"/>
<char name="W" width="889" llx="65" lly="-18" urx="940" ury="669"/>
<char name="X" width="667" llx="-24" lly="0" urx="694" ury="669"/>
<char name="Y" width="611" llx="73" lly="0" urx="659" ury="669"/>
<char name="Yacute" width="611" llx="73" lly="0" urx="659" ury="904"/>
<char name="Ydieresis" width="611" llx="73" lly="0" urx="659" ury="862"/>
<char name="Z" width="611" llx="-11" lly="0" urx="590" ury="669"/>
<char name="Zcaron" width="611" llx="-11" lly="0" urx="590" ury="897"/>
<char name="a" width="500" llx="-21" lly="-14" urx="455" ury="462"/>
<char name="aacute" width="500" llx="-21" lly="-14" urx="463" ury="697"/>
<char name="acircumflex" width="500" llx="-21" lly="-14" urx="455" ury="690"/>
<char name="acute" width="333" llx="139" lly="516" urx="379" ury="697"/>
<char name="adieresis" width="500" llx="-21" lly="-14" urx="476" ury="655"/>
<char name="ae" width="722" llx="-5" lly="-13" urx="673" ury="462"/>
<char name="agrave" width="500" llx="-21" lly="-14" urx="455" ury="697"/>
<char name="ampersand" width="778" llx="5" lly="-19" urx="699" ury="682"/>
<char name="aring" width="500" llx="-21" lly="-14" urx="455" ury="729"/>
<char name="asciicircum" width="570" llx="67" lly="304" urx="503" ury="669"/>
<char name="asciitilde" width="570" llx="54" lly="173" urx="516" ury="333"/>
<char name="asterisk" width="500" llx="65" lly="249" urx="456" ury="685"/>
<char name="at" width="832" llx="63" lly="-18" urx="770" ury="685"/>
<char name="atilde" width="500" llx="-21" lly="-14" urx="491" ury="655"/>
<char name="b" width="500" llx="-14" lly="-13" urx="444" ury="699"/>
<char name="backslash" width="278" llx="-1" lly="-18" urx="279" ury="685"/>
<char name="bar" width="220" llx="66" lly="-218" urx="154" ury="782"/>
<char name="braceleft" width="348" llx="5" lly="-187" urx="436" ury="686"/>
<char name="braceright" width="348" llx="-129" lly="-187" urx="302" ury="686"/>
<char name="bracketleft" width="333" llx="-37" lly="-159" urx="362" ury="674"/>
<char name="bracketright" width="333" llx="-56" lly="-157" urx="343" ury="674"/>
<char name="breve" width="333" llx="71" lly="516" urx="387" ury="678"/>
<char name="brokenbar" width="220" llx="66" lly="-143" urx="154" ury="707"/>
<char name="bullet" width="350" llx="0" lly="175" urx="350" ury="525"/>
<char name="c" width="444" llx="-5" lly="-13" urx="392" ury="462"/>
<char name="caron" width="333" llx="79" lly="516" urx="411" ury="690"/>
<char name="ccedilla" width="444" llx="-5" lly="-218" urx="392" ury="462"/>
<char name="cedilla" width="333" llx="-80" lly="-218" urx="156" ury="5"/>
<char name="cent" width="500" llx="42" lly="-143" urx="439" ury="576"/>
<char name="circumflex" width="333" llx="40" lly="516" urx="367" ury="690"/>
<char name="colon" width="333" llx="23" lly="-13" urx="264" ury="459"/>
<char name="comma" width="250" llx="-60" lly="-182" urx="144" ury="134"/>
<char name="copyright" width="747" llx="30" lly="-18" urx="718" ury="685"/>
<char name="currency" width="500" llx="-26" lly="34" urx="526" ury="586"/>
<char name="d" width="500" llx="-21" lly="-13" urx="517" ury="699"/>
<char name="dagger" width="500" llx="91" lly="-145" urx="494" ury="685"/>
<char name="daggerdbl" width="500" llx="10" lly="-139" urx="493" ury="685"/>
<char name="degree" width="400" llx="83" lly="397" urx="369" ury="683"/>
<char name="dieresis" width="333" llx="55" lly="550" urx="402" ury="684"/>
<char name="divide" width="570" llx="33" lly="-29" urx="537" ury="535"/>
<char name="dollar" width="500" llx="-20" lly="-100" urx="497" ury="733"/>
<char name="dotaccent" width="333" llx="163" lly="550" urx="298" ury="684"/>
<char name="dotlessi" width="278" llx="2" lly="-9" urx="238" ury="462"/>
<char name="e" width="444" llx="5" lly="-13" urx="398" ury="462"/>
<char name="eacute" width="444" llx="5" lly="-13" urx="435" ury="697"/>
<char name="ecircumflex" width="444" llx="5" lly="-13" urx="423" ury="690"/>
<char name="edieresis" width="444" llx="5" lly="-13" urx="448" ury="655"/>
<char name="egrave" width="444" llx="5" lly="-13" urx="398" ury="697"/>
<char name="eight" width="500" llx="3" lly="-13" urx="476" ury="683"/>
<char name="ellipsis" width="1000" llx="40" lly="-13" urx="852" ury="135"/>
<char name="emdash" width="1000" llx="-40" lly="178" urx="977" ury="269"/>
<char name="endash" width="500" llx="-40" lly="178" urx="477" ury="269"/>
<char name="equal" width="570" llx="33" lly="107" urx="537" ury="399"/>
<char name="eth" width="500" llx="-3" lly="-13" urx="454" ury="699"/>
<char name="exclam" width="389" llx="67" lly="-13" urx="370" ury="684"/>
<char name="exclamdown" width="389" llx="19" lly="-205" urx="322" ury="492"/>
<char name="f" width="333" llx="-169" lly="-205" urx="446" ury="698"/>
<char name="fi" width="556" llx="-188" lly="-205" urx="514" ury="703"/>
<char name="five" width="500" llx="-11" lly="-13" urx="487" ury="669"/>
<char name="fl" width="556" llx="-186" lly="-205" urx="553" ury="704"/>
<char name="florin" width="500" llx="-87" lly="-156" urx="537" ury="707"/>
<char name="four" width="500" llx="-15" lly="0" urx="503" ury="683"/>
<char name="fraction" width="167" llx="-169" lly="-14" urx="324" ury="683"/>
<char name="g" width="500" llx="-52" lly="-203" urx="478" ury="462"/>
<char name="germandbls" width="500" llx="-200" lly="-200" urx="473" ury="705"/>
<char name="grave" width="333" llx="85" lly="516" urx="297" ury="697"/>
<char name="greater" width="570" llx="31" lly="-8" urx="539" ury="514"/>
<char name="guillemotleft" width="500" llx="12" lly="32" urx="468" ury="415"/>
<char name="guillemotright" width="500" llx="12" lly="32" urx="468" ury="415"/>
<char name="guilsinglleft" width="333" llx="32" lly="32" urx="303" ury="415"/>
<char name="guilsinglright" width="333" llx="10" lly="32" urx="281" ury="415"/>
<char name="h" width="556" llx="-13" lly="-9" urx="498" ury="699"/>
<char name="hungarumlaut" width="333" llx="69" lly="516" urx="498" ury="697"/>
<char name="hyphen" width="333" llx="2" lly="166" urx="271" ury="282"/>
<char name="i" width="278" llx="2" lly="-9" urx="263" ury="684"/>
<char name="iacute" width="278" llx="2" lly="-9" urx="352" ury="697"/>
<char name="icircumflex" width="278" llx="-3" lly="-9" urx="324" ury="690"/>
<char name="idieresis" width="278" llx="2" lly="-9" urx="364" ury="655"/>
<char name="igrave" width="278" llx="2" lly="-9" urx="259" ury="697"/>
<char name="j" width="278" llx="-189" lly="-207" urx="279" ury="684"/>
<char name="k" width="500" llx="-23" lly="-8" urx="483" ury="699"/>
<char name="l" width="278" llx="2" lly="-9" urx="290" ury="699"/>
<char name="less" width="570" llx="31" lly="-8" urx="539" ury="514"/>
<char name="logicalnot" width="606" llx="51" lly="108" urx="555" ury="399"/>
<char name="lslash" width="278" llx="-7" lly="-9" urx="307" ury="699"/>
<char name="m" width="778" llx="-14" lly="-9" urx="722" ury="462"/>
<char name="macron" width="333" llx="51" lly="553" urx="393" ury="623"/>
<char name="minus" width="330" llx="51" lly="209" urx="555" ury="297"/>
<char name="mu" width="576" llx="-60" lly="-207" urx="516" ury="449"/>
<char name="multiply" width="570" llx="48" lly="16" urx="522" ury="490"/>
<char name="n" width="556" llx="-6" lly="-9" urx="493" ury="462"/>
<char name="nine" width="500" llx="-12" lly="-10" urx="475" ury="683"/>
<char name="ntilde" width="556" llx="-6" lly="-9" urx="504" ury="655"/>
<char name="numbersign" width="500" llx="-33" lly="0" urx="533" ury="700"/>
<char name="o" width="500" llx="-3" lly="-13" urx="441" ury="462"/>
<char name="oacute" width="500" llx="-3" lly="-13" urx="463" ury="697"/>
<char name="ocircumflex" width="500" llx="-3" lly="-13" urx="451" ury="690"/>
<char name="odieresis" width="500" llx="-3" lly="-13" urx="471" ury="655"/>
<char name="oe" width="722" llx="6" lly="-13" urx="674" ury="462"/>
<char name="ogonek" width="333" llx="15" lly="-183" urx="244" ury="34"/>
<char name="ograve" width="500" llx="-3" lly="-13" urx="441" ury="697"/>
<char name="one" width="500" llx="5" lly="0" urx="419" ury="683"/>
<char name="onehalf" width="750" llx="-9" lly="-14" urx="723" ury="683"/>
<char name="onequarter" width="750" llx="7" lly="-14" urx="721" ury="683"/>
<char name="onesuperior" width="300" llx="30" lly="274" urx="301" ury="683"/>
<char name="ordfeminine" width="266" llx="16" lly="399" urx="330" ury="685"/>
<char name="ordmasculine" width="300" llx="56" lly="400" urx="347" ury="685"/>
<char name="oslash" width="500" llx="-3" lly="-119" urx="441" ury="560"/>
<char name="otilde" width="500" llx="-3" lly="-13" urx="491" ury="655"/>
<char name="p" width="500" llx="-120" lly="-205" urx="446" ury="462"/>
<char name="paragraph" width="500" llx="-57" lly="-193" urx="562" ury="669"/>
<char name="parenleft" width="333" llx="28" lly="-179" urx="344" ury="685"/>
<char name="parenright" width="333" llx="-44" lly="-179" urx="271" ury="685"/>
<char name="percent" width="833" llx="39" lly="-10" urx="793" ury="692"/>
<char name="period" width="250" llx="-9" lly="-13" urx="139" ury="135"/>
<char name="periodcentered" width="250" llx="51" lly="257" urx="199" ury="405"/>
<char name="perthousand" width="1000" llx="7" lly="-29" urx="996" ury="706"/>
<char name="plus" width="570" llx="33" lly="0" urx="537" ury="506"/>
<char name="plusminus" width="570" llx="33" lly="0" urx="537" ury="506"/>
<char name="q" width="500" llx="1" lly="-205" urx="471" ury="462"/>
<char name="question" width="500" llx="79" lly="-13" urx="470" ury="684"/>
<char name="questiondown" width="500" llx="30" lly="-205" urx="421" ury="492"/>
<char name="quotedbl" width="555" llx="136" lly="398" urx="536" ury="685"/>
<char name="quotedblbase" width="500" llx="-57" lly="-182" urx="403" ury="134"/>
<char name="quotedblleft" width="500" llx="53" lly="369" urx="513" ury="685"/>
<char name="quotedblright" width="500" llx="53" lly="369" urx="513" ury="685"/>
<char name="quoteleft" width="333" llx="128" lly="369" urx="332" ury="685"/>
<char name="quoteright" width="333" llx="98" lly="369" urx="302" ury="685"/>
<char name="quotesinglbase" width="333" llx="-5" lly="-182" urx="199" ury="134"/>
<char name="quotesingle" width="278" llx="128" lly="398" urx="268" ury="685"/>
<char name="r" width="389" llx="-21" lly="0" urx="389" ury="462"/>
<char name="registered" width="747" llx="30" lly="-18" urx="718" ury="685"/>
<char name="ring" width="333" llx="127" lly="516" urx="340" ury="729"/>
<char name="s" width="389" llx="-19" lly="-13" urx="333" ury="462"/>
<char name="scaron" width="389" llx="-19" lly="-13" urx="424" ury="690"/>
<char name="section" width="500" llx="36" lly="-143" urx="459" ury="685"/>
<char name="semicolon" width="333" llx="-25" lly="-183" urx="264" ury="459"/>
<char name="seven" width="500" llx="52" lly="0" urx="525" ury="669"/>
<char name="six" width="500" llx="23" lly="-15" urx="509" ury="679"/>
<char name="slash" width="278" llx="-64" lly="-18" urx="342" ury="685"/>
<char name="space" width="250" llx="0" lly="0" urx="0" ury="0"/>
<!-- JKT: the following has been manually added -->
<char name="sterling" width="500" llx="-32" lly="-12" urx="510" ury="683"/>
<char name="t" width="278" llx="-11" lly="-9" urx="281" ury="594"/>
<char name="thorn" width="500" llx="-120" lly="-205" urx="446" ury="699"/>
<char name="three" width="500" llx="-15" lly="-13" urx="450" ury="683"/>
<char name="threequarters" width="750" llx="7" lly="-14" urx="726" ury="683"/>
<char name="threesuperior" width="300" llx="17" lly="265" urx="321" ury="683"/>
<char name="tilde" width="333" llx="48" lly="536" urx="407" ury="655"/>
<char name="trademark" width="1000" llx="32" lly="263" urx="968" ury="669"/>
<char name="two" width="500" llx="-27" lly="0" urx="446" ury="683"/>
<char name="twosuperior" width="300" llx="2" lly="274" urx="313" ury="683"/>
<char name="u" width="556" llx="15" lly="-9" urx="492" ury="462"/>
<char name="uacute" width="556" llx="15" lly="-9" urx="492" ury="697"/>
<char name="ucircumflex" width="556" llx="15" lly="-9" urx="492" ury="690"/>
<char name="udieresis" width="556" llx="15" lly="-9" urx="499" ury="655"/>
<char name="ugrave" width="556" llx="15" lly="-9" urx="492" ury="697"/>
<char name="underscore" width="500" llx="0" lly="-125" urx="500" ury="-75"/>
<char name="v" width="444" llx="16" lly="-13" urx="401" ury="462"/>
<char name="w" width="667" llx="16" lly="-13" urx="614" ury="462"/>
<char name="x" width="500" llx="-46" lly="-13" urx="469" ury="462"/>
<char name="y" width="444" llx="-94" lly="-205" urx="392" ury="462"/>
<char name="yacute" width="444" llx="-94" lly="-205" urx="435" ury="697"/>
<char name="ydieresis" width="444" llx="-94" lly="-205" urx="443" ury="655"/>
<char name="yen" width="500" llx="33" lly="0" urx="628" ury="669"/>
<char name="z" width="389" llx="-43" lly="-78" urx="368" ury="449"/>
<char name="zcaron" width="389" llx="-43" lly="-78" urx="424" ury="690"/>
<char name="zero" width="500" llx="17" lly="-14" urx="477" ury="683"/>
</char-metrics>
<kerning kpx1="79">
<pair kern="-40" kpx2="65"/>
<pair kern="-50" kpx2="87"/>
<pair kern="-50" kpx2="89"/>
<pair kern="-40" kpx2="84"/>
<pair kern="0" kpx2="46"/>
<pair kern="-50" kpx2="86"/>
<pair kern="-40" kpx2="88"/>
<pair kern="0" kpx2="44"/>
</kerning>
<kerning kpx1="107">
<pair kern="-10" kpx2="111"/>
<pair kern="0" kpx2="121"/>
<pair kern="-30" kpx2="101"/>
</kerning>
<kerning kpx1="112">
<pair kern="0" kpx2="121"/>
</kerning>
<kerning kpx1="80">
<pair kern="-55" kpx2="111"/>
<pair kern="-40" kpx2="97"/>
<pair kern="-85" kpx2="65"/>
<pair kern="-129" kpx2="46"/>
<pair kern="-50" kpx2="101"/>
<pair kern="-129" kpx2="44"/>
</kerning>
<kerning kpx1="86">
<pair kern="-111" kpx2="111"/>
<pair kern="-30" kpx2="79"/>
<pair kern="-74" kpx2="58"/>
<pair kern="-10" kpx2="71"/>
<pair kern="-129" kpx2="44"/>
<pair kern="-74" kpx2="59"/>
<pair kern="-70" kpx2="45"/>
<pair kern="-55" kpx2="105"/>
<pair kern="-85" kpx2="65"/>
<pair kern="-111" kpx2="97"/>
<pair kern="-55" kpx2="117"/>
<pair kern="-129" kpx2="46"/>
<pair kern="-111" kpx2="101"/>
</kerning>
<kerning kpx1="118">
<pair kern="-15" kpx2="111"/>
<pair kern="0" kpx2="97"/>
<pair kern="-37" kpx2="46"/>
<pair kern="-15" kpx2="101"/>
<pair kern="-37" kpx2="44"/>
</kerning>
<kerning kpx1="32">
<pair kern="-37" kpx2="65"/>
<pair kern="-70" kpx2="87"/>
<pair kern="0" kpx2="147"/>
<pair kern="-70" kpx2="89"/>
<pair kern="0" kpx2="84"/>
<pair kern="0" kpx2="145"/>
<pair kern="-70" kpx2="86"/>
</kerning>
<kerning kpx1="97">
<pair kern="0" kpx2="119"/>
<pair kern="0" kpx2="116"/>
<pair kern="0" kpx2="121"/>
<pair kern="0" kpx2="112"/>
<pair kern="0" kpx2="103"/>
<pair kern="0" kpx2="98"/>
<pair kern="0" kpx2="118"/>
</kerning>
<kerning kpx1="70">
<pair kern="-70" kpx2="111"/>
<pair kern="-40" kpx2="105"/>
<pair kern="-50" kpx2="114"/>
<pair kern="-95" kpx2="97"/>
<pair kern="-100" kpx2="65"/>
<pair kern="-129" kpx2="46"/>
<pair kern="-100" kpx2="101"/>
<pair kern="-129" kpx2="44"/>
</kerning>
<kerning kpx1="85">
<pair kern="-45" kpx2="65"/>
<pair kern="0" kpx2="46"/>
<pair kern="0" kpx2="44"/>
</kerning>
<kerning kpx1="100">
<pair kern="0" kpx2="100"/>
<pair kern="0" kpx2="119"/>
<pair kern="0" kpx2="121"/>
<pair kern="0" kpx2="46"/>
<pair kern="0" kpx2="118"/>
<pair kern="0" kpx2="44"/>
</kerning>
<kerning kpx1="83">
<pair kern="0" kpx2="46"/>
<pair kern="0" kpx2="44"/>
</kerning>
<kerning kpx1="122">
<pair kern="0" kpx2="111"/>
<pair kern="0" kpx2="101"/>
</kerning>
<kerning kpx1="68">
<pair kern="-25" kpx2="65"/>
<pair kern="-40" kpx2="87"/>
<pair kern="-50" kpx2="89"/>
<pair kern="0" kpx2="46"/>
<pair kern="-50" kpx2="86"/>
<pair kern="0" kpx2="44"/>
</kerning>
<kerning kpx1="146">
<pair kern="0" kpx2="148"/>
<pair kern="-15" kpx2="100"/>
<pair kern="-74" kpx2="32"/>
<pair kern="-74" kpx2="146"/>
<pair kern="-15" kpx2="114"/>
<pair kern="-37" kpx2="116"/>
<pair kern="0" kpx2="108"/>
<pair kern="-74" kpx2="115"/>
<pair kern="-15" kpx2="118"/>
</kerning>
<kerning kpx1="58">
<pair kern="0" kpx2="32"/>
</kerning>
<kerning kpx1="119">
<pair kern="-15" kpx2="111"/>
<pair kern="-10" kpx2="97"/>
<pair kern="0" kpx2="104"/>
<pair kern="-37" kpx2="46"/>
<pair kern="-10" kpx2="101"/>
<pair kern="-37" kpx2="44"/>
</kerning>
<kerning kpx1="75">
<pair kern="-25" kpx2="111"/>
<pair kern="-30" kpx2="79"/>
<pair kern="-20" kpx2="117"/>
<pair kern="-20" kpx2="121"/>
<pair kern="-25" kpx2="101"/>
</kerning>
<kerning kpx1="82">
<pair kern="-40" kpx2="79"/>
<pair kern="-18" kpx2="87"/>
<pair kern="-40" kpx2="85"/>
<pair kern="-18" kpx2="89"/>
<pair kern="-30" kpx2="84"/>
<pair kern="-18" kpx2="86"/>
</kerning>
<kerning kpx1="145">
<pair kern="0" kpx2="65"/>
<pair kern="-74" kpx2="145"/>
</kerning>
<kerning kpx1="103">
<pair kern="0" kpx2="111"/>
<pair kern="0" kpx2="105"/>
<pair kern="0" kpx2="114"/>
<pair kern="0" kpx2="97"/>
<pair kern="0" kpx2="121"/>
<pair kern="0" kpx2="46"/>
<pair kern="0" kpx2="103"/>
<pair kern="0" kpx2="101"/>
<pair kern="0" kpx2="44"/>
</kerning>
<kerning kpx1="66">
<pair kern="-25" kpx2="65"/>
<pair kern="-10" kpx2="85"/>
<pair kern="0" kpx2="46"/>
<pair kern="0" kpx2="44"/>
</kerning>
<kerning kpx1="98">
<pair kern="-20" kpx2="117"/>
<pair kern="0" kpx2="121"/>
<pair kern="-40" kpx2="46"/>
<pair kern="0" kpx2="108"/>
<pair kern="-10" kpx2="98"/>
<pair kern="0" kpx2="118"/>
<pair kern="0" kpx2="44"/>
</kerning>
<kerning kpx1="81">
<pair kern="-10" kpx2="85"/>
<pair kern="0" kpx2="46"/>
<pair kern="0" kpx2="44"/>
</kerning>
<kerning kpx1="44">
<pair kern="-95" kpx2="148"/>
<pair kern="0" kpx2="32"/>
<pair kern="-95" kpx2="146"/>
</kerning>
<kerning kpx1="102">
<pair kern="0" kpx2="148"/>
<pair kern="-10" kpx2="111"/>
<pair kern="0" kpx2="105"/>
<pair kern="55" kpx2="146"/>
<pair kern="0" kpx2="97"/>
<pair kern="-18" kpx2="102"/>
<pair kern="-10" kpx2="46"/>
<pair kern="0" kpx2="108"/>
<pair kern="-10" kpx2="101"/>
<pair kern="-10" kpx2="44"/>
</kerning>
<kerning kpx1="84">
<pair kern="-95" kpx2="111"/>
<pair kern="-18" kpx2="79"/>
<pair kern="-37" kpx2="119"/>
<pair kern="-74" kpx2="58"/>
<pair kern="-37" kpx2="114"/>
<pair kern="0" kpx2="104"/>
<pair kern="-92" kpx2="44"/>
<pair kern="-74" kpx2="59"/>
<pair kern="-92" kpx2="45"/>
<pair kern="-37" kpx2="105"/>
<pair kern="-55" kpx2="65"/>
<pair kern="-92" kpx2="97"/>
<pair kern="-37" kpx2="117"/>
<pair kern="-37" kpx2="121"/>
<pair kern="-92" kpx2="46"/>
<pair kern="-92" kpx2="101"/>
</kerning>
<kerning kpx1="121">
<pair kern="0" kpx2="111"/>
<pair kern="0" kpx2="97"/>
<pair kern="-37" kpx2="46"/>
<pair kern="0" kpx2="101"/>
<pair kern="-37" kpx2="44"/>
</kerning>
<kerning kpx1="120">
<pair kern="-10" kpx2="101"/>
</kerning>
<kerning kpx1="101">
<pair kern="0" kpx2="119"/>
<pair kern="0" kpx2="121"/>
<pair kern="0" kpx2="112"/>
<pair kern="0" kpx2="46"/>
<pair kern="0" kpx2="103"/>
<pair kern="-10" kpx2="98"/>
<pair kern="0" kpx2="120"/>
<pair kern="0" kpx2="118"/>
<pair kern="0" kpx2="44"/>
</kerning>
<kerning kpx1="99">
<pair kern="-10" kpx2="107"/>
<pair kern="-10" kpx2="104"/>
<pair kern="0" kpx2="121"/>
<pair kern="0" kpx2="46"/>
<pair kern="0" kpx2="108"/>
<pair kern="0" kpx2="44"/>
</kerning>
<kerning kpx1="87">
<pair kern="-80" kpx2="111"/>
<pair kern="-15" kpx2="79"/>
<pair kern="-55" kpx2="58"/>
<pair kern="0" kpx2="104"/>
<pair kern="-74" kpx2="44"/>
<pair kern="-55" kpx2="59"/>
<pair kern="-50" kpx2="45"/>
<pair kern="-37" kpx2="105"/>
<pair kern="-74" kpx2="65"/>
<pair kern="-85" kpx2="97"/>
<pair kern="-55" kpx2="117"/>
<pair kern="-55" kpx2="121"/>
<pair kern="-74" kpx2="46"/>
<pair kern="-90" kpx2="101"/>
</kerning>
<kerning kpx1="104">
<pair kern="0" kpx2="121"/>
</kerning>
<kerning kpx1="71">
<pair kern="0" kpx2="46"/>
<pair kern="0" kpx2="44"/>
</kerning>
<kerning kpx1="105">
<pair kern="0" kpx2="118"/>
</kerning>
<kerning kpx1="65">
<pair kern="-50" kpx2="79"/>
<pair kern="-74" kpx2="146"/>
<pair kern="-74" kpx2="119"/>
<pair kern="-100" kpx2="87"/>
<pair kern="-65" kpx2="67"/>
<pair kern="0" kpx2="112"/>
<pair kern="-55" kpx2="81"/>
<pair kern="-60" kpx2="71"/>
<pair kern="-95" kpx2="86"/>
<pair kern="-74" kpx2="118"/>
<pair kern="0" kpx2="148"/>
<pair kern="-50" kpx2="85"/>
<pair kern="-30" kpx2="117"/>
<pair kern="-70" kpx2="89"/>
<pair kern="-74" kpx2="121"/>
<pair kern="-55" kpx2="84"/>
</kerning>
<kerning kpx1="147">
<pair kern="0" kpx2="65"/>
<pair kern="0" kpx2="145"/>
</kerning>
<kerning kpx1="78">
<pair kern="-30" kpx2="65"/>
<pair kern="0" kpx2="46"/>
<pair kern="0" kpx2="44"/>
</kerning>
<kerning kpx1="115">
<pair kern="0" kpx2="119"/>
</kerning>
<kerning kpx1="111">
<pair kern="-25" kpx2="119"/>
<pair kern="-10" kpx2="121"/>
<pair kern="0" kpx2="103"/>
<pair kern="-10" kpx2="120"/>
<pair kern="-15" kpx2="118"/>
</kerning>
<kerning kpx1="114">
<pair kern="0" kpx2="111"/>
<pair kern="0" kpx2="100"/>
<pair kern="0" kpx2="107"/>
<pair kern="0" kpx2="114"/>
<pair kern="0" kpx2="99"/>
<pair kern="0" kpx2="112"/>
<pair kern="0" kpx2="103"/>
<pair kern="0" kpx2="108"/>
<pair kern="0" kpx2="113"/>
<pair kern="0" kpx2="118"/>
<pair kern="-65" kpx2="44"/>
<pair kern="0" kpx2="45"/>
<pair kern="0" kpx2="105"/>
<pair kern="0" kpx2="109"/>
<pair kern="0" kpx2="97"/>
<pair kern="0" kpx2="117"/>
<pair kern="0" kpx2="116"/>
<pair kern="0" kpx2="121"/>
<pair kern="-65" kpx2="46"/>
<pair kern="0" kpx2="110"/>
<pair kern="0" kpx2="115"/>
<pair kern="0" kpx2="101"/>
</kerning>
<kerning kpx1="108">
<pair kern="0" kpx2="119"/>
<pair kern="0" kpx2="121"/>
</kerning>
<kerning kpx1="76">
<pair kern="0" kpx2="148"/>
<pair kern="-55" kpx2="146"/>
<pair kern="-37" kpx2="87"/>
<pair kern="-37" kpx2="89"/>
<pair kern="-37" kpx2="121"/>
<pair kern="-18" kpx2="84"/>
<pair kern="-37" kpx2="86"/>
</kerning>
<kerning kpx1="148">
<pair kern="0" kpx2="32"/>
</kerning>
<kerning kpx1="109">
<pair kern="0" kpx2="117"/>
<pair kern="0" kpx2="121"/>
</kerning>
<kerning kpx1="89">
<pair kern="-111" kpx2="111"/>
<pair kern="-92" kpx2="45"/>
<pair kern="-55" kpx2="105"/>
<pair kern="-25" kpx2="79"/>
<pair kern="-92" kpx2="58"/>
<pair kern="-92" kpx2="97"/>
<pair kern="-74" kpx2="65"/>
<pair kern="-92" kpx2="117"/>
<pair kern="-74" kpx2="46"/>
<pair kern="-111" kpx2="101"/>
<pair kern="-92" kpx2="59"/>
<pair kern="-92" kpx2="44"/>
</kerning>
<kerning kpx1="74">
<pair kern="-40" kpx2="111"/>
<pair kern="-40" kpx2="97"/>
<pair kern="-25" kpx2="65"/>
<pair kern="-40" kpx2="117"/>
<pair kern="-10" kpx2="46"/>
<pair kern="-40" kpx2="101"/>
<pair kern="-10" kpx2="44"/>
</kerning>
<kerning kpx1="46">
<pair kern="-95" kpx2="148"/>
<pair kern="-95" kpx2="146"/>
</kerning>
<kerning kpx1="110">
<pair kern="0" kpx2="117"/>
<pair kern="0" kpx2="121"/>
<pair kern="-40" kpx2="118"/>
</kerning>
</font-metrics>
@@ -0,0 +1,645 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- $Id$ -->
<!-- JKT: these metrics in XML were kindly produced by Fotis Jannidis -->
<font-metrics>
<font-name>Times-Italic</font-name>
<full-name>Times Italic</full-name>
<family-name>Times</family-name>
<class-name>TimesItalic</class-name>
<encoding>StandardEncoding</encoding>
<underline-position>-100</underline-position>
<underline-thickness>50</underline-thickness>
<cap-height>653</cap-height>
<x-height>441</x-height>
<ascender>683</ascender>
<descender>-205</descender>
<first-char>32</first-char>
<last-char>255</last-char>
<char-metrics>
<char name="A" width="611" llx="-51" lly="0" urx="564" ury="668"/>
<char name="AE" width="889" llx="-27" lly="0" urx="911" ury="653"/>
<char name="Aacute" width="611" llx="-51" lly="0" urx="564" ury="876"/>
<char name="Acircumflex" width="611" llx="-51" lly="0" urx="564" ury="873"/>
<char name="Adieresis" width="611" llx="-51" lly="0" urx="564" ury="818"/>
<char name="Agrave" width="611" llx="-51" lly="0" urx="564" ury="876"/>
<char name="Aring" width="611" llx="-51" lly="0" urx="564" ury="883"/>
<char name="Atilde" width="611" llx="-51" lly="0" urx="566" ury="836"/>
<char name="B" width="611" llx="-8" lly="0" urx="588" ury="653"/>
<char name="C" width="667" llx="66" lly="-18" urx="689" ury="666"/>
<char name="Ccedilla" width="667" llx="66" lly="-217" urx="689" ury="666"/>
<char name="D" width="722" llx="-8" lly="0" urx="700" ury="653"/>
<char name="E" width="611" llx="-1" lly="0" urx="634" ury="653"/>
<char name="Eacute" width="611" llx="-1" lly="0" urx="634" ury="876"/>
<char name="Ecircumflex" width="611" llx="-1" lly="0" urx="634" ury="873"/>
<char name="Edieresis" width="611" llx="-1" lly="0" urx="634" ury="818"/>
<char name="Egrave" width="611" llx="-1" lly="0" urx="634" ury="876"/>
<char name="Eth" width="722" llx="-8" lly="0" urx="700" ury="653"/>
<char name="Euro" width="500" llx="0" lly="0" urx="0" ury="0"/>
<char name="F" width="611" llx="8" lly="0" urx="645" ury="653"/>
<char name="G" width="722" llx="52" lly="-18" urx="722" ury="666"/>
<char name="H" width="722" llx="-8" lly="0" urx="767" ury="653"/>
<char name="I" width="333" llx="-8" lly="0" urx="384" ury="653"/>
<char name="Iacute" width="333" llx="-8" lly="0" urx="433" ury="876"/>
<char name="Icircumflex" width="333" llx="-8" lly="0" urx="425" ury="873"/>
<char name="Idieresis" width="333" llx="-8" lly="0" urx="435" ury="818"/>
<char name="Igrave" width="333" llx="-8" lly="0" urx="384" ury="876"/>
<char name="J" width="444" llx="-6" lly="-18" urx="491" ury="653"/>
<char name="K" width="667" llx="7" lly="0" urx="722" ury="653"/>
<char name="L" width="556" llx="-8" lly="0" urx="559" ury="653"/>
<char name="Lslash" width="556" llx="-8" lly="0" urx="559" ury="653"/>
<char name="M" width="833" llx="-18" lly="0" urx="873" ury="653"/>
<char name="N" width="667" llx="-20" lly="-15" urx="727" ury="653"/>
<char name="Ntilde" width="667" llx="-20" lly="-15" urx="727" ury="836"/>
<char name="O" width="722" llx="60" lly="-18" urx="699" ury="666"/>
<char name="OE" width="944" llx="49" lly="-8" urx="964" ury="666"/>
<char name="Oacute" width="722" llx="60" lly="-18" urx="699" ury="876"/>
<char name="Ocircumflex" width="722" llx="60" lly="-18" urx="699" ury="873"/>
<char name="Odieresis" width="722" llx="60" lly="-18" urx="699" ury="818"/>
<char name="Ograve" width="722" llx="60" lly="-18" urx="699" ury="876"/>
<char name="Oslash" width="722" llx="60" lly="-105" urx="699" ury="722"/>
<char name="Otilde" width="722" llx="60" lly="-18" urx="699" ury="836"/>
<char name="P" width="611" llx="0" lly="0" urx="605" ury="653"/>
<char name="Q" width="722" llx="59" lly="-182" urx="699" ury="666"/>
<char name="R" width="611" llx="-13" lly="0" urx="588" ury="653"/>
<char name="S" width="500" llx="17" lly="-18" urx="508" ury="667"/>
<char name="Scaron" width="500" llx="17" lly="-18" urx="520" ury="873"/>
<char name="T" width="556" llx="59" lly="0" urx="633" ury="653"/>
<char name="Thorn" width="611" llx="0" lly="0" urx="569" ury="653"/>
<char name="U" width="722" llx="102" lly="-18" urx="765" ury="653"/>
<char name="Uacute" width="722" llx="102" lly="-18" urx="765" ury="876"/>
<char name="Ucircumflex" width="722" llx="102" lly="-18" urx="765" ury="873"/>
<char name="Udieresis" width="722" llx="102" lly="-18" urx="765" ury="818"/>
<char name="Ugrave" width="722" llx="102" lly="-18" urx="765" ury="876"/>
<char name="V" width="611" llx="76" lly="-18" urx="688" ury="653"/>
<char name="W" width="833" llx="71" lly="-18" urx="906" ury="653"/>
<char name="X" width="611" llx="-29" lly="0" urx="655" ury="653"/>
<char name="Y" width="556" llx="78" lly="0" urx="633" ury="653"/>
<char name="Yacute" width="556" llx="78" lly="0" urx="633" ury="876"/>
<char name="Ydieresis" width="556" llx="78" lly="0" urx="633" ury="818"/>
<char name="Z" width="556" llx="-6" lly="0" urx="606" ury="653"/>
<char name="Zcaron" width="556" llx="-6" lly="0" urx="606" ury="873"/>
<char name="a" width="500" llx="17" lly="-11" urx="476" ury="441"/>
<char name="aacute" width="500" llx="17" lly="-11" urx="487" ury="664"/>
<char name="acircumflex" width="500" llx="17" lly="-11" urx="476" ury="661"/>
<char name="acute" width="333" llx="180" lly="494" urx="403" ury="664"/>
<char name="adieresis" width="500" llx="17" lly="-11" urx="489" ury="606"/>
<char name="ae" width="667" llx="23" lly="-11" urx="640" ury="441"/>
<char name="agrave" width="500" llx="17" lly="-11" urx="476" ury="664"/>
<char name="ampersand" width="778" llx="76" lly="-18" urx="723" ury="666"/>
<char name="aring" width="500" llx="17" lly="-11" urx="476" ury="691"/>
<char name="asciicircum" width="422" llx="0" lly="301" urx="422" ury="666"/>
<char name="asciitilde" width="541" llx="40" lly="183" urx="502" ury="323"/>
<char name="asterisk" width="500" llx="128" lly="255" urx="492" ury="666"/>
<char name="at" width="920" llx="118" lly="-18" urx="806" ury="666"/>
<char name="atilde" width="500" llx="17" lly="-11" urx="511" ury="624"/>
<char name="b" width="500" llx="23" lly="-11" urx="473" ury="683"/>
<char name="backslash" width="278" llx="-41" lly="-18" urx="319" ury="666"/>
<char name="bar" width="275" llx="105" lly="-217" urx="171" ury="783"/>
<char name="braceleft" width="400" llx="51" lly="-177" urx="407" ury="687"/>
<char name="braceright" width="400" llx="-7" lly="-177" urx="349" ury="687"/>
<char name="bracketleft" width="389" llx="21" lly="-153" urx="391" ury="663"/>
<char name="bracketright" width="389" llx="12" lly="-153" urx="382" ury="663"/>
<char name="breve" width="333" llx="117" lly="492" urx="418" ury="650"/>
<char name="brokenbar" width="275" llx="105" lly="-142" urx="171" ury="708"/>
<char name="bullet" width="350" llx="40" lly="191" urx="310" ury="461"/>
<char name="c" width="444" llx="30" lly="-11" urx="425" ury="441"/>
<char name="caron" width="333" llx="121" lly="492" urx="426" ury="661"/>
<char name="ccedilla" width="444" llx="30" lly="-217" urx="425" ury="441"/>
<char name="cedilla" width="333" llx="-30" lly="-217" urx="182" ury="0"/>
<char name="cent" width="500" llx="77" lly="-143" urx="472" ury="560"/>
<char name="circumflex" width="333" llx="91" lly="492" urx="385" ury="661"/>
<char name="colon" width="333" llx="50" lly="-11" urx="261" ury="441"/>
<char name="comma" width="250" llx="-4" lly="-129" urx="135" ury="101"/>
<char name="copyright" width="760" llx="41" lly="-18" urx="719" ury="666"/>
<char name="currency" width="500" llx="-22" lly="53" urx="522" ury="597"/>
<char name="d" width="500" llx="15" lly="-13" urx="527" ury="683"/>
<char name="dagger" width="500" llx="101" lly="-159" urx="488" ury="666"/>
<char name="daggerdbl" width="500" llx="22" lly="-143" urx="491" ury="666"/>
<char name="degree" width="400" llx="101" lly="390" urx="387" ury="676"/>
<char name="dieresis" width="333" llx="107" lly="548" urx="405" ury="646"/>
<char name="divide" width="675" llx="86" lly="-11" urx="590" ury="517"/>
<char name="dollar" width="500" llx="31" lly="-89" urx="497" ury="731"/>
<char name="dotaccent" width="333" llx="207" lly="548" urx="305" ury="646"/>
<char name="dotlessi" width="278" llx="49" lly="-11" urx="235" ury="441"/>
<char name="e" width="444" llx="31" lly="-11" urx="412" ury="441"/>
<char name="eacute" width="444" llx="31" lly="-11" urx="459" ury="664"/>
<char name="ecircumflex" width="444" llx="31" lly="-11" urx="441" ury="661"/>
<char name="edieresis" width="444" llx="31" lly="-11" urx="451" ury="606"/>
<char name="egrave" width="444" llx="31" lly="-11" urx="412" ury="664"/>
<char name="eight" width="500" llx="30" lly="-7" urx="493" ury="676"/>
<char name="ellipsis" width="889" llx="57" lly="-11" urx="762" ury="100"/>
<char name="emdash" width="889" llx="-6" lly="197" urx="894" ury="243"/>
<char name="endash" width="500" llx="-6" lly="197" urx="505" ury="243"/>
<char name="equal" width="675" llx="86" lly="120" urx="590" ury="386"/>
<char name="eth" width="500" llx="27" lly="-11" urx="482" ury="683"/>
<char name="exclam" width="333" llx="39" lly="-11" urx="302" ury="667"/>
<char name="exclamdown" width="389" llx="59" lly="-205" urx="322" ury="473"/>
<char name="f" width="278" llx="-147" lly="-207" urx="424" ury="678"/>
<char name="fi" width="500" llx="-141" lly="-207" urx="481" ury="681"/>
<char name="five" width="500" llx="15" lly="-7" urx="491" ury="666"/>
<char name="fl" width="500" llx="-141" lly="-204" urx="518" ury="682"/>
<char name="florin" width="500" llx="25" lly="-182" urx="507" ury="682"/>
<char name="four" width="500" llx="1" lly="0" urx="479" ury="676"/>
<char name="fraction" width="167" llx="-169" lly="-10" urx="337" ury="676"/>
<char name="g" width="500" llx="8" lly="-206" urx="472" ury="441"/>
<char name="germandbls" width="500" llx="-168" lly="-207" urx="493" ury="679"/>
<char name="grave" width="333" llx="121" lly="492" urx="311" ury="664"/>
<char name="greater" width="675" llx="84" lly="-8" urx="592" ury="514"/>
<char name="guillemotleft" width="500" llx="53" lly="37" urx="445" ury="403"/>
<char name="guillemotright" width="500" llx="55" lly="37" urx="447" ury="403"/>
<char name="guilsinglleft" width="333" llx="51" lly="37" urx="281" ury="403"/>
<char name="guilsinglright" width="333" llx="52" lly="37" urx="282" ury="403"/>
<char name="h" width="500" llx="19" lly="-9" urx="478" ury="683"/>
<char name="hungarumlaut" width="333" llx="93" lly="494" urx="486" ury="664"/>
<char name="hyphen" width="333" llx="49" lly="192" urx="282" ury="255"/>
<char name="i" width="278" llx="49" lly="-11" urx="264" ury="654"/>
<char name="iacute" width="278" llx="49" lly="-11" urx="355" ury="664"/>
<char name="icircumflex" width="278" llx="33" lly="-11" urx="327" ury="661"/>
<char name="idieresis" width="278" llx="49" lly="-11" urx="352" ury="606"/>
<char name="igrave" width="278" llx="49" lly="-11" urx="284" ury="664"/>
<char name="j" width="278" llx="-124" lly="-207" urx="276" ury="654"/>
<char name="k" width="444" llx="14" lly="-11" urx="461" ury="683"/>
<char name="l" width="278" llx="41" lly="-11" urx="279" ury="683"/>
<char name="less" width="675" llx="84" lly="-8" urx="592" ury="514"/>
<char name="logicalnot" width="675" llx="86" lly="108" urx="590" ury="386"/>
<char name="lslash" width="278" llx="41" lly="-11" urx="312" ury="683"/>
<char name="m" width="722" llx="12" lly="-9" urx="704" ury="441"/>
<char name="macron" width="333" llx="99" lly="532" urx="411" ury="583"/>
<char name="minus" width="675" llx="86" lly="220" urx="590" ury="286"/>
<char name="mu" width="500" llx="-30" lly="-209" urx="497" ury="428"/>
<char name="multiply" width="675" llx="93" lly="8" urx="582" ury="497"/>
<char name="n" width="500" llx="14" lly="-9" urx="474" ury="441"/>
<char name="nine" width="500" llx="23" lly="-17" urx="492" ury="676"/>
<char name="ntilde" width="500" llx="14" lly="-9" urx="476" ury="624"/>
<char name="numbersign" width="500" llx="2" lly="0" urx="540" ury="676"/>
<char name="o" width="500" llx="27" lly="-11" urx="468" ury="441"/>
<char name="oacute" width="500" llx="27" lly="-11" urx="487" ury="664"/>
<char name="ocircumflex" width="500" llx="27" lly="-11" urx="468" ury="661"/>
<char name="odieresis" width="500" llx="27" lly="-11" urx="489" ury="606"/>
<char name="oe" width="667" llx="20" lly="-12" urx="646" ury="441"/>
<char name="ogonek" width="333" llx="20" lly="-169" urx="203" ury="40"/>
<char name="ograve" width="500" llx="27" lly="-11" urx="468" ury="664"/>
<char name="one" width="500" llx="49" lly="0" urx="409" ury="676"/>
<char name="onehalf" width="750" llx="34" lly="-10" urx="749" ury="676"/>
<char name="onequarter" width="750" llx="33" lly="-10" urx="736" ury="676"/>
<char name="onesuperior" width="300" llx="43" lly="271" urx="284" ury="676"/>
<char name="ordfeminine" width="276" llx="42" lly="406" urx="352" ury="676"/>
<char name="ordmasculine" width="310" llx="67" lly="406" urx="362" ury="676"/>
<char name="oslash" width="500" llx="28" lly="-135" urx="469" ury="554"/>
<char name="otilde" width="500" llx="27" lly="-11" urx="496" ury="624"/>
<char name="p" width="500" llx="-75" lly="-205" urx="469" ury="441"/>
<char name="paragraph" width="523" llx="55" lly="-123" urx="616" ury="653"/>
<char name="parenleft" width="333" llx="42" lly="-181" urx="315" ury="669"/>
<char name="parenright" width="333" llx="16" lly="-180" urx="289" ury="669"/>
<char name="percent" width="833" llx="79" lly="-13" urx="790" ury="676"/>
<char name="period" width="250" llx="27" lly="-11" urx="138" ury="100"/>
<char name="periodcentered" width="250" llx="70" lly="199" urx="181" ury="310"/>
<char name="perthousand" width="1000" llx="25" lly="-19" urx="1010" ury="706"/>
<char name="plus" width="675" llx="86" lly="0" urx="590" ury="506"/>
<char name="plusminus" width="675" llx="86" lly="0" urx="590" ury="506"/>
<char name="q" width="500" llx="25" lly="-209" urx="483" ury="441"/>
<char name="question" width="500" llx="132" lly="-12" urx="472" ury="664"/>
<char name="questiondown" width="500" llx="28" lly="-205" urx="368" ury="471"/>
<char name="quotedbl" width="420" llx="144" lly="421" urx="432" ury="666"/>
<char name="quotedblbase" width="556" llx="57" lly="-129" urx="405" ury="101"/>
<char name="quotedblleft" width="556" llx="166" lly="436" urx="514" ury="666"/>
<char name="quotedblright" width="556" llx="151" lly="436" urx="499" ury="666"/>
<char name="quoteleft" width="333" llx="171" lly="436" urx="310" ury="666"/>
<char name="quoteright" width="333" llx="151" lly="436" urx="290" ury="666"/>
<char name="quotesinglbase" width="333" llx="44" lly="-129" urx="183" ury="101"/>
<char name="quotesingle" width="214" llx="132" lly="421" urx="241" ury="666"/>
<char name="r" width="389" llx="45" lly="0" urx="412" ury="441"/>
<char name="registered" width="760" llx="41" lly="-18" urx="719" ury="666"/>
<char name="ring" width="333" llx="155" lly="492" urx="355" ury="691"/>
<char name="s" width="389" llx="16" lly="-13" urx="366" ury="442"/>
<char name="scaron" width="389" llx="16" lly="-13" urx="454" ury="661"/>
<char name="section" width="500" llx="53" lly="-162" urx="461" ury="666"/>
<char name="semicolon" width="333" llx="27" lly="-129" urx="261" ury="441"/>
<char name="seven" width="500" llx="75" lly="-8" urx="537" ury="666"/>
<char name="six" width="500" llx="30" lly="-7" urx="521" ury="686"/>
<char name="slash" width="278" llx="-65" lly="-18" urx="386" ury="666"/>
<char name="space" width="250" llx="0" lly="0" urx="0" ury="0"/>
<!-- JKT: the following has been manually added -->
<char name="sterling" width="500" llx="10" lly="-6" urx="517" ury="670"/>
<char name="t" width="278" llx="37" lly="-11" urx="296" ury="546"/>
<char name="thorn" width="500" llx="-75" lly="-205" urx="469" ury="683"/>
<char name="three" width="500" llx="15" lly="-7" urx="465" ury="676"/>
<char name="threequarters" width="750" llx="23" lly="-10" urx="736" ury="676"/>
<char name="threesuperior" width="300" llx="43" lly="268" urx="339" ury="676"/>
<char name="tilde" width="333" llx="100" lly="517" urx="427" ury="624"/>
<char name="trademark" width="980" llx="30" lly="247" urx="957" ury="653"/>
<char name="two" width="500" llx="12" lly="0" urx="452" ury="676"/>
<char name="twosuperior" width="300" llx="33" lly="271" urx="324" ury="676"/>
<char name="u" width="500" llx="42" lly="-11" urx="475" ury="441"/>
<char name="uacute" width="500" llx="42" lly="-11" urx="477" ury="664"/>
<char name="ucircumflex" width="500" llx="42" lly="-11" urx="475" ury="661"/>
<char name="udieresis" width="500" llx="42" lly="-11" urx="479" ury="606"/>
<char name="ugrave" width="500" llx="42" lly="-11" urx="475" ury="664"/>
<char name="underscore" width="500" llx="0" lly="-125" urx="500" ury="-75"/>
<char name="v" width="444" llx="21" lly="-18" urx="426" ury="441"/>
<char name="w" width="667" llx="16" lly="-18" urx="648" ury="441"/>
<char name="x" width="444" llx="-27" lly="-11" urx="447" ury="441"/>
<char name="y" width="444" llx="-24" lly="-206" urx="426" ury="441"/>
<char name="yacute" width="444" llx="-24" lly="-206" urx="459" ury="664"/>
<char name="ydieresis" width="444" llx="-24" lly="-206" urx="441" ury="606"/>
<char name="yen" width="500" llx="27" lly="0" urx="603" ury="653"/>
<char name="z" width="389" llx="-2" lly="-81" urx="380" ury="428"/>
<char name="zcaron" width="389" llx="-2" lly="-81" urx="434" ury="661"/>
<char name="zero" width="500" llx="32" lly="-7" urx="497" ury="676"/>
</char-metrics>
<kerning kpx1="79">
<pair kern="-55" kpx2="65"/>
<pair kern="-50" kpx2="87"/>
<pair kern="-50" kpx2="89"/>
<pair kern="-40" kpx2="84"/>
<pair kern="0" kpx2="46"/>
<pair kern="-50" kpx2="86"/>
<pair kern="-40" kpx2="88"/>
<pair kern="0" kpx2="44"/>
</kerning>
<kerning kpx1="107">
<pair kern="-10" kpx2="111"/>
<pair kern="-10" kpx2="121"/>
<pair kern="-10" kpx2="101"/>
</kerning>
<kerning kpx1="112">
<pair kern="0" kpx2="121"/>
</kerning>
<kerning kpx1="80">
<pair kern="-80" kpx2="111"/>
<pair kern="-80" kpx2="97"/>
<pair kern="-90" kpx2="65"/>
<pair kern="-135" kpx2="46"/>
<pair kern="-80" kpx2="101"/>
<pair kern="-135" kpx2="44"/>
</kerning>
<kerning kpx1="86">
<pair kern="-111" kpx2="111"/>
<pair kern="-30" kpx2="79"/>
<pair kern="-65" kpx2="58"/>
<pair kern="0" kpx2="71"/>
<pair kern="-129" kpx2="44"/>
<pair kern="-74" kpx2="59"/>
<pair kern="-55" kpx2="45"/>
<pair kern="-74" kpx2="105"/>
<pair kern="-60" kpx2="65"/>
<pair kern="-111" kpx2="97"/>
<pair kern="-74" kpx2="117"/>
<pair kern="-129" kpx2="46"/>
<pair kern="-111" kpx2="101"/>
</kerning>
<kerning kpx1="118">
<pair kern="0" kpx2="111"/>
<pair kern="0" kpx2="97"/>
<pair kern="-74" kpx2="46"/>
<pair kern="0" kpx2="101"/>
<pair kern="-74" kpx2="44"/>
</kerning>
<kerning kpx1="32">
<pair kern="-18" kpx2="65"/>
<pair kern="-40" kpx2="87"/>
<pair kern="0" kpx2="147"/>
<pair kern="-75" kpx2="89"/>
<pair kern="-18" kpx2="84"/>
<pair kern="0" kpx2="145"/>
<pair kern="-35" kpx2="86"/>
</kerning>
<kerning kpx1="97">
<pair kern="0" kpx2="119"/>
<pair kern="0" kpx2="116"/>
<pair kern="0" kpx2="121"/>
<pair kern="0" kpx2="112"/>
<pair kern="-10" kpx2="103"/>
<pair kern="0" kpx2="98"/>
<pair kern="0" kpx2="118"/>
</kerning>
<kerning kpx1="70">
<pair kern="-105" kpx2="111"/>
<pair kern="-45" kpx2="105"/>
<pair kern="-55" kpx2="114"/>
<pair kern="-75" kpx2="97"/>
<pair kern="-115" kpx2="65"/>
<pair kern="-135" kpx2="46"/>
<pair kern="-75" kpx2="101"/>
<pair kern="-135" kpx2="44"/>
</kerning>
<kerning kpx1="85">
<pair kern="-40" kpx2="65"/>
<pair kern="-25" kpx2="46"/>
<pair kern="-25" kpx2="44"/>
</kerning>
<kerning kpx1="100">
<pair kern="0" kpx2="100"/>
<pair kern="0" kpx2="119"/>
<pair kern="0" kpx2="121"/>
<pair kern="0" kpx2="46"/>
<pair kern="0" kpx2="118"/>
<pair kern="0" kpx2="44"/>
</kerning>
<kerning kpx1="83">
<pair kern="0" kpx2="46"/>
<pair kern="0" kpx2="44"/>
</kerning>
<kerning kpx1="122">
<pair kern="0" kpx2="111"/>
<pair kern="0" kpx2="101"/>
</kerning>
<kerning kpx1="68">
<pair kern="-35" kpx2="65"/>
<pair kern="-40" kpx2="87"/>
<pair kern="-40" kpx2="89"/>
<pair kern="0" kpx2="46"/>
<pair kern="-40" kpx2="86"/>
<pair kern="0" kpx2="44"/>
</kerning>
<kerning kpx1="146">
<pair kern="0" kpx2="148"/>
<pair kern="-25" kpx2="100"/>
<pair kern="-111" kpx2="32"/>
<pair kern="-111" kpx2="146"/>
<pair kern="-25" kpx2="114"/>
<pair kern="-30" kpx2="116"/>
<pair kern="0" kpx2="108"/>
<pair kern="-40" kpx2="115"/>
<pair kern="-10" kpx2="118"/>
</kerning>
<kerning kpx1="58">
<pair kern="0" kpx2="32"/>
</kerning>
<kerning kpx1="119">
<pair kern="0" kpx2="111"/>
<pair kern="0" kpx2="97"/>
<pair kern="0" kpx2="104"/>
<pair kern="-74" kpx2="46"/>
<pair kern="0" kpx2="101"/>
<pair kern="-74" kpx2="44"/>
</kerning>
<kerning kpx1="75">
<pair kern="-40" kpx2="111"/>
<pair kern="-50" kpx2="79"/>
<pair kern="-40" kpx2="117"/>
<pair kern="-40" kpx2="121"/>
<pair kern="-35" kpx2="101"/>
</kerning>
<kerning kpx1="82">
<pair kern="-40" kpx2="79"/>
<pair kern="-18" kpx2="87"/>
<pair kern="-40" kpx2="85"/>
<pair kern="-18" kpx2="89"/>
<pair kern="0" kpx2="84"/>
<pair kern="-18" kpx2="86"/>
</kerning>
<kerning kpx1="145">
<pair kern="0" kpx2="65"/>
<pair kern="-111" kpx2="145"/>
</kerning>
<kerning kpx1="103">
<pair kern="0" kpx2="111"/>
<pair kern="0" kpx2="105"/>
<pair kern="0" kpx2="114"/>
<pair kern="0" kpx2="97"/>
<pair kern="0" kpx2="121"/>
<pair kern="-15" kpx2="46"/>
<pair kern="-10" kpx2="103"/>
<pair kern="-10" kpx2="101"/>
<pair kern="-10" kpx2="44"/>
</kerning>
<kerning kpx1="66">
<pair kern="-25" kpx2="65"/>
<pair kern="-10" kpx2="85"/>
<pair kern="0" kpx2="46"/>
<pair kern="0" kpx2="44"/>
</kerning>
<kerning kpx1="98">
<pair kern="-20" kpx2="117"/>
<pair kern="0" kpx2="121"/>
<pair kern="-40" kpx2="46"/>
<pair kern="0" kpx2="108"/>
<pair kern="0" kpx2="98"/>
<pair kern="0" kpx2="118"/>
<pair kern="0" kpx2="44"/>
</kerning>
<kerning kpx1="81">
<pair kern="-10" kpx2="85"/>
<pair kern="0" kpx2="46"/>
<pair kern="0" kpx2="44"/>
</kerning>
<kerning kpx1="44">
<pair kern="-140" kpx2="148"/>
<pair kern="0" kpx2="32"/>
<pair kern="-140" kpx2="146"/>
</kerning>
<kerning kpx1="102">
<pair kern="0" kpx2="148"/>
<pair kern="0" kpx2="111"/>
<pair kern="-20" kpx2="105"/>
<pair kern="92" kpx2="146"/>
<pair kern="0" kpx2="97"/>
<pair kern="-18" kpx2="102"/>
<pair kern="-15" kpx2="46"/>
<pair kern="0" kpx2="108"/>
<pair kern="0" kpx2="101"/>
<pair kern="-10" kpx2="44"/>
</kerning>
<kerning kpx1="84">
<pair kern="-92" kpx2="111"/>
<pair kern="-18" kpx2="79"/>
<pair kern="-74" kpx2="119"/>
<pair kern="-55" kpx2="58"/>
<pair kern="-55" kpx2="114"/>
<pair kern="0" kpx2="104"/>
<pair kern="-74" kpx2="44"/>
<pair kern="-65" kpx2="59"/>
<pair kern="-74" kpx2="45"/>
<pair kern="-55" kpx2="105"/>
<pair kern="-50" kpx2="65"/>
<pair kern="-92" kpx2="97"/>
<pair kern="-55" kpx2="117"/>
<pair kern="-74" kpx2="121"/>
<pair kern="-74" kpx2="46"/>
<pair kern="-92" kpx2="101"/>
</kerning>
<kerning kpx1="121">
<pair kern="0" kpx2="111"/>
<pair kern="0" kpx2="97"/>
<pair kern="-55" kpx2="46"/>
<pair kern="0" kpx2="101"/>
<pair kern="-55" kpx2="44"/>
</kerning>
<kerning kpx1="120">
<pair kern="0" kpx2="101"/>
</kerning>
<kerning kpx1="101">
<pair kern="-15" kpx2="119"/>
<pair kern="-30" kpx2="121"/>
<pair kern="0" kpx2="112"/>
<pair kern="-15" kpx2="46"/>
<pair kern="-40" kpx2="103"/>
<pair kern="0" kpx2="98"/>
<pair kern="-20" kpx2="120"/>
<pair kern="-15" kpx2="118"/>
<pair kern="-10" kpx2="44"/>
</kerning>
<kerning kpx1="99">
<pair kern="-20" kpx2="107"/>
<pair kern="-15" kpx2="104"/>
<pair kern="0" kpx2="121"/>
<pair kern="0" kpx2="46"/>
<pair kern="0" kpx2="108"/>
<pair kern="0" kpx2="44"/>
</kerning>
<kerning kpx1="87">
<pair kern="-92" kpx2="111"/>
<pair kern="-25" kpx2="79"/>
<pair kern="-65" kpx2="58"/>
<pair kern="0" kpx2="104"/>
<pair kern="-92" kpx2="44"/>
<pair kern="-65" kpx2="59"/>
<pair kern="-37" kpx2="45"/>
<pair kern="-55" kpx2="105"/>
<pair kern="-60" kpx2="65"/>
<pair kern="-92" kpx2="97"/>
<pair kern="-55" kpx2="117"/>
<pair kern="-70" kpx2="121"/>
<pair kern="-92" kpx2="46"/>
<pair kern="-92" kpx2="101"/>
</kerning>
<kerning kpx1="104">
<pair kern="0" kpx2="121"/>
</kerning>
<kerning kpx1="71">
<pair kern="0" kpx2="46"/>
<pair kern="0" kpx2="44"/>
</kerning>
<kerning kpx1="105">
<pair kern="0" kpx2="118"/>
</kerning>
<kerning kpx1="65">
<pair kern="-40" kpx2="79"/>
<pair kern="-37" kpx2="146"/>
<pair kern="-55" kpx2="119"/>
<pair kern="-95" kpx2="87"/>
<pair kern="-30" kpx2="67"/>
<pair kern="0" kpx2="112"/>
<pair kern="-40" kpx2="81"/>
<pair kern="-35" kpx2="71"/>
<pair kern="-105" kpx2="86"/>
<pair kern="-55" kpx2="118"/>
<pair kern="0" kpx2="148"/>
<pair kern="-50" kpx2="85"/>
<pair kern="-20" kpx2="117"/>
<pair kern="-55" kpx2="89"/>
<pair kern="-55" kpx2="121"/>
<pair kern="-37" kpx2="84"/>
</kerning>
<kerning kpx1="147">
<pair kern="0" kpx2="65"/>
<pair kern="0" kpx2="145"/>
</kerning>
<kerning kpx1="78">
<pair kern="-27" kpx2="65"/>
<pair kern="0" kpx2="46"/>
<pair kern="0" kpx2="44"/>
</kerning>
<kerning kpx1="115">
<pair kern="0" kpx2="119"/>
</kerning>
<kerning kpx1="111">
<pair kern="0" kpx2="119"/>
<pair kern="0" kpx2="121"/>
<pair kern="-10" kpx2="103"/>
<pair kern="0" kpx2="120"/>
<pair kern="-10" kpx2="118"/>
</kerning>
<kerning kpx1="114">
<pair kern="-45" kpx2="111"/>
<pair kern="-37" kpx2="100"/>
<pair kern="0" kpx2="107"/>
<pair kern="0" kpx2="114"/>
<pair kern="-37" kpx2="99"/>
<pair kern="0" kpx2="112"/>
<pair kern="-37" kpx2="103"/>
<pair kern="0" kpx2="108"/>
<pair kern="-37" kpx2="113"/>
<pair kern="0" kpx2="118"/>
<pair kern="-111" kpx2="44"/>
<pair kern="-20" kpx2="45"/>
<pair kern="0" kpx2="105"/>
<pair kern="0" kpx2="109"/>
<pair kern="-15" kpx2="97"/>
<pair kern="0" kpx2="117"/>
<pair kern="0" kpx2="116"/>
<pair kern="0" kpx2="121"/>
<pair kern="-111" kpx2="46"/>
<pair kern="0" kpx2="110"/>
<pair kern="-10" kpx2="115"/>
<pair kern="-37" kpx2="101"/>
</kerning>
<kerning kpx1="108">
<pair kern="0" kpx2="119"/>
<pair kern="0" kpx2="121"/>
</kerning>
<kerning kpx1="76">
<pair kern="0" kpx2="148"/>
<pair kern="-37" kpx2="146"/>
<pair kern="-55" kpx2="87"/>
<pair kern="-20" kpx2="89"/>
<pair kern="-30" kpx2="121"/>
<pair kern="-20" kpx2="84"/>
<pair kern="-55" kpx2="86"/>
</kerning>
<kerning kpx1="148">
<pair kern="0" kpx2="32"/>
</kerning>
<kerning kpx1="109">
<pair kern="0" kpx2="117"/>
<pair kern="0" kpx2="121"/>
</kerning>
<kerning kpx1="89">
<pair kern="-92" kpx2="111"/>
<pair kern="-74" kpx2="45"/>
<pair kern="-74" kpx2="105"/>
<pair kern="-15" kpx2="79"/>
<pair kern="-65" kpx2="58"/>
<pair kern="-92" kpx2="97"/>
<pair kern="-50" kpx2="65"/>
<pair kern="-92" kpx2="117"/>
<pair kern="-92" kpx2="46"/>
<pair kern="-92" kpx2="101"/>
<pair kern="-65" kpx2="59"/>
<pair kern="-92" kpx2="44"/>
</kerning>
<kerning kpx1="74">
<pair kern="-25" kpx2="111"/>
<pair kern="-35" kpx2="97"/>
<pair kern="-40" kpx2="65"/>
<pair kern="-35" kpx2="117"/>
<pair kern="-25" kpx2="46"/>
<pair kern="-25" kpx2="101"/>
<pair kern="-25" kpx2="44"/>
</kerning>
<kerning kpx1="46">
<pair kern="-140" kpx2="148"/>
<pair kern="-140" kpx2="146"/>
</kerning>
<kerning kpx1="110">
<pair kern="0" kpx2="117"/>
<pair kern="0" kpx2="121"/>
<pair kern="-40" kpx2="118"/>
</kerning>
</font-metrics>
@@ -0,0 +1,645 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- $Id$ -->
<!-- JKT: these metrics in XML were kindly produced by Fotis Jannidis -->
<font-metrics>
<font-name>Times-Roman</font-name>
<full-name>Times Roman</full-name>
<family-name>Times</family-name>
<class-name>TimesRoman</class-name>
<encoding>StandardEncoding</encoding>
<underline-position>-100</underline-position>
<underline-thickness>50</underline-thickness>
<cap-height>662</cap-height>
<x-height>450</x-height>
<ascender>683</ascender>
<descender>-217</descender>
<first-char>32</first-char>
<last-char>255</last-char>
<char-metrics>
<char name="A" width="722" llx="15" lly="0" urx="706" ury="674"/>
<char name="AE" width="889" llx="0" lly="0" urx="863" ury="662"/>
<char name="Aacute" width="722" llx="15" lly="0" urx="706" ury="890"/>
<char name="Acircumflex" width="722" llx="15" lly="0" urx="706" ury="886"/>
<char name="Adieresis" width="722" llx="15" lly="0" urx="706" ury="835"/>
<char name="Agrave" width="722" llx="15" lly="0" urx="706" ury="890"/>
<char name="Aring" width="722" llx="15" lly="0" urx="706" ury="898"/>
<char name="Atilde" width="722" llx="15" lly="0" urx="706" ury="850"/>
<char name="B" width="667" llx="17" lly="0" urx="593" ury="662"/>
<char name="C" width="667" llx="28" lly="-14" urx="633" ury="676"/>
<char name="Ccedilla" width="667" llx="28" lly="-215" urx="633" ury="676"/>
<char name="D" width="722" llx="16" lly="0" urx="685" ury="662"/>
<char name="E" width="611" llx="12" lly="0" urx="597" ury="662"/>
<char name="Eacute" width="611" llx="12" lly="0" urx="597" ury="890"/>
<char name="Ecircumflex" width="611" llx="12" lly="0" urx="597" ury="886"/>
<char name="Edieresis" width="611" llx="12" lly="0" urx="597" ury="835"/>
<char name="Egrave" width="611" llx="12" lly="0" urx="597" ury="890"/>
<char name="Eth" width="722" llx="16" lly="0" urx="685" ury="662"/>
<char name="Euro" width="500" llx="0" lly="0" urx="0" ury="0"/>
<char name="F" width="556" llx="12" lly="0" urx="546" ury="662"/>
<char name="G" width="722" llx="32" lly="-14" urx="709" ury="676"/>
<char name="H" width="722" llx="19" lly="0" urx="702" ury="662"/>
<char name="I" width="333" llx="18" lly="0" urx="315" ury="662"/>
<char name="Iacute" width="333" llx="18" lly="0" urx="317" ury="890"/>
<char name="Icircumflex" width="333" llx="11" lly="0" urx="322" ury="886"/>
<char name="Idieresis" width="333" llx="18" lly="0" urx="315" ury="835"/>
<char name="Igrave" width="333" llx="18" lly="0" urx="315" ury="890"/>
<char name="J" width="389" llx="10" lly="-14" urx="370" ury="662"/>
<char name="K" width="722" llx="34" lly="0" urx="723" ury="662"/>
<char name="L" width="611" llx="12" lly="0" urx="598" ury="662"/>
<char name="Lslash" width="611" llx="12" lly="0" urx="598" ury="662"/>
<char name="M" width="889" llx="12" lly="0" urx="863" ury="662"/>
<char name="N" width="722" llx="12" lly="-11" urx="707" ury="662"/>
<char name="Ntilde" width="722" llx="12" lly="-11" urx="707" ury="850"/>
<char name="O" width="722" llx="34" lly="-14" urx="688" ury="676"/>
<char name="OE" width="889" llx="30" lly="-6" urx="885" ury="668"/>
<char name="Oacute" width="722" llx="34" lly="-14" urx="688" ury="890"/>
<char name="Ocircumflex" width="722" llx="34" lly="-14" urx="688" ury="886"/>
<char name="Odieresis" width="722" llx="34" lly="-14" urx="688" ury="835"/>
<char name="Ograve" width="722" llx="34" lly="-14" urx="688" ury="890"/>
<char name="Oslash" width="722" llx="34" lly="-80" urx="688" ury="734"/>
<char name="Otilde" width="722" llx="34" lly="-14" urx="688" ury="850"/>
<char name="P" width="556" llx="16" lly="0" urx="542" ury="662"/>
<char name="Q" width="722" llx="34" lly="-178" urx="701" ury="676"/>
<char name="R" width="667" llx="17" lly="0" urx="659" ury="662"/>
<char name="S" width="556" llx="42" lly="-14" urx="491" ury="676"/>
<char name="Scaron" width="556" llx="42" lly="-14" urx="491" ury="886"/>
<char name="T" width="611" llx="17" lly="0" urx="593" ury="662"/>
<char name="Thorn" width="556" llx="16" lly="0" urx="542" ury="662"/>
<char name="U" width="722" llx="14" lly="-14" urx="705" ury="662"/>
<char name="Uacute" width="722" llx="14" lly="-14" urx="705" ury="890"/>
<char name="Ucircumflex" width="722" llx="14" lly="-14" urx="705" ury="886"/>
<char name="Udieresis" width="722" llx="14" lly="-14" urx="705" ury="835"/>
<char name="Ugrave" width="722" llx="14" lly="-14" urx="705" ury="890"/>
<char name="V" width="722" llx="16" lly="-11" urx="697" ury="662"/>
<char name="W" width="944" llx="5" lly="-11" urx="932" ury="662"/>
<char name="X" width="722" llx="10" lly="0" urx="704" ury="662"/>
<char name="Y" width="722" llx="22" lly="0" urx="703" ury="662"/>
<char name="Yacute" width="722" llx="22" lly="0" urx="703" ury="890"/>
<char name="Ydieresis" width="722" llx="22" lly="0" urx="703" ury="835"/>
<char name="Z" width="611" llx="9" lly="0" urx="597" ury="662"/>
<char name="Zcaron" width="611" llx="9" lly="0" urx="597" ury="886"/>
<char name="a" width="444" llx="37" lly="-10" urx="442" ury="460"/>
<char name="aacute" width="444" llx="37" lly="-10" urx="442" ury="678"/>
<char name="acircumflex" width="444" llx="37" lly="-10" urx="442" ury="674"/>
<char name="acute" width="333" llx="93" lly="507" urx="317" ury="678"/>
<char name="adieresis" width="444" llx="37" lly="-10" urx="442" ury="623"/>
<char name="ae" width="667" llx="38" lly="-10" urx="632" ury="460"/>
<char name="agrave" width="444" llx="37" lly="-10" urx="442" ury="678"/>
<char name="ampersand" width="778" llx="42" lly="-13" urx="750" ury="676"/>
<char name="aring" width="444" llx="37" lly="-10" urx="442" ury="711"/>
<char name="asciicircum" width="469" llx="24" lly="297" urx="446" ury="662"/>
<char name="asciitilde" width="541" llx="40" lly="183" urx="502" ury="323"/>
<char name="asterisk" width="500" llx="69" lly="265" urx="432" ury="676"/>
<char name="at" width="921" llx="116" lly="-14" urx="809" ury="676"/>
<char name="atilde" width="444" llx="37" lly="-10" urx="442" ury="638"/>
<char name="b" width="500" llx="3" lly="-10" urx="468" ury="683"/>
<char name="backslash" width="278" llx="-9" lly="-14" urx="287" ury="676"/>
<char name="bar" width="200" llx="67" lly="-218" urx="133" ury="782"/>
<char name="braceleft" width="480" llx="100" lly="-181" urx="350" ury="680"/>
<char name="braceright" width="480" llx="130" lly="-181" urx="380" ury="680"/>
<char name="bracketleft" width="333" llx="88" lly="-156" urx="299" ury="662"/>
<char name="bracketright" width="333" llx="34" lly="-156" urx="245" ury="662"/>
<char name="breve" width="333" llx="26" lly="507" urx="307" ury="664"/>
<char name="brokenbar" width="200" llx="67" lly="-143" urx="133" ury="707"/>
<char name="bullet" width="350" llx="40" lly="196" urx="310" ury="466"/>
<char name="c" width="444" llx="25" lly="-10" urx="412" ury="460"/>
<char name="caron" width="333" llx="11" lly="507" urx="322" ury="674"/>
<char name="ccedilla" width="444" llx="25" lly="-215" urx="412" ury="460"/>
<char name="cedilla" width="333" llx="52" lly="-215" urx="261" ury="0"/>
<char name="cent" width="500" llx="53" lly="-138" urx="448" ury="579"/>
<char name="circumflex" width="333" llx="11" lly="507" urx="322" ury="674"/>
<char name="colon" width="278" llx="81" lly="-11" urx="192" ury="459"/>
<char name="comma" width="250" llx="56" lly="-141" urx="195" ury="102"/>
<char name="copyright" width="760" llx="38" lly="-14" urx="722" ury="676"/>
<char name="currency" width="500" llx="-22" lly="58" urx="522" ury="602"/>
<char name="d" width="500" llx="27" lly="-10" urx="491" ury="683"/>
<char name="dagger" width="500" llx="59" lly="-149" urx="442" ury="676"/>
<char name="daggerdbl" width="500" llx="58" lly="-153" urx="442" ury="676"/>
<char name="degree" width="400" llx="57" lly="390" urx="343" ury="676"/>
<char name="dieresis" width="333" llx="18" lly="581" urx="315" ury="681"/>
<char name="divide" width="564" llx="30" lly="-10" urx="534" ury="516"/>
<char name="dollar" width="500" llx="44" lly="-87" urx="457" ury="727"/>
<char name="dotaccent" width="333" llx="118" lly="581" urx="216" ury="681"/>
<char name="dotlessi" width="278" llx="16" lly="0" urx="253" ury="460"/>
<char name="e" width="444" llx="25" lly="-10" urx="424" ury="460"/>
<char name="eacute" width="444" llx="25" lly="-10" urx="424" ury="678"/>
<char name="ecircumflex" width="444" llx="25" lly="-10" urx="424" ury="674"/>
<char name="edieresis" width="444" llx="25" lly="-10" urx="424" ury="623"/>
<char name="egrave" width="444" llx="25" lly="-10" urx="424" ury="678"/>
<char name="eight" width="500" llx="56" lly="-14" urx="445" ury="676"/>
<char name="ellipsis" width="1000" llx="111" lly="-11" urx="888" ury="100"/>
<char name="emdash" width="1000" llx="0" lly="201" urx="1000" ury="250"/>
<char name="endash" width="500" llx="0" lly="201" urx="500" ury="250"/>
<char name="equal" width="564" llx="30" lly="120" urx="534" ury="386"/>
<char name="eth" width="500" llx="29" lly="-10" urx="471" ury="686"/>
<char name="exclam" width="333" llx="130" lly="-9" urx="238" ury="676"/>
<char name="exclamdown" width="333" llx="97" lly="-218" urx="205" ury="467"/>
<char name="f" width="333" llx="20" lly="0" urx="383" ury="683"/>
<char name="fi" width="556" llx="31" lly="0" urx="521" ury="683"/>
<char name="five" width="500" llx="32" lly="-14" urx="438" ury="688"/>
<char name="fl" width="556" llx="32" lly="0" urx="521" ury="683"/>
<char name="florin" width="500" llx="7" lly="-189" urx="490" ury="676"/>
<char name="four" width="500" llx="12" lly="0" urx="472" ury="676"/>
<char name="fraction" width="167" llx="-168" lly="-14" urx="331" ury="676"/>
<char name="g" width="500" llx="28" lly="-218" urx="470" ury="460"/>
<char name="germandbls" width="500" llx="12" lly="-9" urx="468" ury="683"/>
<char name="grave" width="333" llx="19" lly="507" urx="242" ury="678"/>
<char name="greater" width="564" llx="28" lly="-8" urx="536" ury="514"/>
<char name="guillemotleft" width="500" llx="42" lly="33" urx="456" ury="416"/>
<char name="guillemotright" width="500" llx="44" lly="33" urx="458" ury="416"/>
<char name="guilsinglleft" width="333" llx="63" lly="33" urx="285" ury="416"/>
<char name="guilsinglright" width="333" llx="48" lly="33" urx="270" ury="416"/>
<char name="h" width="500" llx="9" lly="0" urx="487" ury="683"/>
<char name="hungarumlaut" width="333" llx="-3" lly="507" urx="377" ury="678"/>
<char name="hyphen" width="333" llx="39" lly="194" urx="285" ury="257"/>
<char name="i" width="278" llx="16" lly="0" urx="253" ury="683"/>
<char name="iacute" width="278" llx="16" lly="0" urx="290" ury="678"/>
<char name="icircumflex" width="278" llx="-16" lly="0" urx="295" ury="674"/>
<char name="idieresis" width="278" llx="-9" lly="0" urx="288" ury="623"/>
<char name="igrave" width="278" llx="-8" lly="0" urx="253" ury="678"/>
<char name="j" width="278" llx="-70" lly="-218" urx="194" ury="683"/>
<char name="k" width="500" llx="7" lly="0" urx="505" ury="683"/>
<char name="l" width="278" llx="19" lly="0" urx="257" ury="683"/>
<char name="less" width="564" llx="28" lly="-8" urx="536" ury="514"/>
<char name="logicalnot" width="564" llx="30" lly="108" urx="534" ury="386"/>
<char name="lslash" width="278" llx="19" lly="0" urx="259" ury="683"/>
<char name="m" width="778" llx="16" lly="0" urx="775" ury="460"/>
<char name="macron" width="333" llx="11" lly="547" urx="322" ury="601"/>
<char name="minus" width="324" llx="30" lly="220" urx="534" ury="286"/>
<char name="mu" width="500" llx="36" lly="-218" urx="512" ury="450"/>
<char name="multiply" width="564" llx="38" lly="8" urx="527" ury="497"/>
<char name="n" width="500" llx="16" lly="0" urx="485" ury="460"/>
<char name="nine" width="500" llx="30" lly="-22" urx="459" ury="676"/>
<char name="ntilde" width="500" llx="16" lly="0" urx="485" ury="638"/>
<char name="numbersign" width="500" llx="5" lly="0" urx="496" ury="662"/>
<char name="o" width="500" llx="29" lly="-10" urx="470" ury="460"/>
<char name="oacute" width="500" llx="29" lly="-10" urx="470" ury="678"/>
<char name="ocircumflex" width="500" llx="29" lly="-10" urx="470" ury="674"/>
<char name="odieresis" width="500" llx="29" lly="-10" urx="470" ury="623"/>
<char name="oe" width="722" llx="30" lly="-10" urx="690" ury="460"/>
<char name="ogonek" width="333" llx="62" lly="-165" urx="243" ury="0"/>
<char name="ograve" width="500" llx="29" lly="-10" urx="470" ury="678"/>
<char name="one" width="500" llx="111" lly="0" urx="394" ury="676"/>
<char name="onehalf" width="750" llx="31" lly="-14" urx="746" ury="676"/>
<char name="onequarter" width="750" llx="37" lly="-14" urx="718" ury="676"/>
<char name="onesuperior" width="300" llx="57" lly="270" urx="248" ury="676"/>
<char name="ordfeminine" width="276" llx="4" lly="394" urx="270" ury="676"/>
<char name="ordmasculine" width="310" llx="6" lly="394" urx="304" ury="676"/>
<char name="oslash" width="500" llx="29" lly="-112" urx="470" ury="551"/>
<char name="otilde" width="500" llx="29" lly="-10" urx="470" ury="638"/>
<char name="p" width="500" llx="5" lly="-217" urx="470" ury="460"/>
<char name="paragraph" width="453" llx="-22" lly="-154" urx="450" ury="662"/>
<char name="parenleft" width="333" llx="48" lly="-177" urx="304" ury="676"/>
<char name="parenright" width="333" llx="29" lly="-177" urx="285" ury="676"/>
<char name="percent" width="833" llx="61" lly="-13" urx="772" ury="676"/>
<char name="period" width="250" llx="70" lly="-11" urx="181" ury="100"/>
<char name="periodcentered" width="250" llx="70" lly="199" urx="181" ury="310"/>
<char name="perthousand" width="1000" llx="7" lly="-19" urx="994" ury="706"/>
<char name="plus" width="564" llx="30" lly="0" urx="534" ury="506"/>
<char name="plusminus" width="564" llx="30" lly="0" urx="534" ury="506"/>
<char name="q" width="500" llx="24" lly="-217" urx="488" ury="460"/>
<char name="question" width="444" llx="68" lly="-8" urx="414" ury="676"/>
<char name="questiondown" width="444" llx="30" lly="-218" urx="376" ury="466"/>
<char name="quotedbl" width="408" llx="77" lly="431" urx="331" ury="676"/>
<char name="quotedblbase" width="444" llx="45" lly="-141" urx="416" ury="102"/>
<char name="quotedblleft" width="444" llx="43" lly="433" urx="414" ury="676"/>
<char name="quotedblright" width="444" llx="30" lly="433" urx="401" ury="676"/>
<char name="quoteleft" width="333" llx="115" lly="433" urx="254" ury="676"/>
<char name="quoteright" width="333" llx="79" lly="433" urx="218" ury="676"/>
<char name="quotesinglbase" width="333" llx="79" lly="-141" urx="218" ury="102"/>
<char name="quotesingle" width="180" llx="48" lly="431" urx="133" ury="676"/>
<char name="r" width="333" llx="5" lly="0" urx="335" ury="460"/>
<char name="registered" width="760" llx="38" lly="-14" urx="722" ury="676"/>
<char name="ring" width="333" llx="67" lly="512" urx="266" ury="711"/>
<char name="s" width="389" llx="51" lly="-10" urx="348" ury="460"/>
<char name="scaron" width="389" llx="39" lly="-10" urx="350" ury="674"/>
<char name="section" width="500" llx="70" lly="-148" urx="426" ury="676"/>
<char name="semicolon" width="278" llx="80" lly="-141" urx="219" ury="459"/>
<char name="seven" width="500" llx="20" lly="-8" urx="449" ury="662"/>
<char name="six" width="500" llx="34" lly="-14" urx="468" ury="684"/>
<char name="slash" width="278" llx="-9" lly="-14" urx="287" ury="676"/>
<char name="space" width="250" llx="0" lly="0" urx="0" ury="0"/>
<!-- JKT: the following has been manually added -->
<char name="sterling" width="500" llx="12" lly="-8" urx="490" ury="676"/>
<char name="t" width="278" llx="13" lly="-10" urx="279" ury="579"/>
<char name="thorn" width="500" llx="5" lly="-217" urx="470" ury="683"/>
<char name="three" width="500" llx="43" lly="-14" urx="431" ury="676"/>
<char name="threequarters" width="750" llx="15" lly="-14" urx="718" ury="676"/>
<char name="threesuperior" width="300" llx="15" lly="262" urx="291" ury="676"/>
<char name="tilde" width="333" llx="1" lly="532" urx="331" ury="638"/>
<char name="trademark" width="980" llx="30" lly="256" urx="957" ury="662"/>
<char name="two" width="500" llx="30" lly="0" urx="475" ury="676"/>
<char name="twosuperior" width="300" llx="1" lly="270" urx="296" ury="676"/>
<char name="u" width="500" llx="9" lly="-10" urx="479" ury="450"/>
<char name="uacute" width="500" llx="9" lly="-10" urx="479" ury="678"/>
<char name="ucircumflex" width="500" llx="9" lly="-10" urx="479" ury="674"/>
<char name="udieresis" width="500" llx="9" lly="-10" urx="479" ury="623"/>
<char name="ugrave" width="500" llx="9" lly="-10" urx="479" ury="678"/>
<char name="underscore" width="500" llx="0" lly="-125" urx="500" ury="-75"/>
<char name="v" width="500" llx="19" lly="-14" urx="477" ury="450"/>
<char name="w" width="722" llx="21" lly="-14" urx="694" ury="450"/>
<char name="x" width="500" llx="17" lly="0" urx="479" ury="450"/>
<char name="y" width="500" llx="14" lly="-218" urx="475" ury="450"/>
<char name="yacute" width="500" llx="14" lly="-218" urx="475" ury="678"/>
<char name="ydieresis" width="500" llx="14" lly="-218" urx="475" ury="623"/>
<char name="yen" width="500" llx="-53" lly="0" urx="512" ury="662"/>
<char name="z" width="444" llx="27" lly="0" urx="418" ury="450"/>
<char name="zcaron" width="444" llx="27" lly="0" urx="418" ury="674"/>
<char name="zero" width="500" llx="24" lly="-14" urx="476" ury="676"/>
</char-metrics>
<kerning kpx1="79">
<pair kern="-35" kpx2="65"/>
<pair kern="-35" kpx2="87"/>
<pair kern="-50" kpx2="89"/>
<pair kern="-40" kpx2="84"/>
<pair kern="0" kpx2="46"/>
<pair kern="-50" kpx2="86"/>
<pair kern="-40" kpx2="88"/>
<pair kern="0" kpx2="44"/>
</kerning>
<kerning kpx1="107">
<pair kern="-10" kpx2="111"/>
<pair kern="-15" kpx2="121"/>
<pair kern="-10" kpx2="101"/>
</kerning>
<kerning kpx1="112">
<pair kern="-10" kpx2="121"/>
</kerning>
<kerning kpx1="80">
<pair kern="0" kpx2="111"/>
<pair kern="-15" kpx2="97"/>
<pair kern="-92" kpx2="65"/>
<pair kern="-111" kpx2="46"/>
<pair kern="0" kpx2="101"/>
<pair kern="-111" kpx2="44"/>
</kerning>
<kerning kpx1="86">
<pair kern="-129" kpx2="111"/>
<pair kern="-40" kpx2="79"/>
<pair kern="-74" kpx2="58"/>
<pair kern="-15" kpx2="71"/>
<pair kern="-129" kpx2="44"/>
<pair kern="-74" kpx2="59"/>
<pair kern="-100" kpx2="45"/>
<pair kern="-60" kpx2="105"/>
<pair kern="-135" kpx2="65"/>
<pair kern="-111" kpx2="97"/>
<pair kern="-75" kpx2="117"/>
<pair kern="-129" kpx2="46"/>
<pair kern="-111" kpx2="101"/>
</kerning>
<kerning kpx1="118">
<pair kern="-20" kpx2="111"/>
<pair kern="-25" kpx2="97"/>
<pair kern="-65" kpx2="46"/>
<pair kern="-15" kpx2="101"/>
<pair kern="-65" kpx2="44"/>
</kerning>
<kerning kpx1="32">
<pair kern="-55" kpx2="65"/>
<pair kern="-30" kpx2="87"/>
<pair kern="0" kpx2="147"/>
<pair kern="-90" kpx2="89"/>
<pair kern="-18" kpx2="84"/>
<pair kern="0" kpx2="145"/>
<pair kern="-50" kpx2="86"/>
</kerning>
<kerning kpx1="97">
<pair kern="-15" kpx2="119"/>
<pair kern="0" kpx2="116"/>
<pair kern="0" kpx2="121"/>
<pair kern="0" kpx2="112"/>
<pair kern="0" kpx2="103"/>
<pair kern="0" kpx2="98"/>
<pair kern="-20" kpx2="118"/>
</kerning>
<kerning kpx1="70">
<pair kern="-15" kpx2="111"/>
<pair kern="0" kpx2="105"/>
<pair kern="0" kpx2="114"/>
<pair kern="-15" kpx2="97"/>
<pair kern="-74" kpx2="65"/>
<pair kern="-80" kpx2="46"/>
<pair kern="0" kpx2="101"/>
<pair kern="-80" kpx2="44"/>
</kerning>
<kerning kpx1="85">
<pair kern="-40" kpx2="65"/>
<pair kern="0" kpx2="46"/>
<pair kern="0" kpx2="44"/>
</kerning>
<kerning kpx1="100">
<pair kern="0" kpx2="100"/>
<pair kern="0" kpx2="119"/>
<pair kern="0" kpx2="121"/>
<pair kern="0" kpx2="46"/>
<pair kern="0" kpx2="118"/>
<pair kern="0" kpx2="44"/>
</kerning>
<kerning kpx1="83">
<pair kern="0" kpx2="46"/>
<pair kern="0" kpx2="44"/>
</kerning>
<kerning kpx1="122">
<pair kern="0" kpx2="111"/>
<pair kern="0" kpx2="101"/>
</kerning>
<kerning kpx1="68">
<pair kern="-40" kpx2="65"/>
<pair kern="-30" kpx2="87"/>
<pair kern="-55" kpx2="89"/>
<pair kern="0" kpx2="46"/>
<pair kern="-40" kpx2="86"/>
<pair kern="0" kpx2="44"/>
</kerning>
<kerning kpx1="146">
<pair kern="0" kpx2="148"/>
<pair kern="-50" kpx2="100"/>
<pair kern="-74" kpx2="32"/>
<pair kern="-74" kpx2="146"/>
<pair kern="-50" kpx2="114"/>
<pair kern="-18" kpx2="116"/>
<pair kern="-10" kpx2="108"/>
<pair kern="-55" kpx2="115"/>
<pair kern="-50" kpx2="118"/>
</kerning>
<kerning kpx1="58">
<pair kern="0" kpx2="32"/>
</kerning>
<kerning kpx1="119">
<pair kern="-10" kpx2="111"/>
<pair kern="-10" kpx2="97"/>
<pair kern="0" kpx2="104"/>
<pair kern="-65" kpx2="46"/>
<pair kern="0" kpx2="101"/>
<pair kern="-65" kpx2="44"/>
</kerning>
<kerning kpx1="75">
<pair kern="-35" kpx2="111"/>
<pair kern="-30" kpx2="79"/>
<pair kern="-15" kpx2="117"/>
<pair kern="-25" kpx2="121"/>
<pair kern="-25" kpx2="101"/>
</kerning>
<kerning kpx1="82">
<pair kern="-40" kpx2="79"/>
<pair kern="-55" kpx2="87"/>
<pair kern="-40" kpx2="85"/>
<pair kern="-65" kpx2="89"/>
<pair kern="-60" kpx2="84"/>
<pair kern="-80" kpx2="86"/>
</kerning>
<kerning kpx1="145">
<pair kern="-80" kpx2="65"/>
<pair kern="-74" kpx2="145"/>
</kerning>
<kerning kpx1="103">
<pair kern="0" kpx2="111"/>
<pair kern="0" kpx2="105"/>
<pair kern="0" kpx2="114"/>
<pair kern="-5" kpx2="97"/>
<pair kern="0" kpx2="121"/>
<pair kern="0" kpx2="46"/>
<pair kern="0" kpx2="103"/>
<pair kern="0" kpx2="101"/>
<pair kern="0" kpx2="44"/>
</kerning>
<kerning kpx1="66">
<pair kern="-35" kpx2="65"/>
<pair kern="-10" kpx2="85"/>
<pair kern="0" kpx2="46"/>
<pair kern="0" kpx2="44"/>
</kerning>
<kerning kpx1="98">
<pair kern="-20" kpx2="117"/>
<pair kern="0" kpx2="121"/>
<pair kern="-40" kpx2="46"/>
<pair kern="0" kpx2="108"/>
<pair kern="0" kpx2="98"/>
<pair kern="-15" kpx2="118"/>
<pair kern="0" kpx2="44"/>
</kerning>
<kerning kpx1="81">
<pair kern="-10" kpx2="85"/>
<pair kern="0" kpx2="46"/>
<pair kern="0" kpx2="44"/>
</kerning>
<kerning kpx1="44">
<pair kern="-70" kpx2="148"/>
<pair kern="0" kpx2="32"/>
<pair kern="-70" kpx2="146"/>
</kerning>
<kerning kpx1="102">
<pair kern="0" kpx2="148"/>
<pair kern="0" kpx2="111"/>
<pair kern="-20" kpx2="105"/>
<pair kern="55" kpx2="146"/>
<pair kern="-10" kpx2="97"/>
<pair kern="-25" kpx2="102"/>
<pair kern="0" kpx2="46"/>
<pair kern="0" kpx2="108"/>
<pair kern="0" kpx2="101"/>
<pair kern="0" kpx2="44"/>
</kerning>
<kerning kpx1="84">
<pair kern="-80" kpx2="111"/>
<pair kern="-18" kpx2="79"/>
<pair kern="-80" kpx2="119"/>
<pair kern="-50" kpx2="58"/>
<pair kern="-35" kpx2="114"/>
<pair kern="0" kpx2="104"/>
<pair kern="-74" kpx2="44"/>
<pair kern="-55" kpx2="59"/>
<pair kern="-92" kpx2="45"/>
<pair kern="-35" kpx2="105"/>
<pair kern="-93" kpx2="65"/>
<pair kern="-80" kpx2="97"/>
<pair kern="-45" kpx2="117"/>
<pair kern="-80" kpx2="121"/>
<pair kern="-74" kpx2="46"/>
<pair kern="-70" kpx2="101"/>
</kerning>
<kerning kpx1="121">
<pair kern="0" kpx2="111"/>
<pair kern="0" kpx2="97"/>
<pair kern="-65" kpx2="46"/>
<pair kern="0" kpx2="101"/>
<pair kern="-65" kpx2="44"/>
</kerning>
<kerning kpx1="120">
<pair kern="-15" kpx2="101"/>
</kerning>
<kerning kpx1="101">
<pair kern="-25" kpx2="119"/>
<pair kern="-15" kpx2="121"/>
<pair kern="0" kpx2="112"/>
<pair kern="0" kpx2="46"/>
<pair kern="-15" kpx2="103"/>
<pair kern="0" kpx2="98"/>
<pair kern="-15" kpx2="120"/>
<pair kern="-25" kpx2="118"/>
<pair kern="0" kpx2="44"/>
</kerning>
<kerning kpx1="99">
<pair kern="0" kpx2="107"/>
<pair kern="0" kpx2="104"/>
<pair kern="-15" kpx2="121"/>
<pair kern="0" kpx2="46"/>
<pair kern="0" kpx2="108"/>
<pair kern="0" kpx2="44"/>
</kerning>
<kerning kpx1="87">
<pair kern="-80" kpx2="111"/>
<pair kern="-10" kpx2="79"/>
<pair kern="-37" kpx2="58"/>
<pair kern="0" kpx2="104"/>
<pair kern="-92" kpx2="44"/>
<pair kern="-37" kpx2="59"/>
<pair kern="-65" kpx2="45"/>
<pair kern="-40" kpx2="105"/>
<pair kern="-120" kpx2="65"/>
<pair kern="-80" kpx2="97"/>
<pair kern="-50" kpx2="117"/>
<pair kern="-73" kpx2="121"/>
<pair kern="-92" kpx2="46"/>
<pair kern="-80" kpx2="101"/>
</kerning>
<kerning kpx1="104">
<pair kern="-5" kpx2="121"/>
</kerning>
<kerning kpx1="71">
<pair kern="0" kpx2="46"/>
<pair kern="0" kpx2="44"/>
</kerning>
<kerning kpx1="105">
<pair kern="-25" kpx2="118"/>
</kerning>
<kerning kpx1="65">
<pair kern="-55" kpx2="79"/>
<pair kern="-111" kpx2="146"/>
<pair kern="-92" kpx2="119"/>
<pair kern="-90" kpx2="87"/>
<pair kern="-40" kpx2="67"/>
<pair kern="0" kpx2="112"/>
<pair kern="-55" kpx2="81"/>
<pair kern="-40" kpx2="71"/>
<pair kern="-135" kpx2="86"/>
<pair kern="-74" kpx2="118"/>
<pair kern="0" kpx2="148"/>
<pair kern="-55" kpx2="85"/>
<pair kern="0" kpx2="117"/>
<pair kern="-105" kpx2="89"/>
<pair kern="-92" kpx2="121"/>
<pair kern="-111" kpx2="84"/>
</kerning>
<kerning kpx1="147">
<pair kern="-80" kpx2="65"/>
<pair kern="0" kpx2="145"/>
</kerning>
<kerning kpx1="78">
<pair kern="-35" kpx2="65"/>
<pair kern="0" kpx2="46"/>
<pair kern="0" kpx2="44"/>
</kerning>
<kerning kpx1="115">
<pair kern="0" kpx2="119"/>
</kerning>
<kerning kpx1="111">
<pair kern="-25" kpx2="119"/>
<pair kern="-10" kpx2="121"/>
<pair kern="0" kpx2="103"/>
<pair kern="0" kpx2="120"/>
<pair kern="-15" kpx2="118"/>
</kerning>
<kerning kpx1="114">
<pair kern="0" kpx2="111"/>
<pair kern="0" kpx2="100"/>
<pair kern="0" kpx2="107"/>
<pair kern="0" kpx2="114"/>
<pair kern="0" kpx2="99"/>
<pair kern="0" kpx2="112"/>
<pair kern="-18" kpx2="103"/>
<pair kern="0" kpx2="108"/>
<pair kern="0" kpx2="113"/>
<pair kern="0" kpx2="118"/>
<pair kern="-40" kpx2="44"/>
<pair kern="-20" kpx2="45"/>
<pair kern="0" kpx2="105"/>
<pair kern="0" kpx2="109"/>
<pair kern="0" kpx2="97"/>
<pair kern="0" kpx2="117"/>
<pair kern="0" kpx2="116"/>
<pair kern="0" kpx2="121"/>
<pair kern="-55" kpx2="46"/>
<pair kern="0" kpx2="110"/>
<pair kern="0" kpx2="115"/>
<pair kern="0" kpx2="101"/>
</kerning>
<kerning kpx1="108">
<pair kern="-10" kpx2="119"/>
<pair kern="0" kpx2="121"/>
</kerning>
<kerning kpx1="76">
<pair kern="0" kpx2="148"/>
<pair kern="-92" kpx2="146"/>
<pair kern="-74" kpx2="87"/>
<pair kern="-100" kpx2="89"/>
<pair kern="-55" kpx2="121"/>
<pair kern="-92" kpx2="84"/>
<pair kern="-100" kpx2="86"/>
</kerning>
<kerning kpx1="148">
<pair kern="0" kpx2="32"/>
</kerning>
<kerning kpx1="109">
<pair kern="0" kpx2="117"/>
<pair kern="0" kpx2="121"/>
</kerning>
<kerning kpx1="89">
<pair kern="-110" kpx2="111"/>
<pair kern="-111" kpx2="45"/>
<pair kern="-55" kpx2="105"/>
<pair kern="-30" kpx2="79"/>
<pair kern="-92" kpx2="58"/>
<pair kern="-100" kpx2="97"/>
<pair kern="-120" kpx2="65"/>
<pair kern="-111" kpx2="117"/>
<pair kern="-129" kpx2="46"/>
<pair kern="-100" kpx2="101"/>
<pair kern="-92" kpx2="59"/>
<pair kern="-129" kpx2="44"/>
</kerning>
<kerning kpx1="74">
<pair kern="0" kpx2="111"/>
<pair kern="0" kpx2="97"/>
<pair kern="-60" kpx2="65"/>
<pair kern="0" kpx2="117"/>
<pair kern="0" kpx2="46"/>
<pair kern="0" kpx2="101"/>
<pair kern="0" kpx2="44"/>
</kerning>
<kerning kpx1="46">
<pair kern="-70" kpx2="148"/>
<pair kern="-70" kpx2="146"/>
</kerning>
<kerning kpx1="110">
<pair kern="0" kpx2="117"/>
<pair kern="-15" kpx2="121"/>
<pair kern="-40" kpx2="118"/>
</kerning>
</font-metrics>
@@ -0,0 +1,236 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- $Id$ -->
<font-metrics>
<font-name>ZapfDingbats</font-name>
<full-name>ITC Zapf Dingbats</full-name>
<family-name>ZapfDingbats</family-name>
<class-name>ZapfDingbats</class-name>
<encoding>ZapfDingbatsEncoding</encoding>
<underline-position>-100</underline-position>
<underline-thickness>50</underline-thickness>
<cap-height>820</cap-height>
<x-height>426</x-height>
<ascender>820</ascender>
<descender>-143</descender>
<first-char>32</first-char>
<last-char>255</last-char>
<char-metrics>
<char name="space" width="278" llx="0" lly="0" urx="0" ury="0"/>
<char name="a1" width="974" llx="35" lly="72" urx="939" ury="621"/>
<char name="a2" width="961" llx="35" lly="81" urx="927" ury="611"/>
<char name="a202" width="974" llx="35" lly="72" urx="939" ury="621"/>
<char name="a3" width="980" llx="35" lly="0" urx="945" ury="692"/>
<char name="a4" width="719" llx="34" lly="139" urx="685" ury="566"/>
<char name="a5" width="789" llx="35" lly="-14" urx="755" ury="705"/>
<char name="a119" width="790" llx="35" lly="-14" urx="755" ury="705"/>
<char name="a118" width="791" llx="35" lly="-13" urx="761" ury="705"/>
<char name="a117" width="690" llx="34" lly="138" urx="655" ury="553"/>
<char name="a11" width="960" llx="35" lly="123" urx="925" ury="568"/>
<char name="a12" width="939" llx="35" lly="134" urx="904" ury="559"/>
<char name="a13" width="549" llx="29" lly="-11" urx="516" ury="705"/>
<char name="a14" width="855" llx="34" lly="59" urx="820" ury="632"/>
<char name="a15" width="911" llx="35" lly="50" urx="876" ury="642"/>
<char name="a16" width="933" llx="35" lly="139" urx="899" ury="550"/>
<char name="a105" width="911" llx="35" lly="50" urx="876" ury="642"/>
<char name="a17" width="945" llx="35" lly="139" urx="909" ury="553"/>
<char name="a18" width="974" llx="35" lly="104" urx="938" ury="587"/>
<char name="a19" width="755" llx="34" lly="-13" urx="721" ury="705"/>
<char name="a20" width="846" llx="36" lly="-14" urx="811" ury="705"/>
<char name="a21" width="762" llx="35" lly="0" urx="727" ury="692"/>
<char name="a22" width="761" llx="35" lly="0" urx="727" ury="692"/>
<char name="a23" width="571" llx="-1" lly="-68" urx="571" ury="661"/>
<char name="a24" width="677" llx="36" lly="-13" urx="642" ury="705"/>
<char name="a25" width="763" llx="35" lly="0" urx="728" ury="692"/>
<char name="a26" width="760" llx="35" lly="0" urx="726" ury="692"/>
<char name="a27" width="759" llx="35" lly="0" urx="725" ury="692"/>
<char name="a28" width="754" llx="35" lly="0" urx="720" ury="692"/>
<char name="a6" width="494" llx="35" lly="0" urx="460" ury="692"/>
<char name="a7" width="552" llx="35" lly="0" urx="517" ury="692"/>
<char name="a8" width="537" llx="35" lly="0" urx="503" ury="692"/>
<char name="a9" width="577" llx="35" lly="96" urx="542" ury="596"/>
<char name="a10" width="692" llx="35" lly="-14" urx="657" ury="705"/>
<char name="a29" width="786" llx="35" lly="-14" urx="751" ury="705"/>
<char name="a30" width="788" llx="35" lly="-14" urx="752" ury="705"/>
<char name="a31" width="788" llx="35" lly="-14" urx="753" ury="705"/>
<char name="a32" width="790" llx="35" lly="-14" urx="756" ury="705"/>
<char name="a33" width="793" llx="35" lly="-13" urx="759" ury="705"/>
<char name="a34" width="794" llx="35" lly="-13" urx="759" ury="705"/>
<char name="a35" width="816" llx="35" lly="-14" urx="782" ury="705"/>
<char name="a36" width="823" llx="35" lly="-14" urx="787" ury="705"/>
<char name="a37" width="789" llx="35" lly="-14" urx="754" ury="705"/>
<char name="a38" width="841" llx="35" lly="-14" urx="807" ury="705"/>
<char name="a39" width="823" llx="35" lly="-14" urx="789" ury="705"/>
<char name="a40" width="833" llx="35" lly="-14" urx="798" ury="705"/>
<char name="a41" width="816" llx="35" lly="-13" urx="782" ury="705"/>
<char name="a42" width="831" llx="35" lly="-14" urx="796" ury="705"/>
<char name="a43" width="923" llx="35" lly="-14" urx="888" ury="705"/>
<char name="a44" width="744" llx="35" lly="0" urx="710" ury="692"/>
<char name="a45" width="723" llx="35" lly="0" urx="688" ury="692"/>
<char name="a46" width="749" llx="35" lly="0" urx="714" ury="692"/>
<char name="a47" width="790" llx="34" lly="-14" urx="756" ury="705"/>
<char name="a48" width="792" llx="35" lly="-14" urx="758" ury="705"/>
<char name="a49" width="695" llx="35" lly="-14" urx="661" ury="706"/>
<char name="a50" width="776" llx="35" lly="-6" urx="741" ury="699"/>
<char name="a51" width="768" llx="35" lly="-7" urx="734" ury="699"/>
<char name="a52" width="792" llx="35" lly="-14" urx="757" ury="705"/>
<char name="a53" width="759" llx="35" lly="0" urx="725" ury="692"/>
<char name="a54" width="707" llx="35" lly="-13" urx="672" ury="704"/>
<char name="a55" width="708" llx="35" lly="-14" urx="672" ury="705"/>
<char name="a56" width="682" llx="35" lly="-14" urx="647" ury="705"/>
<char name="a57" width="701" llx="35" lly="-14" urx="666" ury="705"/>
<char name="a58" width="826" llx="35" lly="-14" urx="791" ury="705"/>
<char name="a59" width="815" llx="35" lly="-14" urx="780" ury="705"/>
<char name="a60" width="789" llx="35" lly="-14" urx="754" ury="705"/>
<char name="a61" width="789" llx="35" lly="-14" urx="754" ury="705"/>
<char name="a62" width="707" llx="34" lly="-14" urx="673" ury="705"/>
<char name="a63" width="687" llx="36" lly="0" urx="651" ury="692"/>
<char name="a64" width="696" llx="35" lly="0" urx="661" ury="691"/>
<char name="a65" width="689" llx="35" lly="0" urx="655" ury="692"/>
<char name="a66" width="786" llx="34" lly="-14" urx="751" ury="705"/>
<char name="a67" width="787" llx="35" lly="-14" urx="752" ury="705"/>
<char name="a68" width="713" llx="35" lly="-14" urx="678" ury="705"/>
<char name="a69" width="791" llx="35" lly="-14" urx="756" ury="705"/>
<char name="a70" width="785" llx="36" lly="-14" urx="751" ury="705"/>
<char name="a71" width="791" llx="35" lly="-14" urx="757" ury="705"/>
<char name="a72" width="873" llx="35" lly="-14" urx="838" ury="705"/>
<char name="a73" width="761" llx="35" lly="0" urx="726" ury="692"/>
<char name="a74" width="762" llx="35" lly="0" urx="727" ury="692"/>
<char name="a203" width="762" llx="35" lly="0" urx="727" ury="692"/>
<char name="a75" width="759" llx="35" lly="0" urx="725" ury="692"/>
<char name="a204" width="759" llx="35" lly="0" urx="725" ury="692"/>
<char name="a76" width="892" llx="35" lly="0" urx="858" ury="705"/>
<char name="a77" width="892" llx="35" lly="-14" urx="858" ury="692"/>
<char name="a78" width="788" llx="35" lly="-14" urx="754" ury="705"/>
<char name="a79" width="784" llx="35" lly="-14" urx="749" ury="705"/>
<char name="a81" width="438" llx="35" lly="-14" urx="403" ury="705"/>
<char name="a82" width="138" llx="35" lly="0" urx="104" ury="692"/>
<char name="a83" width="277" llx="35" lly="0" urx="242" ury="692"/>
<char name="a84" width="415" llx="35" lly="0" urx="380" ury="692"/>
<char name="a97" width="392" llx="35" lly="263" urx="357" ury="705"/>
<char name="a98" width="392" llx="34" lly="263" urx="357" ury="705"/>
<char name="a99" width="668" llx="35" lly="263" urx="633" ury="705"/>
<char name="a100" width="668" llx="36" lly="263" urx="634" ury="705"/>
<char name="a101" width="732" llx="35" lly="-143" urx="697" ury="806"/>
<char name="a102" width="544" llx="56" lly="-14" urx="488" ury="706"/>
<char name="a103" width="544" llx="34" lly="-14" urx="508" ury="705"/>
<char name="a104" width="910" llx="35" lly="40" urx="875" ury="651"/>
<char name="a106" width="667" llx="35" lly="-14" urx="633" ury="705"/>
<char name="a107" width="760" llx="35" lly="-14" urx="726" ury="705"/>
<char name="a108" width="760" llx="0" lly="121" urx="758" ury="569"/>
<char name="a112" width="776" llx="35" lly="0" urx="741" ury="705"/>
<char name="a111" width="595" llx="34" lly="-14" urx="560" ury="705"/>
<char name="a110" width="694" llx="35" lly="-14" urx="659" ury="705"/>
<char name="a109" width="626" llx="34" lly="0" urx="591" ury="705"/>
<char name="a120" width="788" llx="35" lly="-14" urx="754" ury="705"/>
<char name="a121" width="788" llx="35" lly="-14" urx="754" ury="705"/>
<char name="a122" width="788" llx="35" lly="-14" urx="754" ury="705"/>
<char name="a123" width="788" llx="35" lly="-14" urx="754" ury="705"/>
<char name="a124" width="788" llx="35" lly="-14" urx="754" ury="705"/>
<char name="a125" width="788" llx="35" lly="-14" urx="754" ury="705"/>
<char name="a126" width="788" llx="35" lly="-14" urx="754" ury="705"/>
<char name="a127" width="788" llx="35" lly="-14" urx="754" ury="705"/>
<char name="a128" width="788" llx="35" lly="-14" urx="754" ury="705"/>
<char name="a129" width="788" llx="35" lly="-14" urx="754" ury="705"/>
<char name="a130" width="788" llx="35" lly="-14" urx="754" ury="705"/>
<char name="a131" width="788" llx="35" lly="-14" urx="754" ury="705"/>
<char name="a132" width="788" llx="35" lly="-14" urx="754" ury="705"/>
<char name="a133" width="788" llx="35" lly="-14" urx="754" ury="705"/>
<char name="a134" width="788" llx="35" lly="-14" urx="754" ury="705"/>
<char name="a135" width="788" llx="35" lly="-14" urx="754" ury="705"/>
<char name="a136" width="788" llx="35" lly="-14" urx="754" ury="705"/>
<char name="a137" width="788" llx="35" lly="-14" urx="754" ury="705"/>
<char name="a138" width="788" llx="35" lly="-14" urx="754" ury="705"/>
<char name="a139" width="788" llx="35" lly="-14" urx="754" ury="705"/>
<char name="a140" width="788" llx="35" lly="-14" urx="754" ury="705"/>
<char name="a141" width="788" llx="35" lly="-14" urx="754" ury="705"/>
<char name="a142" width="788" llx="35" lly="-14" urx="754" ury="705"/>
<char name="a143" width="788" llx="35" lly="-14" urx="754" ury="705"/>
<char name="a144" width="788" llx="35" lly="-14" urx="754" ury="705"/>
<char name="a145" width="788" llx="35" lly="-14" urx="754" ury="705"/>
<char name="a146" width="788" llx="35" lly="-14" urx="754" ury="705"/>
<char name="a147" width="788" llx="35" lly="-14" urx="754" ury="705"/>
<char name="a148" width="788" llx="35" lly="-14" urx="754" ury="705"/>
<char name="a149" width="788" llx="35" lly="-14" urx="754" ury="705"/>
<char name="a150" width="788" llx="35" lly="-14" urx="754" ury="705"/>
<char name="a151" width="788" llx="35" lly="-14" urx="754" ury="705"/>
<char name="a152" width="788" llx="35" lly="-14" urx="754" ury="705"/>
<char name="a153" width="788" llx="35" lly="-14" urx="754" ury="705"/>
<char name="a154" width="788" llx="35" lly="-14" urx="754" ury="705"/>
<char name="a155" width="788" llx="35" lly="-14" urx="754" ury="705"/>
<char name="a156" width="788" llx="35" lly="-14" urx="754" ury="705"/>
<char name="a157" width="788" llx="35" lly="-14" urx="754" ury="705"/>
<char name="a158" width="788" llx="35" lly="-14" urx="754" ury="705"/>
<char name="a159" width="788" llx="35" lly="-14" urx="754" ury="705"/>
<char name="a160" width="894" llx="35" lly="58" urx="860" ury="634"/>
<char name="a161" width="838" llx="35" lly="152" urx="803" ury="540"/>
<char name="a163" width="1016" llx="34" lly="152" urx="981" ury="540"/>
<char name="a164" width="458" llx="35" lly="-127" urx="422" ury="820"/>
<char name="a196" width="748" llx="35" lly="94" urx="698" ury="597"/>
<char name="a165" width="924" llx="35" lly="140" urx="890" ury="552"/>
<char name="a192" width="748" llx="35" lly="94" urx="698" ury="597"/>
<char name="a166" width="918" llx="35" lly="166" urx="884" ury="526"/>
<char name="a167" width="927" llx="35" lly="32" urx="892" ury="660"/>
<char name="a168" width="928" llx="35" lly="129" urx="891" ury="562"/>
<char name="a169" width="928" llx="35" lly="128" urx="893" ury="563"/>
<char name="a170" width="834" llx="35" lly="155" urx="799" ury="537"/>
<char name="a171" width="873" llx="35" lly="93" urx="838" ury="599"/>
<char name="a172" width="828" llx="35" lly="104" urx="791" ury="588"/>
<char name="a173" width="924" llx="35" lly="98" urx="889" ury="594"/>
<char name="a162" width="924" llx="35" lly="98" urx="889" ury="594"/>
<char name="a174" width="917" llx="35" lly="0" urx="882" ury="692"/>
<char name="a175" width="930" llx="35" lly="84" urx="896" ury="608"/>
<char name="a176" width="931" llx="35" lly="84" urx="896" ury="608"/>
<char name="a177" width="463" llx="35" lly="-99" urx="429" ury="791"/>
<char name="a178" width="883" llx="35" lly="71" urx="848" ury="623"/>
<char name="a179" width="836" llx="35" lly="44" urx="802" ury="648"/>
<char name="a193" width="836" llx="35" lly="44" urx="802" ury="648"/>
<char name="a180" width="867" llx="35" lly="101" urx="832" ury="591"/>
<char name="a199" width="867" llx="35" lly="101" urx="832" ury="591"/>
<char name="a181" width="696" llx="35" lly="44" urx="661" ury="648"/>
<char name="a200" width="696" llx="35" lly="44" urx="661" ury="648"/>
<char name="a182" width="874" llx="35" lly="77" urx="840" ury="619"/>
<char name="a201" width="874" llx="35" lly="73" urx="840" ury="615"/>
<char name="a183" width="760" llx="35" lly="0" urx="725" ury="692"/>
<char name="a184" width="946" llx="35" lly="160" urx="911" ury="533"/>
<char name="a197" width="771" llx="34" lly="37" urx="736" ury="655"/>
<char name="a185" width="865" llx="35" lly="207" urx="830" ury="481"/>
<char name="a194" width="771" llx="34" lly="37" urx="736" ury="655"/>
<char name="a198" width="888" llx="34" lly="-19" urx="853" ury="712"/>
<char name="a186" width="967" llx="35" lly="124" urx="932" ury="568"/>
<char name="a195" width="888" llx="34" lly="-19" urx="853" ury="712"/>
<char name="a187" width="831" llx="35" lly="113" urx="796" ury="579"/>
<char name="a188" width="873" llx="36" lly="118" urx="838" ury="578"/>
<char name="a189" width="927" llx="35" lly="150" urx="891" ury="542"/>
<char name="a190" width="970" llx="35" lly="76" urx="931" ury="616"/>
<char name="a191" width="918" llx="34" lly="99" urx="884" ury="593"/>
<char name="a86" width="410" llx="35" lly="0" urx="375" ury="692"/>
<char name="a85" width="509" llx="35" lly="0" urx="475" ury="692"/>
<char name="a95" width="334" llx="35" lly="0" urx="299" ury="692"/>
<char name="a205" width="509" llx="35" lly="0" urx="475" ury="692"/>
<char name="a89" width="390" llx="35" lly="-14" urx="356" ury="705"/>
<char name="a87" width="234" llx="35" lly="-14" urx="199" ury="705"/>
<char name="a91" width="276" llx="35" lly="0" urx="242" ury="692"/>
<char name="a90" width="390" llx="35" lly="-14" urx="355" ury="705"/>
<char name="a206" width="410" llx="35" lly="0" urx="375" ury="692"/>
<char name="a94" width="317" llx="35" lly="0" urx="283" ury="692"/>
<char name="a93" width="317" llx="35" lly="0" urx="283" ury="692"/>
<char name="a92" width="276" llx="35" lly="0" urx="242" ury="692"/>
<char name="a96" width="334" llx="35" lly="0" urx="299" ury="692"/>
<char name="a88" width="234" llx="35" lly="-14" urx="199" ury="705"/>
</char-metrics>
</font-metrics>
+633
View File
@@ -0,0 +1,633 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- $Id$ -->
<!-- JKT: these mappings were kindly produced by Fotis Jannidis -->
<font-mappings>
<map adobe-name="A" win-ansi="0x0041" unicode="0x0041"/>
<map adobe-name="AE" win-ansi="0x00C6" unicode="0x00C6"/>
<map adobe-name="Aacute" win-ansi="0x00C1" unicode="0x00C1"/>
<map adobe-name="Acircumflex" win-ansi="0x00C2" unicode="0x00C2"/>
<map adobe-name="Adieresis" win-ansi="0x00C4" unicode="0x00C4"/>
<map adobe-name="Agrave" win-ansi="0x00C0" unicode="0x00C0"/>
<map adobe-name="Aring" win-ansi="0x00C5" unicode="0x00C5"/>
<map adobe-name="Atilde" win-ansi="0x00C3" unicode="0x00C3"/>
<map adobe-name="B" win-ansi="0x0042" unicode="0x0042"/>
<map adobe-name="C" win-ansi="0x0043" unicode="0x0043"/>
<map adobe-name="Ccedilla" win-ansi="0x00C7" unicode="0x00C7"/>
<map adobe-name="D" win-ansi="0x0044" unicode="0x0044"/>
<map adobe-name="E" win-ansi="0x0045" unicode="0x0045"/>
<map adobe-name="Eacute" win-ansi="0x00C9" unicode="0x00C9"/>
<map adobe-name="Ecircumflex" win-ansi="0x00CA" unicode="0x00CA"/>
<map adobe-name="Edieresis" win-ansi="0x00CB" unicode="0x00CB"/>
<map adobe-name="Egrave" win-ansi="0x00C8" unicode="0x00C8"/>
<map adobe-name="Eth" win-ansi="0x00D0" unicode="0x00D0"/>
<map adobe-name="Euro" win-ansi="0x0080" unicode="0x20AC"/>
<map adobe-name="F" win-ansi="0x0046" unicode="0x0046"/>
<map adobe-name="G" win-ansi="0x0047" unicode="0x0047"/>
<map adobe-name="Gcaron" win-ansi="-1" unicode="0x01E6"/>
<map adobe-name="H" win-ansi="0x0048" unicode="0x0048"/>
<map adobe-name="I" win-ansi="0x0049" unicode="0x0049"/>
<map adobe-name="Iacute" win-ansi="0x00CD" unicode="0x00CD"/>
<map adobe-name="Icircumflex" win-ansi="0x00CE" unicode="0x00CE"/>
<map adobe-name="Idieresis" win-ansi="0x00CF" unicode="0x00CF"/>
<map adobe-name="Idot" win-ansi="-1" unicode="0x0130"/>
<map adobe-name="Igrave" win-ansi="0x00CC" unicode="0x00CC"/>
<map adobe-name="IJ" win-ansi="-1" unicode="0x0132"/>
<map adobe-name="J" win-ansi="0x004A" unicode="0x004A"/>
<map adobe-name="K" win-ansi="0x004B" unicode="0x004B"/>
<map adobe-name="L" win-ansi="0x004C" unicode="0x004C"/>
<map adobe-name="Lslash" win-ansi="-1" unicode="0x0141"/>
<map adobe-name="M" win-ansi="0x004D" unicode="0x004D"/>
<map adobe-name="N" win-ansi="0x004E" unicode="0x004E"/>
<map adobe-name="Ntilde" win-ansi="0x00D1" unicode="0x00D1"/>
<map adobe-name="O" win-ansi="0x004F" unicode="0x004F"/>
<map adobe-name="OE" win-ansi="0x008C" unicode="0x0152"/>
<map adobe-name="Oacute" win-ansi="0x00D3" unicode="0x00D3"/>
<map adobe-name="Ocircumflex" win-ansi="0x00D4" unicode="0x00D4"/>
<map adobe-name="Odieresis" win-ansi="0x00D6" unicode="0x00D6"/>
<map adobe-name="Ograve" win-ansi="0x00D2" unicode="0x00D2"/>
<map adobe-name="Oslash" win-ansi="0x00D8" unicode="0x00D8"/>
<map adobe-name="Otilde" win-ansi="0x00D5" unicode="0x00D5"/>
<map adobe-name="P" win-ansi="0x0050" unicode="0x0050"/>
<map adobe-name="Q" win-ansi="0x0051" unicode="0x0051"/>
<map adobe-name="R" win-ansi="0x0052" unicode="0x0052"/>
<map adobe-name="S" win-ansi="0x0053" unicode="0x0053"/>
<map adobe-name="Scaron" win-ansi="0x008A" unicode="0x0160"/>
<map adobe-name="Scedilla" win-ansi="-1" unicode="0x015E"/>
<map adobe-name="T" win-ansi="0x0054" unicode="0x0054"/>
<map adobe-name="Thorn" win-ansi="0x00DE" unicode="0x00DE"/>
<map adobe-name="U" win-ansi="0x0055" unicode="0x0055"/>
<map adobe-name="Uacute" win-ansi="0x00DA" unicode="0x00DA"/>
<map adobe-name="Ucircumflex" win-ansi="0x00DB" unicode="0x00DB"/>
<map adobe-name="Udieresis" win-ansi="0x00DC" unicode="0x00DC"/>
<map adobe-name="Ugrave" win-ansi="0x00D9" unicode="0x00D9"/>
<map adobe-name="V" win-ansi="0x0056" unicode="0x0056"/>
<map adobe-name="W" win-ansi="0x0057" unicode="0x0057"/>
<map adobe-name="X" win-ansi="0x0058" unicode="0x0058"/>
<map adobe-name="Y" win-ansi="0x0059" unicode="0x0059"/>
<map adobe-name="Yacute" win-ansi="0x00DD" unicode="0x00DD"/>
<map adobe-name="Ydieresis" win-ansi="0x009F" unicode="0x0178"/>
<map adobe-name="Z" win-ansi="0x005A" unicode="0x005A"/>
<map adobe-name="Zcaron" win-ansi="-1" unicode="0x017D"/>
<map adobe-name="a" win-ansi="0x0061" unicode="0x0061"/>
<map adobe-name="aacute" win-ansi="0x00E1" unicode="0x00E1"/>
<map adobe-name="acircumflex" win-ansi="0x00E2" unicode="0x00E2"/>
<map adobe-name="acute" win-ansi="0x00B4" unicode="0x00B4"/>
<map adobe-name="adieresis" win-ansi="0x00E4" unicode="0x00E4"/>
<map adobe-name="ae" win-ansi="0x00E6" unicode="0x00E6"/>
<map adobe-name="agrave" win-ansi="0x00E0" unicode="0x00E0"/>
<map adobe-name="ampersand" win-ansi="0x0026" unicode="0x0026"/>
<map adobe-name="aring" win-ansi="0x00E5" unicode="0x00E5"/>
<!-- fj <map adobe-name="arrowboth" win-ansi="-1" unicode="0x2195"/>-->
<!-- fj <map adobe-name="arrowdown" win-ansi="-1" unicode="0x2193"/>-->
<!-- fj <map adobe-name="arrowleft" win-ansi="-1" unicode="0x2194"/>-->
<!-- fj <map adobe-name="arrowright" win-ansi="-1" unicode="0x2192"/>-->
<!-- fj <map adobe-name="arrowup" win-ansi="-1" unicode="0x2191"/>-->
<map adobe-name="asciicircum" win-ansi="0x005E" unicode="0x005E"/>
<map adobe-name="asciitilde" win-ansi="0x007E" unicode="0x007E"/>
<map adobe-name="asterisk" win-ansi="0x002A" unicode="0x002A"/>
<map adobe-name="at" win-ansi="0x0040" unicode="0x0040"/>
<map adobe-name="atilde" win-ansi="0x00E3" unicode="0x00E3"/>
<map adobe-name="b" win-ansi="0x0062" unicode="0x0062"/>
<map adobe-name="backslash" win-ansi="0x005C" unicode="0x005C"/>
<map adobe-name="bar" win-ansi="0x007C" unicode="0x007C"/>
<map adobe-name="braceleft" win-ansi="0x007B" unicode="0x007B"/>
<map adobe-name="braceright" win-ansi="0x007D" unicode="0x007D"/>
<map adobe-name="bracketleft" win-ansi="0x005B" unicode="0x005B"/>
<map adobe-name="bracketright" win-ansi="0x005D" unicode="0x005D"/>
<map adobe-name="breve" win-ansi="-1" unicode="0x02D8"/>
<map adobe-name="brokenbar" win-ansi="0x00A6" unicode="0x00A6"/>
<map adobe-name="bullet" win-ansi="0x0095" unicode="0x2022"/>
<map adobe-name="c" win-ansi="0x0063" unicode="0x0063"/>
<map adobe-name="caron" win-ansi="-1" unicode="0x02C7"/>
<map adobe-name="ccedilla" win-ansi="0x00E7" unicode="0x00E7"/>
<map adobe-name="cedilla" win-ansi="0x00B8" unicode="0x00B8"/>
<map adobe-name="cent" win-ansi="0x00A2" unicode="0x00A2"/>
<map adobe-name="circumflex" win-ansi="0x0088" unicode="0x02C6"/>
<map adobe-name="colon" win-ansi="0x003A" unicode="0x003A"/>
<map adobe-name="comma" win-ansi="0x002C" unicode="0x002C"/>
<map adobe-name="copyright" win-ansi="0x00A9" unicode="0x00A9"/>
<map adobe-name="currency" win-ansi="0x00A4" unicode="0x00A4"/>
<map adobe-name="d" win-ansi="0x0064" unicode="0x0064"/>
<map adobe-name="dagger" win-ansi="0x0086" unicode="0x2020"/>
<map adobe-name="daggerdbl" win-ansi="0x0087" unicode="0x2021"/>
<map adobe-name="degree" win-ansi="0x00B0" unicode="0x00B0"/>
<map adobe-name="dieresis" win-ansi="0x00A8" unicode="0x00A8"/>
<map adobe-name="divide" win-ansi="0x00F7" unicode="0x00F7"/>
<map adobe-name="dollar" win-ansi="0x0024" unicode="0x0024"/>
<map adobe-name="dotaccent" win-ansi="-1" unicode="0x02D9"/>
<map adobe-name="dotlessi" win-ansi="-1" unicode="0x0269"/>
<map adobe-name="e" win-ansi="0x0065" unicode="0x0065"/>
<map adobe-name="eacute" win-ansi="0x00E9" unicode="0x00E9"/>
<map adobe-name="ecircumflex" win-ansi="0x00EA" unicode="0x00EA"/>
<map adobe-name="edieresis" win-ansi="0x00EB" unicode="0x00EB"/>
<map adobe-name="egrave" win-ansi="0x00E8" unicode="0x00E8"/>
<map adobe-name="eight" win-ansi="0x0038" unicode="0x0038"/>
<map adobe-name="ellipsis" win-ansi="0x0085" unicode="0x2026"/>
<map adobe-name="emdash" win-ansi="0x0097" unicode="0x2014"/>
<map adobe-name="endash" win-ansi="0x0096" unicode="0x2013"/>
<map adobe-name="equal" win-ansi="0x003D" unicode="0x003D"/>
<map adobe-name="eth" win-ansi="0x00F0" unicode="0x00F0"/>
<map adobe-name="exclam" win-ansi="0x0021" unicode="0x0021"/>
<map adobe-name="exclamdown" win-ansi="0x00A1" unicode="0x00A1"/>
<map adobe-name="f" win-ansi="0x0066" unicode="0x0066"/>
<map adobe-name="fi" win-ansi="-1" unicode="-1"/>
<map adobe-name="five" win-ansi="0x0035" unicode="0x0035"/>
<map adobe-name="fl" win-ansi="-1" unicode="-1"/>
<map adobe-name="florin" win-ansi="0x0083" unicode="0x0083"/>
<map adobe-name="four" win-ansi="0x0034" unicode="0x0034"/>
<!-- fj <map adobe-name="fraction" win-ansi="-1" unicode="0x2044"/> -->
<map adobe-name="g" win-ansi="0x0067" unicode="0x0067"/>
<map adobe-name="gcaron" win-ansi="-1" unicode="0x01E7"/>
<map adobe-name="germandbls" win-ansi="0x00DF" unicode="0x00DF"/>
<map adobe-name="grave" win-ansi="0x0060" unicode="0x0060"/>
<map adobe-name="greater" win-ansi="0x003E" unicode="0x003E"/>
<map adobe-name="guillemotleft" win-ansi="0x00AB" unicode="0x00AB"/>
<map adobe-name="guillemotright" win-ansi="0x00BB" unicode="0x00BB"/>
<map adobe-name="guilsinglleft" win-ansi="0x008B" unicode="0x2039"/>
<map adobe-name="guilsinglright" win-ansi="0x009B" unicode="0x203A"/>
<map adobe-name="h" win-ansi="0x0068" unicode="0x0068"/>
<map adobe-name="hungarumlaut" win-ansi="-1" unicode="0x02DD"/>
<map adobe-name="hyphen" win-ansi="0x002D" unicode="0x002D"/>
<map adobe-name="i" win-ansi="0x0069" unicode="0x0069"/>
<map adobe-name="iacute" win-ansi="0x00ED" unicode="0x00ED"/>
<map adobe-name="icircumflex" win-ansi="0x00EE" unicode="0x00EE"/>
<map adobe-name="idieresis" win-ansi="0x00EF" unicode="0x00EF"/>
<map adobe-name="igrave" win-ansi="0x00EC" unicode="0x00EC"/>
<map adobe-name="ij" win-ansi="-1" unicode="0x0133"/>
<map adobe-name="j" win-ansi="0x006A" unicode="0x006A"/>
<map adobe-name="k" win-ansi="0x006B" unicode="0x006B"/>
<map adobe-name="l" win-ansi="0x006C" unicode="0x006C"/>
<map adobe-name="less" win-ansi="0x003C" unicode="0x003C"/>
<map adobe-name="lira" win-ansi="-1" unicode="0x20A4"/>
<map adobe-name="logicalnot" win-ansi="0x00AC" unicode="0x00AC"/>
<map adobe-name="lslash" win-ansi="-1" unicode="0x0142"/>
<map adobe-name="m" win-ansi="0x006D" unicode="0x006D"/>
<map adobe-name="macron" win-ansi="0x00AF" unicode="0x00AF"/>
<!-- fj <map adobe-name="minus" win-ansi="-1" unicode="0x2212"/>-->
<map adobe-name="mu" win-ansi="0x00B5" unicode="0x00B5"/>
<map adobe-name="multiply" win-ansi="0x00D7" unicode="0x00D7"/>
<map adobe-name="n" win-ansi="0x006E" unicode="0x006E"/>
<!-- JKT: the following is not actually an adobe named character -->
<map adobe-name="nbsp" win-ansi="0x00A0" unicode="0x00A0"/>
<map adobe-name="nine" win-ansi="0x0039" unicode="0x0039"/>
<map adobe-name="ntilde" win-ansi="0x00F1" unicode="0x00F1"/>
<map adobe-name="numbersign" win-ansi="0x0023" unicode="0x0023"/>
<map adobe-name="o" win-ansi="0x006F" unicode="0x006F"/>
<map adobe-name="oacute" win-ansi="0x00F3" unicode="0x00F3"/>
<map adobe-name="ocircumflex" win-ansi="0x00F4" unicode="0x00F4"/>
<map adobe-name="odieresis" win-ansi="0x00F6" unicode="0x00F6"/>
<map adobe-name="oe" win-ansi="0x009C" unicode="0x0153"/>
<map adobe-name="ogonek" win-ansi="-1" unicode="0x02DB"/>
<map adobe-name="ograve" win-ansi="0x00F2" unicode="0x00F2"/>
<map adobe-name="one" win-ansi="0x0031" unicode="0x0031"/>
<map adobe-name="onehalf" win-ansi="0x00BD" unicode="0x00BD"/>
<map adobe-name="onequarter" win-ansi="0x00BC" unicode="0x00BC"/>
<map adobe-name="onesuperior" win-ansi="0x00B9" unicode="0x00B9"/>
<map adobe-name="ordfeminine" win-ansi="0x00AA" unicode="0x00AA"/>
<map adobe-name="ordmasculine" win-ansi="0x00BA" unicode="0x00BA"/>
<map adobe-name="oslash" win-ansi="0x00F8" unicode="0x00F8"/>
<map adobe-name="otilde" win-ansi="0x00F5" unicode="0x00F5"/>
<map adobe-name="p" win-ansi="0x0070" unicode="0x0070"/>
<map adobe-name="paragraph" win-ansi="0x00B6" unicode="0x00B6"/>
<map adobe-name="parenleft" win-ansi="0x0028" unicode="0x0028"/>
<map adobe-name="parenright" win-ansi="0x0029" unicode="0x0029"/>
<map adobe-name="percent" win-ansi="0x0025" unicode="0x0025"/>
<map adobe-name="period" win-ansi="0x002E" unicode="0x002E"/>
<map adobe-name="periodcentered" win-ansi="0x00B7" unicode="0x00B7"/>
<map adobe-name="perthousand" win-ansi="0x0089" unicode="0x2030"/>
<map adobe-name="plus" win-ansi="0x002B" unicode="0x002B"/>
<map adobe-name="plusminus" win-ansi="0x00B1" unicode="0x00B1"/>
<map adobe-name="q" win-ansi="0x0071" unicode="0x0071"/>
<map adobe-name="question" win-ansi="0x003F" unicode="0x003F"/>
<map adobe-name="questiondown" win-ansi="0x00BF" unicode="0x00BF"/>
<map adobe-name="quotedbl" win-ansi="0x0022" unicode="0x0022"/>
<map adobe-name="quotedblbase" win-ansi="0x0084" unicode="0x201E"/>
<map adobe-name="quotedblleft" win-ansi="0x0093" unicode="0x201C"/>
<map adobe-name="quotedblright" win-ansi="0x0094" unicode="0x201D"/>
<map adobe-name="quoteleft" win-ansi="0x0091" unicode="0x2018"/>
<map adobe-name="quoteright" win-ansi="0x0092" unicode="0x2019"/>
<map adobe-name="quotesinglbase" win-ansi="0x0082" unicode="0x201A"/>
<map adobe-name="quotesingle" win-ansi="0x0027" unicode="0x0027"/>
<map adobe-name="r" win-ansi="0x0072" unicode="0x0072"/>
<map adobe-name="registered" win-ansi="0x00AE" unicode="0x00AE"/>
<map adobe-name="s" win-ansi="0x0073" unicode="0x0073"/>
<map adobe-name="scaron" win-ansi="0x009A" unicode="0x0161"/>
<map adobe-name="scedilla" win-ansi="-1" unicode="0x015F"/>
<map adobe-name="section" win-ansi="0x00A7" unicode="0x00A7"/>
<map adobe-name="semicolon" win-ansi="0x003B" unicode="0x003B"/>
<map adobe-name="seven" win-ansi="0x0037" unicode="0x0037"/>
<map adobe-name="six" win-ansi="0x0036" unicode="0x0036"/>
<map adobe-name="slash" win-ansi="0x002F" unicode="0x002F"/>
<map adobe-name="space" win-ansi="0x0020" unicode="0x0020"/>
<map adobe-name="sterling" win-ansi="0x00A3" unicode="0x00A3"/>
<map adobe-name="t" win-ansi="0x0074" unicode="0x0074"/>
<map adobe-name="thorn" win-ansi="0x00FE" unicode="0x00FE"/>
<map adobe-name="three" win-ansi="0x0033" unicode="0x0033"/>
<map adobe-name="threequarters" win-ansi="0x00BE" unicode="0x00BE"/>
<map adobe-name="threesuperior" win-ansi="0x00B3" unicode="0x00B3"/>
<map adobe-name="tilde" win-ansi="0x0098" unicode="0x02DC"/>
<map adobe-name="trademark" win-ansi="0x0099" unicode="0x2122"/>
<map adobe-name="two" win-ansi="0x0032" unicode="0x0032"/>
<map adobe-name="twosuperior" win-ansi="0x00B2" unicode="0x00B2"/>
<map adobe-name="u" win-ansi="0x0075" unicode="0x0075"/>
<map adobe-name="uacute" win-ansi="0x00FA" unicode="0x00FA"/>
<map adobe-name="ucircumflex" win-ansi="0x00FB" unicode="0x00FB"/>
<map adobe-name="udieresis" win-ansi="0x00FC" unicode="0x00FC"/>
<map adobe-name="ugrave" win-ansi="0x00F9" unicode="0x00F9"/>
<map adobe-name="underscore" win-ansi="0x005F" unicode="0x005F"/>
<map adobe-name="v" win-ansi="0x0076" unicode="0x0076"/>
<map adobe-name="w" win-ansi="0x0077" unicode="0x0077"/>
<map adobe-name="x" win-ansi="0x0078" unicode="0x0078"/>
<map adobe-name="y" win-ansi="0x0079" unicode="0x0079"/>
<map adobe-name="yacute" win-ansi="0x00FD" unicode="0x00FD"/>
<map adobe-name="ydieresis" win-ansi="0x00FF" unicode="0x00FF"/>
<map adobe-name="yen" win-ansi="0x00A5" unicode="0x00A5"/>
<map adobe-name="z" win-ansi="0x007A" unicode="0x007A"/>
<map adobe-name="zcaron" win-ansi="-1" unicode="0x017E"/>
<map adobe-name="zero" win-ansi="0x0030" unicode="0x0030"/>
<!-- the following mappings are used for the font zapfdingbats -->
<map adobe-name="a1" win-ansi="0x0021" unicode="0x2701" unicodeName="UPPER BLADE SCISSORS"/>
<map adobe-name="a2" win-ansi="0x0022" unicode="0x2702" unicodeName="BLACK SCISSORS"/>
<map adobe-name="a202" win-ansi="0x0023" unicode="0x2703" unicodeName="LOWER BLADE SCISSORS"/>
<map adobe-name="a3" win-ansi="0x0024" unicode="0x2704" unicodeName="WHITE SCISSORS"/>
<map adobe-name="a4" win-ansi="0x0025" unicode="0x260E" unicodeName="BLACK TELEPHONE"/>
<map adobe-name="a5" win-ansi="0x0026" unicode="0x2706" unicodeName="TELEPHONE LOCATION SIGN"/>
<map adobe-name="a119" win-ansi="0x0027" unicode="0x2707" unicodeName="TAPE DRIVE"/>
<map adobe-name="a118" win-ansi="0x0028" unicode="0x2708" unicodeName="AIRPLANE"/>
<map adobe-name="a117" win-ansi="0x0029" unicode="0x2709" unicodeName="ENVELOPE"/>
<map adobe-name="a11" win-ansi="0x002A" unicode="0x261B" unicodeName="BLACK RIGHT POINTING INDEX"/>
<map adobe-name="a12" win-ansi="0x002B" unicode="0x261E" unicodeName="WHITE RIGHT POINTING INDEX"/>
<map adobe-name="a13" win-ansi="0x002C" unicode="0x270C" unicodeName="VICTORY HAND"/>
<map adobe-name="a14" win-ansi="0x002D" unicode="0x270D" unicodeName="WRITING HAND"/>
<map adobe-name="a15" win-ansi="0x002E" unicode="0x270E" unicodeName="LOWER RIGHT PENCIL"/>
<map adobe-name="a16" win-ansi="0x002F" unicode="0x270F" unicodeName="PENCIL"/>
<map adobe-name="a105" win-ansi="0x0030" unicode="0x2710" unicodeName="UPPER RIGHT PENCIL"/>
<map adobe-name="a17" win-ansi="0x0031" unicode="0x2711" unicodeName="WHITE NIB"/>
<map adobe-name="a18" win-ansi="0x0032" unicode="0x2712" unicodeName="BLACK NIB"/>
<map adobe-name="a19" win-ansi="0x0033" unicode="0x2713" unicodeName="CHECK MARK"/>
<map adobe-name="a20" win-ansi="0x0034" unicode="0x2714" unicodeName="HEAVY CHECK MARK"/>
<map adobe-name="a21" win-ansi="0x0035" unicode="0x2715" unicodeName="MULTIPLICATION X"/>
<map adobe-name="a22" win-ansi="0x0036" unicode="0x2716" unicodeName="HEAVY MULTIPLICATION X"/>
<map adobe-name="a23" win-ansi="0x0037" unicode="0x2717" unicodeName="BALLOT X"/>
<map adobe-name="a24" win-ansi="0x0038" unicode="0x2718" unicodeName="HEAVY BALLOT X"/>
<map adobe-name="a25" win-ansi="0x0039" unicode="0x2719" unicodeName="OUTLINED GREEK CROSS"/>
<map adobe-name="a26" win-ansi="0x003A" unicode="0x271A" unicodeName="HEAVY GREEK CROSS"/>
<map adobe-name="a27" win-ansi="0x003B" unicode="0x271B" unicodeName="OPEN CENTRE CROSS"/>
<map adobe-name="a28" win-ansi="0x003C" unicode="0x271C" unicodeName="HEAVY OPEN CENTRE CROSS"/>
<map adobe-name="a6" win-ansi="0x003D" unicode="0x271D" unicodeName="LATIN CROSS"/>
<map adobe-name="a7" win-ansi="0x003E" unicode="0x271E" unicodeName="SHADOWED WHITE LATIN CROSS"/>
<map adobe-name="a8" win-ansi="0x003F" unicode="0x271F" unicodeName="OUTLINED LATIN CROSS"/>
<map adobe-name="a9" win-ansi="0x0040" unicode="0x2720" unicodeName="MALTESE CROSS"/>
<map adobe-name="a10" win-ansi="0x0041" unicode="0x2721" unicodeName="STAR OF DAVID"/>
<map adobe-name="a29" win-ansi="0x0042" unicode="0x2722" unicodeName="FOUR TEARDROP-SPOKED ASTERISK"/>
<map adobe-name="a30" win-ansi="0x0043" unicode="0x2723" unicodeName="FOUR BALLOON-SPOKED ASTERISK"/>
<map adobe-name="a31" win-ansi="0x0044" unicode="0x2724" unicodeName="HEAVY FOUR BALLOON-SPOKED ASTERISK"/>
<map adobe-name="a32" win-ansi="0x0045" unicode="0x2725" unicodeName="FOUR CLUB-SPOKED ASTERISK"/>
<map adobe-name="a33" win-ansi="0x0046" unicode="0x2726" unicodeName="BLACK FOUR POINTED STAR"/>
<map adobe-name="a34" win-ansi="0x0047" unicode="0x2727" unicodeName="WHITE FOUR POINTED STAR"/>
<map adobe-name="a35" win-ansi="0x0048" unicode="0x2605" unicodeName="BLACK STAR"/>
<map adobe-name="a36" win-ansi="0x0049" unicode="0x2729" unicodeName="STRESS OUTLINED WHITE STAR"/>
<map adobe-name="a37" win-ansi="0x004A" unicode="0x272A" unicodeName="CIRCLED WHITE STAR"/>
<map adobe-name="a38" win-ansi="0x004B" unicode="0x272B" unicodeName="OPEN CENTRE BLACK STAR"/>
<map adobe-name="a39" win-ansi="0x004C" unicode="0x272C" unicodeName="BLACK CENTRE WHITE STAR"/>
<map adobe-name="a40" win-ansi="0x004D" unicode="0x272D" unicodeName="OUTLINED BLACK STAR"/>
<map adobe-name="a41" win-ansi="0x004E" unicode="0x272E" unicodeName="HEAVY OUTLINED BLACK STAR"/>
<map adobe-name="a42" win-ansi="0x004F" unicode="0x272F" unicodeName="PINWHEEL STAR"/>
<map adobe-name="a43" win-ansi="0x0050" unicode="0x2730" unicodeName="SHADOWED WHITE STAR"/>
<map adobe-name="a44" win-ansi="0x0051" unicode="0x2731" unicodeName="HEAVY ASTERISK"/>
<map adobe-name="a45" win-ansi="0x0052" unicode="0x2732" unicodeName="OPEN CENTRE ASTERISK"/>
<map adobe-name="a46" win-ansi="0x0053" unicode="0x2733" unicodeName="EIGHT SPOKED ASTERISK"/>
<map adobe-name="a47" win-ansi="0x0054" unicode="0x2734" unicodeName="EIGHT POINTED BLACK STAR"/>
<map adobe-name="a48" win-ansi="0x0055" unicode="0x2735" unicodeName="EIGHT POINTED PINWHEEL STAR"/>
<map adobe-name="a49" win-ansi="0x0056" unicode="0x2736" unicodeName="SIX POINTED BLACK STAR"/>
<map adobe-name="a50" win-ansi="0x0057" unicode="0x2737" unicodeName="EIGHT POINTED RECTILINEAR BLACK STAR"/>
<map adobe-name="a51" win-ansi="0x0058" unicode="0x2738" unicodeName="HEAVY EIGHT POINTED RECTILINEAR BLACK STAR"/>
<map adobe-name="a52" win-ansi="0x0059" unicode="0x2739" unicodeName="TWELVE POINTED BLACK STAR"/>
<map adobe-name="a53" win-ansi="0x005A" unicode="0x273A" unicodeName="SIXTEEN POINTED ASTERISK"/>
<map adobe-name="a54" win-ansi="0x005B" unicode="0x273B" unicodeName="TEARDROP-SPOKED ASTERISK"/>
<map adobe-name="a55" win-ansi="0x005C" unicode="0x273C" unicodeName="OPEN CENTRE TEARDROP-SPOKED ASTERISK"/>
<map adobe-name="a56" win-ansi="0x005D" unicode="0x273D" unicodeName="HEAVY TEARDROP-SPOKED ASTERISK"/>
<map adobe-name="a57" win-ansi="0x005E" unicode="0x273E" unicodeName="SIX PETALLED BLACK AND WHITE FLORETTE"/>
<map adobe-name="a58" win-ansi="0x005F" unicode="0x273F" unicodeName="BLACK FLORETTE"/>
<map adobe-name="a59" win-ansi="0x0060" unicode="0x2740" unicodeName="WHITE FLORETTE"/>
<map adobe-name="a60" win-ansi="0x0061" unicode="0x2741" unicodeName="EIGHT PETALLED OUTLINED BLACK FLORETTE"/>
<map adobe-name="a61" win-ansi="0x0062" unicode="0x2742" unicodeName="CIRCLED OPEN CENTRE EIGHT POINTED STAR"/>
<map adobe-name="a62" win-ansi="0x0063" unicode="0x2743" unicodeName="HEAVY TEARDROP-SPOKED PINWHEEL ASTERISK"/>
<map adobe-name="a63" win-ansi="0x0064" unicode="0x2744" unicodeName="SNOWFLAKE"/>
<map adobe-name="a64" win-ansi="0x0065" unicode="0x2745" unicodeName="TIGHT TRIFOLIATE SNOWFLAKE"/>
<map adobe-name="a65" win-ansi="0x0066" unicode="0x2746" unicodeName="HEAVY CHEVRON SNOWFLAKE"/>
<map adobe-name="a66" win-ansi="0x0067" unicode="0x2747" unicodeName="SPARKLE"/>
<map adobe-name="a67" win-ansi="0x0068" unicode="0x2748" unicodeName="HEAVY SPARKLE"/>
<map adobe-name="a68" win-ansi="0x0069" unicode="0x2749" unicodeName="BALLOON-SPOKED ASTERISK"/>
<map adobe-name="a69" win-ansi="0x006A" unicode="0x274A" unicodeName="EIGHT TEARDROP-SPOKED PROPELLER ASTERISK"/>
<map adobe-name="a70" win-ansi="0x006B" unicode="0x274B" unicodeName="HEAVY EIGHT TEARDROP-SPOKED PROPELLER ASTERISK"/>
<map adobe-name="a71" win-ansi="0x006C" unicode="0x25CF" unicodeName="BLACK CIRCLE"/>
<map adobe-name="a72" win-ansi="0x006D" unicode="0x274D" unicodeName="SHADOWED WHITE CIRCLE"/>
<map adobe-name="a73" win-ansi="0x006E" unicode="0x25A0" unicodeName="BLACK SQUARE"/>
<map adobe-name="a74" win-ansi="0x006F" unicode="0x274F" unicodeName="LOWER RIGHT DROP-SHADOWED WHITE SQUARE"/>
<map adobe-name="a203" win-ansi="0x0070" unicode="0x2750" unicodeName="UPPER RIGHT DROP-SHADOWED WHITE SQUARE"/>
<map adobe-name="a75" win-ansi="0x0071" unicode="0x2751" unicodeName="LOWER RIGHT SHADOWED WHITE SQUARE"/>
<map adobe-name="a204" win-ansi="0x0072" unicode="0x2752" unicodeName="UPPER RIGHT SHADOWED WHITE SQUARE"/>
<map adobe-name="a76" win-ansi="0x0073" unicode="0x25B2" unicodeName="BLACK UP-POINTING TRIANGLE"/>
<map adobe-name="a77" win-ansi="0x0074" unicode="0x25BC" unicodeName="BLACK DOWN-POINTING TRIANGLE"/>
<map adobe-name="a78" win-ansi="0x0075" unicode="0x25C6" unicodeName="BLACK DIAMOND"/>
<map adobe-name="a79" win-ansi="0x0076" unicode="0x2756" unicodeName="BLACK DIAMOND MINUS WHITE X"/>
<map adobe-name="a81" win-ansi="0x0077" unicode="0x25D7" unicodeName="RIGHT HALF BLACK CIRCLE"/>
<map adobe-name="a82" win-ansi="0x0078" unicode="0x2758" unicodeName="LIGHT VERTICAL BAR"/>
<map adobe-name="a83" win-ansi="0x0079" unicode="0x2759" unicodeName="MEDIUM VERTICAL BAR"/>
<map adobe-name="a84" win-ansi="0x007A" unicode="0x275A" unicodeName="HEAVY VERTICAL BAR"/>
<map adobe-name="a97" win-ansi="0x007B" unicode="0x275B" unicodeName="HEAVY SINGLE TURNED COMMA QUOTATION MARK ORNAMENT"/>
<map adobe-name="a98" win-ansi="0x007C" unicode="0x275C" unicodeName="HEAVY SINGLE COMMA QUOTATION MARK ORNAMENT"/>
<map adobe-name="a99" win-ansi="0x007D" unicode="0x275D" unicodeName="HEAVY DOUBLE TURNED COMMA QUOTATION MARK ORNAMENT"/>
<map adobe-name="a100" win-ansi="0x007E" unicode="0x275E" unicodeName="HEAVY DOUBLE COMMA QUOTATION MARK ORNAMENT"/>
<map adobe-name="a89" win-ansi="0x0080" unicode="0xF8D7" unicodeName="MEDIUM LEFT PARENTHESIS ORNAMENT"/>
<map adobe-name="a90" win-ansi="0x0081" unicode="0xF8D8" unicodeName="MEDIUM RIGHT PARENTHESIS ORNAMENT"/>
<map adobe-name="a93" win-ansi="0x0082" unicode="0xF8D9" unicodeName="MEDIUM FLATTENED LEFT PARENTHESIS ORNAMENT"/>
<map adobe-name="a94" win-ansi="0x0083" unicode="0xF8DA" unicodeName="MEDIUM FLATTENED RIGHT PARENTHESIS ORNAMENT"/>
<map adobe-name="a91" win-ansi="0x0084" unicode="0xF8DB" unicodeName="MEDIUM LEFT-POINTING ANGLE BRACKET ORNAMENT"/>
<map adobe-name="a92" win-ansi="0x0085" unicode="0xF8DC" unicodeName="MEDIUM RIGHT-POINTING ANGLE BRACKET ORNAMENT"/>
<map adobe-name="a205" win-ansi="0x0086" unicode="0xF8DD" unicodeName="HEAVY LEFT-POINTING ANGLE QUOTATION MARK ORNAMENT"/>
<map adobe-name="a85" win-ansi="0x0087" unicode="0xF8DE" unicodeName="HEAVY RIGHT-POINTING ANGLE QUOTATION MARK ORNAMENT"/>
<map adobe-name="a206" win-ansi="0x0088" unicode="0xF8DF" unicodeName="HEAVY LEFT-POINTING ANGLE BRACKET ORNAMENT"/>
<map adobe-name="a86" win-ansi="0x0089" unicode="0xF8E0" unicodeName="HEAVY RIGHT-POINTING ANGLE BRACKET ORNAMENT"/>
<map adobe-name="a87" win-ansi="0x008A" unicode="0xF8E1" unicodeName="LIGHT LEFT TORTOISE SHELL BRACKET ORNAMENT"/>
<map adobe-name="a88" win-ansi="0x008B" unicode="0xF8E2" unicodeName="LIGHT RIGHT TORTOISE SHELL BRACKET ORNAMENT"/>
<map adobe-name="a95" win-ansi="0x008C" unicode="0xF8E3" unicodeName="MEDIUM LEFT CURLY BRACKET ORNAMENT"/>
<map adobe-name="a96" win-ansi="0x008D" unicode="0xF8E4" unicodeName="MEDIUM RIGHT CURLY BRACKET ORNAMENT"/>
<map adobe-name="a101" win-ansi="0x00A1" unicode="0x2761" unicodeName="CURVED STEM PARAGRAPH SIGN ORNAMENT"/>
<map adobe-name="a102" win-ansi="0x00A2" unicode="0x2762" unicodeName="HEAVY EXCLAMATION MARK ORNAMENT"/>
<map adobe-name="a103" win-ansi="0x00A3" unicode="0x2763" unicodeName="HEAVY HEART EXCLAMATION MARK ORNAMENT"/>
<map adobe-name="a104" win-ansi="0x00A4" unicode="0x2764" unicodeName="HEAVY BLACK HEART"/>
<map adobe-name="a106" win-ansi="0x00A5" unicode="0x2765" unicodeName="ROTATED HEAVY BLACK HEART BULLET"/>
<map adobe-name="a107" win-ansi="0x00A6" unicode="0x2766" unicodeName="FLORAL HEART"/>
<map adobe-name="a108" win-ansi="0x00A7" unicode="0x2767" unicodeName="ROTATED FLORAL HEART BULLET"/>
<map adobe-name="a120" win-ansi="0x00AC" unicode="0x2460" unicodeName="CIRCLED DIGIT ONE"/>
<map adobe-name="a121" win-ansi="0x00AD" unicode="0x2461" unicodeName="CIRCLED DIGIT TWO"/>
<map adobe-name="a122" win-ansi="0x00AE" unicode="0x2462" unicodeName="CIRCLED DIGIT THREE"/>
<map adobe-name="a123" win-ansi="0x00AF" unicode="0x2463" unicodeName="CIRCLED DIGIT FOUR"/>
<map adobe-name="a124" win-ansi="0x00B0" unicode="0x2464" unicodeName="CIRCLED DIGIT FIVE"/>
<map adobe-name="a125" win-ansi="0x00B1" unicode="0x2465" unicodeName="CIRCLED DIGIT SIX"/>
<map adobe-name="a126" win-ansi="0x00B2" unicode="0x2466" unicodeName="CIRCLED DIGIT SEVEN"/>
<map adobe-name="a127" win-ansi="0x00B3" unicode="0x2467" unicodeName="CIRCLED DIGIT EIGHT"/>
<map adobe-name="a128" win-ansi="0x00B4" unicode="0x2468" unicodeName="CIRCLED DIGIT NINE"/>
<map adobe-name="a129" win-ansi="0x00B5" unicode="0x2469" unicodeName="CIRCLED NUMBER TEN"/>
<map adobe-name="a130" win-ansi="0x00B6" unicode="0x2776" unicodeName="DINGBAT NEGATIVE CIRCLED DIGIT ONE"/>
<map adobe-name="a131" win-ansi="0x00B7" unicode="0x2777" unicodeName="DINGBAT NEGATIVE CIRCLED DIGIT TWO"/>
<map adobe-name="a132" win-ansi="0x00B8" unicode="0x2778" unicodeName="DINGBAT NEGATIVE CIRCLED DIGIT THREE"/>
<map adobe-name="a133" win-ansi="0x00B9" unicode="0x2779" unicodeName="DINGBAT NEGATIVE CIRCLED DIGIT FOUR"/>
<map adobe-name="a134" win-ansi="0x00BA" unicode="0x277A" unicodeName="DINGBAT NEGATIVE CIRCLED DIGIT FIVE"/>
<map adobe-name="a135" win-ansi="0x00BB" unicode="0x277B" unicodeName="DINGBAT NEGATIVE CIRCLED DIGIT SIX"/>
<map adobe-name="a136" win-ansi="0x00BC" unicode="0x277C" unicodeName="DINGBAT NEGATIVE CIRCLED DIGIT SEVEN"/>
<map adobe-name="a137" win-ansi="0x00BD" unicode="0x277D" unicodeName="DINGBAT NEGATIVE CIRCLED DIGIT EIGHT"/>
<map adobe-name="a138" win-ansi="0x00BE" unicode="0x277E" unicodeName="DINGBAT NEGATIVE CIRCLED DIGIT NINE"/>
<map adobe-name="a139" win-ansi="0x00BF" unicode="0x277F" unicodeName="DINGBAT NEGATIVE CIRCLED NUMBER TEN"/>
<map adobe-name="a140" win-ansi="0x00C0" unicode="0x2780" unicodeName="DINGBAT CIRCLED SANS-SERIF DIGIT ONE"/>
<map adobe-name="a141" win-ansi="0x00C1" unicode="0x2781" unicodeName="DINGBAT CIRCLED SANS-SERIF DIGIT TWO"/>
<map adobe-name="a142" win-ansi="0x00C2" unicode="0x2782" unicodeName="DINGBAT CIRCLED SANS-SERIF DIGIT THREE"/>
<map adobe-name="a143" win-ansi="0x00C3" unicode="0x2783" unicodeName="DINGBAT CIRCLED SANS-SERIF DIGIT FOUR"/>
<map adobe-name="a144" win-ansi="0x00C4" unicode="0x2784" unicodeName="DINGBAT CIRCLED SANS-SERIF DIGIT FIVE"/>
<map adobe-name="a145" win-ansi="0x00C5" unicode="0x2785" unicodeName="DINGBAT CIRCLED SANS-SERIF DIGIT SIX"/>
<map adobe-name="a146" win-ansi="0x00C6" unicode="0x2786" unicodeName="DINGBAT CIRCLED SANS-SERIF DIGIT SEVEN"/>
<map adobe-name="a147" win-ansi="0x00C7" unicode="0x2787" unicodeName="DINGBAT CIRCLED SANS-SERIF DIGIT EIGHT"/>
<map adobe-name="a148" win-ansi="0x00C8" unicode="0x2788" unicodeName="DINGBAT CIRCLED SANS-SERIF DIGIT NINE"/>
<map adobe-name="a149" win-ansi="0x00C9" unicode="0x2789" unicodeName="DINGBAT CIRCLED SANS-SERIF NUMBER TEN"/>
<map adobe-name="a150" win-ansi="0x00CA" unicode="0x278A" unicodeName="DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT ONE"/>
<map adobe-name="a151" win-ansi="0x00CB" unicode="0x278B" unicodeName="DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT TWO"/>
<map adobe-name="a152" win-ansi="0x00CC" unicode="0x278C" unicodeName="DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT THREE"/>
<map adobe-name="a153" win-ansi="0x00CD" unicode="0x278D" unicodeName="DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT FOUR"/>
<map adobe-name="a154" win-ansi="0x00CE" unicode="0x278E" unicodeName="DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT FIVE"/>
<map adobe-name="a155" win-ansi="0x00CF" unicode="0x278F" unicodeName="DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT SIX"/>
<map adobe-name="a156" win-ansi="0x00D0" unicode="0x2790" unicodeName="DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT SEVEN"/>
<map adobe-name="a157" win-ansi="0x00D1" unicode="0x2791" unicodeName="DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT EIGHT"/>
<map adobe-name="a158" win-ansi="0x00D2" unicode="0x2792" unicodeName="DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT NINE"/>
<map adobe-name="a159" win-ansi="0x00D3" unicode="0x2793" unicodeName="DINGBAT NEGATIVE CIRCLED SANS-SERIF NUMBER TEN"/>
<map adobe-name="a160" win-ansi="0x00D4" unicode="0x2794" unicodeName="HEAVY WIDE-HEADED RIGHTWARDS ARROW"/>
<map adobe-name="a164" win-ansi="0x00D7" unicode="0x2195" unicodeName="UP DOWN ARROW"/>
<map adobe-name="a196" win-ansi="0x00D8" unicode="0x2798" unicodeName="HEAVY SOUTH EAST ARROW"/>
<map adobe-name="a165" win-ansi="0x00D9" unicode="0x2799" unicodeName="HEAVY RIGHTWARDS ARROW"/>
<map adobe-name="a192" win-ansi="0x00DA" unicode="0x279A" unicodeName="HEAVY NORTH EAST ARROW"/>
<map adobe-name="a166" win-ansi="0x00DB" unicode="0x279B" unicodeName="DRAFTING POINT RIGHTWARDS ARROW"/>
<map adobe-name="a167" win-ansi="0x00DC" unicode="0x279C" unicodeName="HEAVY ROUND-TIPPED RIGHTWARDS ARROW"/>
<map adobe-name="a168" win-ansi="0x00DD" unicode="0x279D" unicodeName="TRIANGLE-HEADED RIGHTWARDS ARROW"/>
<map adobe-name="a169" win-ansi="0x00DE" unicode="0x279E" unicodeName="HEAVY TRIANGLE-HEADED RIGHTWARDS ARROW"/>
<map adobe-name="a170" win-ansi="0x00DF" unicode="0x279F" unicodeName="DASHED TRIANGLE-HEADED RIGHTWARDS ARROW"/>
<map adobe-name="a171" win-ansi="0x00E0" unicode="0x27A0" unicodeName="HEAVY DASHED TRIANGLE-HEADED RIGHTWARDS ARROW"/>
<map adobe-name="a172" win-ansi="0x00E1" unicode="0x27A1" unicodeName="BLACK RIGHTWARDS ARROW"/>
<map adobe-name="a173" win-ansi="0x00E2" unicode="0x27A2" unicodeName="THREE-D TOP-LIGHTED RIGHTWARDS ARROWHEAD"/>
<map adobe-name="a162" win-ansi="0x00E3" unicode="0x27A3" unicodeName="THREE-D BOTTOM-LIGHTED RIGHTWARDS ARROWHEAD"/>
<map adobe-name="a174" win-ansi="0x00E4" unicode="0x27A4" unicodeName="BLACK RIGHTWARDS ARROWHEAD"/>
<map adobe-name="a175" win-ansi="0x00E5" unicode="0x27A5" unicodeName="HEAVY BLACK CURVED DOWNWARDS AND RIGHTWARDS ARROW"/>
<map adobe-name="a176" win-ansi="0x00E6" unicode="0x27A6" unicodeName="HEAVY BLACK CURVED UPWARDS AND RIGHTWARDS ARROW"/>
<map adobe-name="a177" win-ansi="0x00E7" unicode="0x27A7" unicodeName="SQUAT BLACK RIGHTWARDS ARROW"/>
<map adobe-name="a178" win-ansi="0x00E8" unicode="0x27A8" unicodeName="HEAVY CONCAVE-POINTED BLACK RIGHTWARDS ARROW"/>
<map adobe-name="a179" win-ansi="0x00E9" unicode="0x27A9" unicodeName="RIGHT-SHADED WHITE RIGHTWARDS ARROW"/>
<map adobe-name="a193" win-ansi="0x00EA" unicode="0x27AA" unicodeName="LEFT-SHADED WHITE RIGHTWARDS ARROW"/>
<map adobe-name="a180" win-ansi="0x00EB" unicode="0x27AB" unicodeName="BACK-TILTED SHADOWED WHITE RIGHTWARDS ARROW"/>
<map adobe-name="a199" win-ansi="0x00EC" unicode="0x27AC" unicodeName="FRONT-TILTED SHADOWED WHITE RIGHTWARDS ARROW"/>
<map adobe-name="a181" win-ansi="0x00ED" unicode="0x27AD" unicodeName="HEAVY LOWER RIGHT-SHADOWED WHITE RIGHTWARDS ARROW"/>
<map adobe-name="a200" win-ansi="0x00EE" unicode="0x27AE" unicodeName="HEAVY UPPER RIGHT-SHADOWED WHITE RIGHTWARDS ARROW"/>
<map adobe-name="a182" win-ansi="0x00EF" unicode="0x27AF" unicodeName="NOTCHED LOWER RIGHT-SHADOWED WHITE RIGHTWARDS ARROW"/>
<map adobe-name="a201" win-ansi="0x00F1" unicode="0x27B1" unicodeName="NOTCHED UPPER RIGHT-SHADOWED WHITE RIGHTWARDS ARROW"/>
<map adobe-name="a183" win-ansi="0x00F2" unicode="0x27B2" unicodeName="CIRCLED HEAVY WHITE RIGHTWARDS ARROW"/>
<map adobe-name="a184" win-ansi="0x00F3" unicode="0x27B3" unicodeName="WHITE-FEATHERED RIGHTWARDS ARROW"/>
<map adobe-name="a197" win-ansi="0x00F4" unicode="0x27B4" unicodeName="BLACK-FEATHERED SOUTH EAST ARROW"/>
<map adobe-name="a185" win-ansi="0x00F5" unicode="0x27B5" unicodeName="BLACK-FEATHERED RIGHTWARDS ARROW"/>
<map adobe-name="a194" win-ansi="0x00F6" unicode="0x27B6" unicodeName="BLACK-FEATHERED NORTH EAST ARROW"/>
<map adobe-name="a198" win-ansi="0x00F7" unicode="0x27B7" unicodeName="HEAVY BLACK-FEATHERED SOUTH EAST ARROW"/>
<map adobe-name="a186" win-ansi="0x00F8" unicode="0x27B8" unicodeName="HEAVY BLACK-FEATHERED RIGHTWARDS ARROW"/>
<map adobe-name="a195" win-ansi="0x00F9" unicode="0x27B9" unicodeName="HEAVY BLACK-FEATHERED NORTH EAST ARROW"/>
<map adobe-name="a187" win-ansi="0x00FA" unicode="0x27BA" unicodeName="TEARDROP-BARBED RIGHTWARDS ARROW"/>
<map adobe-name="a188" win-ansi="0x00FB" unicode="0x27BB" unicodeName="HEAVY TEARDROP-SHANKED RIGHTWARDS ARROW"/>
<map adobe-name="a189" win-ansi="0x00FC" unicode="0x27BC" unicodeName="WEDGE-TAILED RIGHTWARDS ARROW"/>
<map adobe-name="a190" win-ansi="0x00FD" unicode="0x27BD" unicodeName="HEAVY WEDGE-TAILED RIGHTWARDS ARROW"/>
<map adobe-name="a191" win-ansi="0x00FE" unicode="0x27BE" unicodeName="OPEN-OUTLINED RIGHTWARDS ARROW"/>
<!-- the following mappings are used for the Symbol font
TBD: remove doublettes -->
<map adobe-name="universal" win-ansi="0x22" unicode="0x2200"/>
<map adobe-name="existential" win-ansi="0x24" unicode="0x2203"/>
<map adobe-name="suchthat" win-ansi="0x27" unicode="0x220B"/>
<map adobe-name="asteriskmath" win-ansi="0x2A" unicode="0x2217"/>
<map adobe-name="minus" win-ansi="0x2D" unicode="0x2212"/>
<map adobe-name="congruent" win-ansi="0x40" unicode="0x2245"/>
<map adobe-name="Alpha" win-ansi="0x41" unicode="0x0391"/>
<map adobe-name="Beta" win-ansi="0x42" unicode="0x0392"/>
<map adobe-name="Chi" win-ansi="0x43" unicode="0x03A7"/>
<map adobe-name="Delta" win-ansi="0x44" unicode="0x2206"/>
<map adobe-name="Epsilon" win-ansi="0x45" unicode="0x0395"/>
<map adobe-name="Phi" win-ansi="0x46" unicode="0x03A6"/>
<map adobe-name="Gamma" win-ansi="0x47" unicode="0x0393"/>
<map adobe-name="Eta" win-ansi="0x48" unicode="0x0397"/>
<map adobe-name="Iota" win-ansi="0x49" unicode="0x0399"/>
<map adobe-name="theta1" win-ansi="0x4A" unicode="0x03D1"/>
<map adobe-name="Kappa" win-ansi="0x4B" unicode="0x039A"/>
<map adobe-name="Lambda" win-ansi="0x4C" unicode="0x039B"/>
<map adobe-name="Mu" win-ansi="0x4D" unicode="0x039C"/>
<map adobe-name="Nu" win-ansi="0x4E" unicode="0x039D"/>
<map adobe-name="Omicron" win-ansi="0x4F" unicode="0x039F"/>
<map adobe-name="Pi" win-ansi="0x50" unicode="0x03A0"/>
<map adobe-name="Theta" win-ansi="0x51" unicode="0x0398"/>
<map adobe-name="Rho" win-ansi="0x52" unicode="0x03A1"/>
<map adobe-name="Sigma" win-ansi="0x53" unicode="0x03A3"/>
<map adobe-name="Tau" win-ansi="0x54" unicode="0x03A4"/>
<map adobe-name="Upsilon" win-ansi="0x55" unicode="0x03A5"/>
<map adobe-name="sigma1" win-ansi="0x56" unicode="0x03C2"/>
<map adobe-name="Omega" win-ansi="0x57" unicode="0x2126"/>
<map adobe-name="Xi" win-ansi="0x58" unicode="0x039E"/>
<map adobe-name="Psi" win-ansi="0x59" unicode="0x03A8"/>
<map adobe-name="Zeta" win-ansi="0x5A" unicode="0x0396"/>
<map adobe-name="therefore" win-ansi="0x5C" unicode="0x2234"/>
<map adobe-name="perpendicular" win-ansi="0x5E" unicode="0x22A5"/>
<map adobe-name="radicalex" win-ansi="0x60" unicode="0xF8E5"/>
<map adobe-name="alpha" win-ansi="0x61" unicode="0x03B1"/>
<map adobe-name="beta" win-ansi="0x62" unicode="0x03B2"/>
<map adobe-name="chi" win-ansi="0x63" unicode="0x03C7"/>
<map adobe-name="delta" win-ansi="0x64" unicode="0x03B4"/>
<map adobe-name="epsilon" win-ansi="0x65" unicode="0x03B5"/>
<map adobe-name="phi" win-ansi="0x66" unicode="0x03C6"/>
<map adobe-name="gamma" win-ansi="0x67" unicode="0x03B3"/>
<map adobe-name="eta" win-ansi="0x68" unicode="0x03B7"/>
<map adobe-name="iota" win-ansi="0x69" unicode="0x03B9"/>
<map adobe-name="phi1" win-ansi="0x6A" unicode="0x03D5"/>
<map adobe-name="kappa" win-ansi="0x6B" unicode="0x03BA"/>
<map adobe-name="lambda" win-ansi="0x6C" unicode="0x03BB"/>
<map adobe-name="nu" win-ansi="0x6E" unicode="0x03BD"/>
<map adobe-name="omicron" win-ansi="0x6F" unicode="0x03BF"/>
<map adobe-name="pi" win-ansi="0x70" unicode="0x03C0"/>
<map adobe-name="theta" win-ansi="0x71" unicode="0x03B8"/>
<map adobe-name="rho" win-ansi="0x72" unicode="0x03C1"/>
<map adobe-name="sigma" win-ansi="0x73" unicode="0x03C3"/>
<map adobe-name="tau" win-ansi="0x74" unicode="0x03C4"/>
<map adobe-name="upsilon" win-ansi="0x75" unicode="0x03C5"/>
<map adobe-name="omega1" win-ansi="0x76" unicode="0x03D6"/>
<map adobe-name="omega" win-ansi="0x77" unicode="0x03C9"/>
<map adobe-name="xi" win-ansi="0x78" unicode="0x03BE"/>
<map adobe-name="psi" win-ansi="0x79" unicode="0x03C8"/>
<map adobe-name="zeta" win-ansi="0x7A" unicode="0x03B6"/>
<map adobe-name="similar" win-ansi="0x7E" unicode="0x223C"/>
<map adobe-name="Upsilon1" win-ansi="0xA1" unicode="0x03D2"/>
<map adobe-name="minute" win-ansi="0xA2" unicode="0x2032"/>
<map adobe-name="lessequal" win-ansi="0xA3" unicode="0x2264"/>
<map adobe-name="fraction" win-ansi="0xA4" unicode="0x2044"/>
<map adobe-name="infinity" win-ansi="0xA5" unicode="0x221E"/>
<map adobe-name="florin" win-ansi="0xA6" unicode="0x0192"/>
<map adobe-name="club" win-ansi="0xA7" unicode="0x2663"/>
<map adobe-name="diamond" win-ansi="0xA8" unicode="0x2666"/>
<map adobe-name="heart" win-ansi="0xA9" unicode="0x2665"/>
<map adobe-name="spade" win-ansi="0xAA" unicode="0x2660"/>
<map adobe-name="arrowboth" win-ansi="0xAB" unicode="0x2194"/>
<map adobe-name="arrowleft" win-ansi="0xAC" unicode="0x2190"/>
<map adobe-name="arrowup" win-ansi="0xAD" unicode="0x2191"/>
<map adobe-name="arrowright" win-ansi="0xAE" unicode="0x2192"/>
<map adobe-name="arrowdown" win-ansi="0xAF" unicode="0x2193"/>
<map adobe-name="second" win-ansi="0xB2" unicode="0x2033"/>
<map adobe-name="greaterequal" win-ansi="0xB3" unicode="0x2265"/>
<map adobe-name="proportional" win-ansi="0xB5" unicode="0x221D"/>
<map adobe-name="partialdiff" win-ansi="0xB6" unicode="0x2202"/>
<map adobe-name="notequal" win-ansi="0xB9" unicode="0x2260"/>
<map adobe-name="equivalence" win-ansi="0xBA" unicode="0x2261"/>
<map adobe-name="approxequal" win-ansi="0xBB" unicode="0x2248"/>
<map adobe-name="arrowvertex" win-ansi="0xBD" unicode="0xF8E6"/>
<map adobe-name="arrowhorizex" win-ansi="0xBE" unicode="0xF8E7"/>
<map adobe-name="carriagereturn" win-ansi="0xBF" unicode="0x21B5"/>
<map adobe-name="aleph" win-ansi="0xC0" unicode="0x2135"/>
<map adobe-name="Ifraktur" win-ansi="0xC1" unicode="0x2111"/>
<map adobe-name="Rfraktur" win-ansi="0xC2" unicode="0x211C"/>
<map adobe-name="weierstrass" win-ansi="0xC3" unicode="0x2118"/>
<map adobe-name="circlemultiply" win-ansi="0xC4" unicode="0x2297"/>
<map adobe-name="circleplus" win-ansi="0xC5" unicode="0x2295"/>
<map adobe-name="emptyset" win-ansi="0xC6" unicode="0x2205"/>
<map adobe-name="intersection" win-ansi="0xC7" unicode="0x2229"/>
<map adobe-name="union" win-ansi="0xC8" unicode="0x222A"/>
<map adobe-name="propersuperset" win-ansi="0xC9" unicode="0x2283"/>
<map adobe-name="reflexsuperset" win-ansi="0xCA" unicode="0x2287"/>
<map adobe-name="notsubset" win-ansi="0xCB" unicode="0x2284"/>
<map adobe-name="propersubset" win-ansi="0xCC" unicode="0x2282"/>
<map adobe-name="reflexsubset" win-ansi="0xCD" unicode="0x2286"/>
<map adobe-name="element" win-ansi="0xCE" unicode="0x2208"/>
<map adobe-name="notelement" win-ansi="0xCF" unicode="0x2209"/>
<map adobe-name="angle" win-ansi="0xD0" unicode="0x2220"/>
<map adobe-name="gradient" win-ansi="0xD1" unicode="0x2207"/>
<map adobe-name="registerserif" win-ansi="0xD2" unicode="0xF6DA"/>
<map adobe-name="copyrightserif" win-ansi="0xD3" unicode="0xF6D9"/>
<map adobe-name="trademarkserif" win-ansi="0xD4" unicode="0xF6DB"/>
<map adobe-name="product" win-ansi="0xD5" unicode="0x220F"/>
<map adobe-name="radical" win-ansi="0xD6" unicode="0x221A"/>
<map adobe-name="dotmath" win-ansi="0xD7" unicode="0x22C5"/>
<map adobe-name="logicaland" win-ansi="0xD9" unicode="0x2227"/>
<map adobe-name="logicalor" win-ansi="0xDA" unicode="0x2228"/>
<map adobe-name="arrowdblboth" win-ansi="0xDB" unicode="0x21D4"/>
<map adobe-name="arrowdblleft" win-ansi="0xDC" unicode="0x21D0"/>
<map adobe-name="arrowdblup" win-ansi="0xDD" unicode="0x21D1"/>
<map adobe-name="arrowdblright" win-ansi="0xDE" unicode="0x21D2"/>
<map adobe-name="arrowdbldown" win-ansi="0xDF" unicode="0x21D3"/>
<map adobe-name="lozenge" win-ansi="0xE0" unicode="0x25CA"/>
<map adobe-name="angleleft" win-ansi="0xE1" unicode="0x2329"/>
<map adobe-name="registersans" win-ansi="0xE2" unicode="0xF8E8"/>
<map adobe-name="copyrightsans" win-ansi="0xE3" unicode="0xF8E9"/>
<map adobe-name="trademarksans" win-ansi="0xE4" unicode="0xF8EA"/>
<map adobe-name="summation" win-ansi="0xE5" unicode="0x2211"/>
<map adobe-name="parenlefttp" win-ansi="0xE6" unicode="0xF8EB"/>
<map adobe-name="parenleftex" win-ansi="0xE7" unicode="0xF8EC"/>
<map adobe-name="parenleftbt" win-ansi="0xE8" unicode="0xF8ED"/>
<map adobe-name="bracketlefttp" win-ansi="0xE9" unicode="0xF8EE"/>
<map adobe-name="bracketleftex" win-ansi="0xEA" unicode="0xF8EF"/>
<map adobe-name="bracketleftbt" win-ansi="0xEB" unicode="0xF8F0"/>
<map adobe-name="bracelefttp" win-ansi="0xEC" unicode="0xF8F1"/>
<map adobe-name="braceleftmid" win-ansi="0xED" unicode="0xF8F2"/>
<map adobe-name="braceleftbt" win-ansi="0xEE" unicode="0xF8F3"/>
<map adobe-name="braceex" win-ansi="0xEF" unicode="0xF8F4"/>
<map adobe-name="angleright" win-ansi="0xF1" unicode="0x232A"/>
<map adobe-name="integral" win-ansi="0xF2" unicode="0x222B"/>
<map adobe-name="integraltp" win-ansi="0xF3" unicode="0x2320"/>
<map adobe-name="integralex" win-ansi="0xF4" unicode="0xF8F5"/>
<map adobe-name="integralbt" win-ansi="0xF5" unicode="0x2321"/>
<map adobe-name="parenrighttp" win-ansi="0xF6" unicode="0xF8F6"/>
<map adobe-name="parenrightex" win-ansi="0xF7" unicode="0xF8F7"/>
<map adobe-name="parenrightbt" win-ansi="0xF8" unicode="0xF8F8"/>
<map adobe-name="bracketrighttp" win-ansi="0xF9" unicode="0xF8F9"/>
<map adobe-name="bracketrightex" win-ansi="0xFA" unicode="0xF8FA"/>
<map adobe-name="bracketrightbt" win-ansi="0xFB" unicode="0xF8FB"/>
<map adobe-name="bracerighttp" win-ansi="0xFC" unicode="0xF8FC"/>
<map adobe-name="bracerightmid" win-ansi="0xFD" unicode="0xF8FD"/>
<map adobe-name="bracerightbt" win-ansi="0xFE" unicode="0xF8FE"/>
<map adobe-name="apple" win-ansi="-1" unicode="0xF8FE"/>
</font-mappings>
<!-- I couldn't find the following characters in the unicode tables -->
<!--
<map adobe-name="center" win-ansi="-1" unicode=""/>
<map adobe-name="dectab" win-ansi="-1" unicode=""/>
<map adobe-name="down" win-ansi="-1" unicode=""/>
<map adobe-name="format" win-ansi="-1" unicode=""/>
<map adobe-name="graybox" win-ansi="-1" unicode=""/>
<map adobe-name="indent" win-ansi="-1" unicode=""/>
<map adobe-name="largebullet" win-ansi="-1" unicode=""/>
<map adobe-name="left" win-ansi="-1" unicode=""/>
<map adobe-name="ll" win-ansi="-1" unicode=""/>
<map adobe-name="LL" win-ansi="-1" unicode=""/>
<map adobe-name="merge" win-ansi="-1" unicode=""/>
<map adobe-name="notegraphic" win-ansi="-1" unicode=""/>
<map adobe-name="overscore" win-ansi="-1" unicode=""/>
<map adobe-name="prescription" win-ansi="-1" unicode=""/>
<map adobe-name="return" win-ansi="-1" unicode=""/>
<map adobe-name="square" win-ansi="-1" unicode=""/>
<map adobe-name="stop" win-ansi="-1" unicode=""/>
<map adobe-name="tab" win-ansi="-1" unicode=""/>
<map adobe-name="up" win-ansi="-1" unicode=""/>
<map adobe-name="zer" win-ansi="-1" unicode=""/>
-->
@@ -0,0 +1,176 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- $Id$ -->
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:variable name='glyphlists'
select="document('glyphlist.xml')/glyphlist-set"/>
<xsl:template match="encoding-set"> /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.fop.fonts;
import java.util.Collections;
import java.util.Map;
// CSOFF: ConstantNameCheck
public class CodePointMapping extends AbstractCodePointMapping {
<xsl:apply-templates mode="constant"/>
public CodePointMapping(String name, int[] table) {
super(name, table);
}
public CodePointMapping(String name, int[] table, String[] charNameMap) {
super(name, table, charNameMap);
}
private static Map mappings;
static {
mappings = Collections.synchronizedMap(new java.util.HashMap());
}
public static CodePointMapping getMapping(String encoding) {
CodePointMapping mapping = (CodePointMapping) mappings.get(encoding);
if (mapping != null) {
return mapping;
<xsl:apply-templates mode="get"/>
} else {
throw new UnsupportedOperationException("Unknown encoding: " + encoding);
}
}
<xsl:apply-templates mode="table"/>
<xsl:apply-templates select="encoding" mode="names"/>
}
</xsl:template>
<xsl:template match="encoding" mode="constant">
public static final String <xsl:value-of select="@constant"/> = "<xsl:value-of select="@id"/>";
</xsl:template>
<xsl:template match="encoding" mode="get">
} else if (encoding.equals(<xsl:value-of select="@constant"/>)) {
mapping = new CodePointMapping(<xsl:value-of select="@constant"/>, enc<xsl:value-of select="@id"/>, names<xsl:value-of select="@id"/>);
mappings.put(<xsl:value-of select="@constant"/>, mapping);
return mapping;
</xsl:template>
<xsl:template match="encoding" mode="table">
<xsl:variable name="glyphlist-name" select="@glyphlist"/>
<xsl:variable name="glyphlist"
select="$glyphlists/glyphlist[@id=$glyphlist-name]"/>
private static final int[] enc<xsl:value-of select="@id"/>
= {<xsl:for-each select="glyph">
<xsl:variable name="codepoint" select="@codepoint"/>
<xsl:variable name="name" select="@name"/><xsl:for-each select="$glyphlist/glyph[@name=$name]">
0x<xsl:value-of select="$codepoint"/>, 0x<xsl:value-of select="@codepoint"/>, // <xsl:value-of select="$name"/>
</xsl:for-each></xsl:for-each>
};
</xsl:template>
<xsl:template match="encoding" mode="names">
private static final String[] names<xsl:value-of select="@id"/>
= {
<xsl:call-template name="charname">
<xsl:with-param name="idx" select="0"/>
</xsl:call-template>
};
</xsl:template>
<xsl:template name="charname">
<xsl:param name="idx"/>
<xsl:variable name="idxHEXraw">
<xsl:call-template name="toHex">
<xsl:with-param name="decimalNumber" select="$idx"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="idxHEX">
<xsl:call-template name="padnumber">
<xsl:with-param name="num" select="$idxHEXraw"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="idxhex" select="translate($idxHEX, 'ABCDEF', 'abcdef')"></xsl:variable>
<!--
<xsl:value-of select="$idx"/>-<xsl:value-of select="$idxHEXraw"/>-<xsl:value-of select="$idxHEX"/>-<xsl:value-of select="$idxhex"/>
-->
<xsl:if test="($idx mod 4) = 0">
<xsl:text>&#x0A; /*</xsl:text><xsl:value-of select="$idxHEX"/><xsl:text>*/</xsl:text>
</xsl:if>
<xsl:variable name="v">
<xsl:value-of select="child::glyph[@codepoint = $idxHEX or @codepoint = $idxhex]/@name"/><!--<xsl:value-of select="glyph[@codepoint = $idxhex]/@name"/>-->
</xsl:variable>
<xsl:choose>
<xsl:when test="string-length($v) > 0">
<xsl:text> "</xsl:text><xsl:value-of select="$v"/><xsl:text>"</xsl:text>
</xsl:when>
<xsl:otherwise> null</xsl:otherwise>
</xsl:choose>
<xsl:if test="$idx &lt; 255">
<xsl:text>,</xsl:text>
<xsl:call-template name="charname">
<xsl:with-param name="idx" select="$idx + 1"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:variable name="hexDigits" select="'0123456789ABCDEF'"/>
<xsl:template name="toHex">
<xsl:param name="decimalNumber" />
<xsl:if test="$decimalNumber >= 16">
<xsl:call-template name="toHex">
<xsl:with-param name="decimalNumber" select="floor($decimalNumber div 16)" />
</xsl:call-template>
</xsl:if>
<xsl:value-of select="substring($hexDigits, ($decimalNumber mod 16) + 1, 1)" />
</xsl:template>
<xsl:template name="padnumber">
<xsl:param name="num"/>
<xsl:param name="len" select="2"/>
<!--
<xsl:text> </xsl:text><xsl:value-of select="$num"/>/<xsl:value-of select="$len"/>
-->
<xsl:choose>
<xsl:when test="string-length($num) &lt; $len">
<xsl:call-template name="padnumber">
<xsl:with-param name="num" select="concat('0',$num)"/>
<xsl:with-param name="len" select="$len"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise><xsl:value-of select="$num"/></xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
File diff suppressed because it is too large Load Diff
+250
View File
@@ -0,0 +1,250 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- $Id$ -->
<!-- This file writes the class files for the fonts (Courier.java,
Helvetica.java etc.). It uses the information in the font
description files (Courier.xml, Helvetica.xml) to do this. In these
font description files each character is referenced by its adobe
glyph name:
<char name="A" width="667"/>
To resolve this name and to find the code for this character it looks
up the adobe name in the file encodings.xml and extracts the appropriate
code. -->
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:param name="encoding" select="/font-metrics/encoding"/>
<xsl:variable name="glyphs" select="document('encodings.xml')/encoding-set/encoding[@id=$encoding]/glyph"/>
<xsl:template match="font-metrics"> /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.fop.fonts.base14;
import java.awt.Rectangle;
import java.net.URI;<xsl:if test="count(kerning) &gt; 0">
import java.util.Map;</xsl:if>
import java.util.Set;
import org.apache.fop.fonts.Base14Font;
import org.apache.fop.fonts.CodePointMapping;
import org.apache.fop.fonts.FontType;
import org.apache.fop.fonts.Typeface;
// CSOFF: ConstantNameCheck
public class <xsl:value-of select="class-name"/> extends Base14Font {
private static final URI fontFileURI;
private static final String fontName = "<xsl:value-of select="font-name"/>";
private static final String fullName = "<xsl:value-of select="full-name"/>";
private static final Set familyNames;
private static final int underlinePosition = <xsl:value-of select="underline-position"/>;
private static final int underlineThickness = <xsl:value-of select="underline-thickness"/>;
private static final String encoding = "<xsl:value-of select="$encoding"/>";
private static final int capHeight = <xsl:value-of select="cap-height"/>;
private static final int xHeight = <xsl:value-of select="x-height"/>;
private static final int ascender = <xsl:value-of select="ascender"/>;
private static final int descender = <xsl:value-of select="descender"/>;
private static final int firstChar = <xsl:value-of select="first-char"/>;
private static final int lastChar = <xsl:value-of select="last-char"/>;
private static final int[] width;
private static final Rectangle[] boundingBoxes;
private final CodePointMapping mapping =
CodePointMapping.getMapping("<xsl:value-of select="$encoding"/>");
<xsl:if test="count(kerning) &gt; 0">
private static final Map kerning;
</xsl:if>
private boolean enableKerning;
static {
URI uri = null;
try {
uri = new URI("base14:" + fontName.toLowerCase());
} catch (java.net.URISyntaxException e) {
throw new RuntimeException(e);
}
fontFileURI = uri;
width = new int[256];
boundingBoxes = new Rectangle[256];
<xsl:apply-templates select="char-metrics"/>
familyNames = new java.util.HashSet();
familyNames.add("<xsl:value-of select="family-name"/>");
<xsl:if test="count(kerning) &gt; 0">
kerning = new java.util.HashMap();
Integer first;
Integer second;
Map pairs;
<xsl:apply-templates select="kerning"/>
</xsl:if>
}
public <xsl:value-of select="class-name"/>() {
this(false);
}
public <xsl:value-of select="class-name"/>(boolean enableKerning) {
this.enableKerning = enableKerning;
}
public String getEncodingName() {
return encoding;
}
public URI getFontURI() {
return fontFileURI;
}
public String getFontName() {
return fontName;
}
public String getEmbedFontName() {
return getFontName();
}
public String getFullName() {
return fullName;
}
public Set getFamilyNames() {
return familyNames;
}
public FontType getFontType() {
return FontType.TYPE1;
}
public int getAscender(int size) {
return size * ascender;
}
public int getCapHeight(int size) {
return size * capHeight;
}
public int getDescender(int size) {
return size * descender;
}
public int getXHeight(int size) {
return size * xHeight;
}
public int getUnderlinePosition(int size) {
return size * underlinePosition;
}
public int getUnderlineThickness(int size) {
return size * underlineThickness;
}
public int getFirstChar() {
return firstChar;
}
public int getLastChar() {
return lastChar;
}
public int getWidth(int i, int size) {
return size * width[i];
}
public Rectangle getBoundingBox(int glyphIndex, int size) {
Rectangle bbox = boundingBoxes[glyphIndex];
return new Rectangle(bbox.x * size, bbox.y * size, bbox.width * size, bbox.height * size);
}
public int[] getWidths() {
int[] arr = new int[getLastChar() - getFirstChar() + 1];
System.arraycopy(width, getFirstChar(), arr, 0, getLastChar() - getFirstChar() + 1);
return arr;
}
<xsl:choose>
<xsl:when test="count(kerning) &gt; 0">
public boolean hasKerningInfo() {
return enableKerning;
}
public java.util.Map getKerningInfo() {
return kerning;
}
</xsl:when>
<xsl:otherwise>
public boolean hasKerningInfo() {
return false;
}
public java.util.Map getKerningInfo() {
return java.util.Collections.EMPTY_MAP;
}
</xsl:otherwise>
</xsl:choose>
public char mapChar(char c) {
notifyMapOperation();
char d = mapping.mapChar(c);
if (d != 0) {
return d;
} else {
this.warnMissingGlyph(c);
return Typeface.NOT_FOUND;
}
}
public boolean hasChar(char c) {
return (mapping.mapChar(c) > 0);
}
}
</xsl:template>
<xsl:template match="char-metrics/char"><xsl:variable name="char-name" select="@name"/><xsl:variable name="char-num" select="$glyphs[@name = $char-name]/@codepoint"/><xsl:if test="$char-num!=''"> width[0x<xsl:value-of select="$char-num"/>] = <xsl:value-of select="@width"/>;
boundingBoxes[0x<xsl:value-of select="$char-num"/>] = new Rectangle(<xsl:value-of select="@llx"/>, <xsl:value-of select="@lly"/>, <xsl:value-of select="@urx - @llx"/>, <xsl:value-of select="@ury - @lly"/>);</xsl:if></xsl:template>
<xsl:template match="kerning">
first = <xsl:value-of select="@kpx1"/>;
pairs = (Map)kerning.get(first);
if (pairs == null) {
pairs = new java.util.HashMap();
kerning.put(first, pairs);
}
<xsl:apply-templates select="pair"/></xsl:template>
<xsl:template match="pair">
second = <xsl:value-of select="@kpx2"/>;
pairs.put(second, <xsl:value-of select="@kern"/>);
</xsl:template>
</xsl:stylesheet>
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,225 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- $Id$ -->
<!--
This files writes the class files for the Adobe Type 1 fonts.
It uses the information in the font description files (Courier.xml, Helvetica.xml) to this
In these font description files each character is referenced by its adobe name:
<char name="A" width="667"/>
To resolve this name and to find the code for this character it looks up the adobe name in the
file charlist.xml and extracts the WinAnsi code.
-->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:lxslt="http://xml.apache.org/xslt"
xmlns:redirect="org.apache.xalan.xslt.extensions.Redirect"
extension-element-prefixes="redirect">
<xsl:output method="text" />
<xsl:template match="font-metrics">
<xsl:variable name="class-name" select="class-name"/>
<!--<redirect:write select="concat('org/apache/fop/render/pdf/fonts/', $class-name, '.java')">-->
package org.apache.fop.render.pdf.fonts;
import org.apache.fop.render.pdf.Font;
import org.apache.fop.layout.FontDescriptor;
import org.apache.fop.fonts.Glyphs;
import org.apache.fop.pdf.PDFStream;
import org.apache.fop.pdf.PDFT1Stream;
import java.io.InputStream;
import java.io.FileInputStream;
import java.io.BufferedInputStream;
import java.util.HashMap;
public class <xsl:value-of select="class-name"/> extends Font implements FontDescriptor {
private final static String fontName = "<xsl:value-of select="font-name"/>";
private final static String encoding = "<xsl:value-of select="encoding"/>";
private final static int capHeight = <xsl:value-of select="cap-height"/>;
private final static int xHeight = <xsl:value-of select="x-height"/>;
private final static int ascender = <xsl:value-of select="ascender"/>;
private final static int descender = <xsl:value-of select="descender"/>;
private final static int[] fontBBox = {
<xsl:value-of select="bbox/left"/>,
<xsl:value-of select="bbox/bottom"/>,
<xsl:value-of select="bbox/right"/>,
<xsl:value-of select="bbox/top"/>
};
private final static String embedFileName = <xsl:value-of select="embedFile"/>;
private final static String embedResourceName = <xsl:value-of select="embedResource"/>;
private static PDFT1Stream embeddedFont=null;
private final static int flags = <xsl:value-of select="flags"/>;
private final static int stemV = <xsl:value-of select="stemv"/>;
private final static int italicAngle = <xsl:value-of select="italicangle"/>;
private final static int firstChar = <xsl:value-of select="first-char"/>;
private final static int lastChar = <xsl:value-of select="last-char"/>;
private final static int[] width;
private final static HashMap kerning=new HashMap();
static {
width = new int[256];
<xsl:for-each select="widths/char"><xsl:variable name="char-name" select="@name"/><xsl:variable name="char-num" select="document('charlist.xml')/font-mappings/map[@adobe-name=$char-name]/@win-ansi"/><xsl:if test="$char-num!='-1'"> width[<xsl:value-of select="$char-num"/>] = <xsl:value-of select="@width"/>;
</xsl:if></xsl:for-each>
HashMap tmptable;
<xsl:for-each select="kerning">
<xsl:variable name="kpx1-name" select="@kpx1"/>
tmptable=new HashMap();<xsl:for-each select="pair"><xsl:variable name="kpx2-name" select="@kpx2"/><xsl:variable name="kern-name" select="@kern"/>
tmptable.put(Glyphs.glyphToString("<xsl:value-of select="$kpx2-name"/>"), new Integer(<xsl:value-of select="$kern-name"/>));</xsl:for-each>
kerning.put(Glyphs.glyphToString("<xsl:value-of select="$kpx1-name"/>"), tmptable);
</xsl:for-each>
}
public final boolean hasKerningInfo() {return kerning.isEmpty();}
public final java.util.HashMap getKerningInfo() {return kerning;}
public byte getSubType() {return org.apache.fop.pdf.PDFFont.TYPE1;}
public boolean isEmbeddable() {
return (embedFileName==null &amp;&amp; embedResourceName==null) ? false : true;
}
public PDFStream getFontFile(int i) {
InputStream instream=null;
// Get file first
if (embedFileName!=null)
try {
instream=new FileInputStream(embedFileName);
} catch (Exception e) {
System.out.println("Failed to embed fontfile: "+embedFileName);
}
// Get resource
if (instream==null &amp;&amp; embedResourceName!=null)
try {
instream=new BufferedInputStream(this.getClass().getResourceAsStream(embedResourceName));
} catch (Exception e) {
System.out.println("Failed to embed fontresource: "+embedResourceName);
}
if (instream==null)
return (PDFStream)null;
// Read fontdata
byte[] file = new byte[128000];
int fsize = 0;
try {
int l = instream.read(file, 0, 128000);
fsize += l;
if (l==128000) {
// More to read - needs to extend
byte[] tmpbuf;
while (l &gt; 0) {
tmpbuf = new byte[file.length + 64000];
System.arraycopy(file, 0, tmpbuf, 0, file.length);
l=instream.read(tmpbuf, file.length, 64000);
fsize += l;
file = tmpbuf;
if (l &lt; 64000) // whole file read. No need to loop again
l=0;
}
}
embeddedFont=new PDFT1Stream(i, fsize);
embeddedFont.addFilter("flate");
embeddedFont.addFilter("ascii-85");
embeddedFont.setData(file, fsize);
instream.close();
} catch (Exception e) {}
return (PDFStream) embeddedFont;
}
public String encoding() {
return encoding;
}
public String fontName() {
return fontName;
}
public int getAscender() {
return ascender;
}
public int getCapHeight() {
return capHeight;
}
public int getDescender() {
return descender;
}
public int getAscender(int size) {
return size * ascender;
}
public int getCapHeight(int size) {
return size * capHeight;
}
public int getDescender(int size) {
return size * descender;
}
public int getXHeight(int size) {
return size * xHeight;
}
public int getFlags() {
return flags;
}
public int[] getFontBBox() {
return fontBBox;
}
public int getItalicAngle() {
return italicAngle;
}
public int getStemV() {
return stemV;
}
public int getFirstChar() {
return firstChar;
}
public int getLastChar() {
return lastChar;
}
public int width(int i, int size) {
return size * width[i];
}
public int[] getWidths(int size) {
int[] arr = new int[getLastChar()-getFirstChar()+1];
System.arraycopy(width, getFirstChar(), arr, 0, getLastChar()-getFirstChar()+1);
for( int i = 0; i &lt; arr.length; i++) arr[i] *= size;
return arr;
}
}
<!--</redirect:write>-->
</xsl:template>
</xsl:stylesheet>
@@ -0,0 +1,217 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- $Id$ -->
<!--
This files writes the class files for the Adobe Type 1 fonts.
It uses the information in the font description files (Courier.xml, Helvetica.xml) to this
In these font description files each character is referenced by its adobe name:
<char name="A" width="667"/>
To resolve this name and to find the code for this character it looks up the adobe name in the
file charlist.xml and extracts the WinAnsi code.
-->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:lxslt="http://xml.apache.org/xslt"
xmlns:redirect="org.apache.xalan.xslt.extensions.Redirect"
extension-element-prefixes="redirect">
<xsl:output method="text" />
<xsl:template match="font-metrics">
<xsl:variable name="class-name" select="class-name"/>
<!--<redirect:write select="concat('org/apache/fop/render/pdf/fonts/', $class-name, '.java')">-->
package org.apache.fop.render.pdf.fonts;
import org.apache.fop.render.pdf.Font;
import org.apache.fop.layout.FontDescriptor;
import org.apache.fop.fonts.Glyphs;
import org.apache.fop.pdf.PDFStream;
import org.apache.fop.pdf.PDFTTFStream;
import java.io.InputStream;
import java.io.FileInputStream;
import java.io.BufferedInputStream;
import java.util.HashMap;
public class <xsl:value-of select="class-name"/> extends Font implements FontDescriptor {
private final static String fontName = "<xsl:value-of select="font-name"/>";
private final static String encoding = "<xsl:value-of select="encoding"/>";
private final static int capHeight = <xsl:value-of select="cap-height"/>;
private final static int xHeight = <xsl:value-of select="x-height"/>;
private final static int ascender = <xsl:value-of select="ascender"/>;
private final static int descender = <xsl:value-of select="descender"/>;
private final static int[] fontBBox = {
<xsl:value-of select="bbox/left"/>,
<xsl:value-of select="bbox/bottom"/>,
<xsl:value-of select="bbox/right"/>,
<xsl:value-of select="bbox/top"/>
};
private final static String embedFileName = <xsl:value-of select="embedFile"/>;
private final static String embedResourceName = <xsl:value-of select="embedResource"/>;
private static PDFTTFStream embeddedFont=null;
private final static int flags = <xsl:value-of select="flags"/>;
private final static int stemV = <xsl:value-of select="stemv"/>;
private final static int italicAngle = <xsl:value-of select="italicangle"/>;
private final static int firstChar = <xsl:value-of select="first-char"/>;
private final static int lastChar = <xsl:value-of select="last-char"/>;
private final static int[] width;
private final static HashMap kerning=new HashMap();
static {
width = new int[256];
<!--<xsl:for-each select="widths/char"><xsl:variable name="char-name" select="@name"/><xsl:variable name="char-num" select="document('charlist.xml')/font-mappings/map[@adobe-name=$char-name]/@win-ansi"/><xsl:if test="$char-num!='-1'"> width[<xsl:value-of select="$char-num"/>] = <xsl:value-of select="@width"/>;</xsl:if>-->
<xsl:for-each select="widths/char"><xsl:variable name="char-name" select="@name"/> width[<xsl:value-of select="$char-name"/>] = <xsl:value-of select="@width"/>;
</xsl:for-each>
HashMap tmptable;
<xsl:for-each select="kerning">
<xsl:variable name="kpx1-name" select="@kpx1"/>
tmptable=new HashMap();<xsl:for-each select="pair"><xsl:variable name="kpx2-name" select="@kpx2"/><xsl:variable name="kern-name" select="@kern"/>
tmptable.put(Glyphs.glyphToString("<xsl:value-of select="$kpx2-name"/>"), new Integer(<xsl:value-of select="$kern-name"/>));</xsl:for-each>
kerning.put(Glyphs.glyphToString("<xsl:value-of select="$kpx1-name"/>"), tmptable);
</xsl:for-each>
}
public final boolean hasKerningInfo() {return kerning.isEmpty();}
public final java.util.HashMap getKerningInfo() {return kerning;}
public byte getSubType() {return org.apache.fop.pdf.PDFFont.TRUETYPE;}
public boolean isEmbeddable() {
return (embedFileName==null &amp;&amp; embedResourceName==null) ? false : true;
}
public PDFStream getFontFile(int i) {
InputStream instream=null;
// Get file first
if (embedFileName!=null)
try {
instream=new FileInputStream(embedFileName);
} catch (Exception e) {
System.out.println("Failed to embed fontfile: "+embedFileName);
}
// Get resource
if (instream==null &amp;&amp; embedResourceName!=null)
try {
instream=new BufferedInputStream(this.getClass().getResourceAsStream(embedResourceName));
} catch (Exception e) {
System.out.println("Failed to embed fontresource: "+embedResourceName);
}
if (instream==null)
return (PDFStream)null;
// Read fontdata
byte[] file = new byte[128000];
int fsize = 0;
try {
int l = instream.read(file, 0, 128000);
fsize += l;
if (l==128000) {
// More to read - needs to extend
byte[] tmpbuf;
while (l &gt; 0) {
tmpbuf = new byte[file.length + 64000];
System.arraycopy(file, 0, tmpbuf, 0, file.length);
l=instream.read(tmpbuf, file.length, 64000);
fsize += l;
file = tmpbuf;
if (l &lt; 64000) // whole file read. No need to loop again
l=0;
}
}
embeddedFont=new PDFTTFStream(i, fsize);
embeddedFont.addFilter("flate");
embeddedFont.addFilter("ascii-85");
embeddedFont.setData(file, fsize);
instream.close();
} catch (Exception e) {}
return (PDFStream) embeddedFont;
}
public String encoding() {
return encoding;
}
public String fontName() {
return fontName;
}
public int getAscender() {return ascender;}
public int getDescender() {return descender;}
public int getCapHeight() {return capHeight;}
public int getAscender(int size) {
return size * ascender;
}
public int getCapHeight(int size) {
return size * capHeight;
}
public int getDescender(int size) {
return size * descender;
}
public int getXHeight(int size) {
return size * xHeight;
}
public int getFlags() {
return flags;
}
public int[] getFontBBox() {
return fontBBox;
}
public int getItalicAngle() {
return italicAngle;
}
public int getStemV() {
return stemV;
}
public int getFirstChar() {
return firstChar;
}
public int getLastChar() {
return lastChar;
}
public int width(int i, int size) {
return size * width[i];
}
public int[] getWidths(int size) {
int[] arr = new int[getLastChar()-getFirstChar()+1];
System.arraycopy(width, getFirstChar(), arr, 0, getLastChar()-getFirstChar()+1);
for( int i = 0; i &lt; arr.length; i++) arr[i] *= size;
return arr;
}
}
<!--</redirect:write>-->
</xsl:template>
</xsl:stylesheet>
+4
View File
@@ -0,0 +1,4 @@
jdk14codestart = /*
jdk14codeend = */
+2
View File
@@ -0,0 +1,2 @@
jdk14codestart =
jdk14codeend =
@@ -0,0 +1,29 @@
OP CP CL QU GL NS EX SY IS PR PO NU AL ID IN HY BA BB B2 ZW CM WJ H2 H3 JL JV JT
OP ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ @ ^ ^ ^ ^ ^ ^
CP _ ^ ^ % % ^ ^ ^ ^ % % % % _ _ % % _ _ ^ # ^ _ _ _ _ _
CL _ ^ ^ % % ^ ^ ^ ^ % % % % _ _ % % _ _ ^ # ^ _ _ _ _ _
QU ^ ^ ^ % % % ^ ^ ^ % % % % % % % % % % ^ # ^ % % % % %
GL % ^ ^ % % % ^ ^ ^ % % % % % % % % % % ^ # ^ % % % % %
NS _ ^ ^ % % % ^ ^ ^ _ _ _ _ _ _ % % _ _ ^ # ^ _ _ _ _ _
EX _ ^ ^ % % % ^ ^ ^ _ _ _ _ _ _ % % _ _ ^ # ^ _ _ _ _ _
SY _ ^ ^ % % % ^ ^ ^ _ _ % _ _ _ % % _ _ ^ # ^ _ _ _ _ _
IS _ ^ ^ % % % ^ ^ ^ _ _ % % _ _ % % _ _ ^ # ^ _ _ _ _ _
PR % ^ ^ % % % ^ ^ ^ _ _ % % % _ % % _ _ ^ # ^ % % % % %
PO % ^ ^ % % % ^ ^ ^ _ _ % % _ _ % % _ _ ^ # ^ _ _ _ _ _
NU % ^ ^ % % % ^ ^ ^ % % % % _ % % % _ _ ^ # ^ _ _ _ _ _
AL % ^ ^ % % % ^ ^ ^ _ _ % % _ % % % _ _ ^ # ^ _ _ _ _ _
ID _ ^ ^ % % % ^ ^ ^ _ % _ _ _ % % % _ _ ^ # ^ _ _ _ _ _
IN _ ^ ^ % % % ^ ^ ^ _ _ _ _ _ % % % _ _ ^ # ^ _ _ _ _ _
HY _ ^ ^ % % % ^ ^ ^ _ _ % _ _ _ % % _ _ ^ # ^ _ _ _ _ _
BA _ ^ ^ % % % ^ ^ ^ _ _ _ _ _ _ % % _ _ ^ # ^ _ _ _ _ _
BB % ^ ^ % % % ^ ^ ^ % % % % % % % % % % ^ # ^ % % % % %
B2 _ ^ ^ % % % ^ ^ ^ _ _ _ _ _ _ % % _ ^ ^ # ^ _ _ _ _ _
ZW _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ^ _ _ _ _ _ _ _
CM _ ^ ^ % % % ^ ^ ^ _ _ % % _ % % % _ _ ^ # ^ _ _ _ _ _
WJ % ^ ^ % % % ^ ^ ^ % % % % % % % % % % ^ # ^ % % % % %
H2 _ ^ ^ % % % ^ ^ ^ _ % _ _ _ % % % _ _ ^ # ^ _ _ _ % %
H3 _ ^ ^ % % % ^ ^ ^ _ % _ _ _ % % % _ _ ^ # ^ _ _ _ _ %
JL _ ^ ^ % % % ^ ^ ^ _ % _ _ _ % % % _ _ ^ # ^ % % % % _
JV _ ^ ^ % % % ^ ^ ^ _ % _ _ _ % % % _ _ ^ # ^ _ _ _ % %
JT _ ^ ^ % % % ^ ^ ^ _ % _ _ _ % % % _ _ ^ # ^ _ _ _ _ %
@@ -0,0 +1,570 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.complexscripts.bidi;
import java.io.BufferedReader;
import java.io.FileWriter;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.URL;
import java.util.Arrays;
import java.util.Iterator;
import java.util.SortedSet;
import java.util.TreeSet;
import org.apache.fop.util.License;
// CSOFF: LineLength
/**
* <p>Utility for generating a Java class representing bidirectional
* class properties from the Unicode property files.</p>
*
* <p>This code is derived in part from GenerateLineBreakUtils.java.</p>
*
* <p>This work was originally authored by Glenn Adams (gadams@apache.org).</p>
*/
public final class GenerateBidiClass {
private GenerateBidiClass() {
}
private static byte[] bcL1 = new byte[256]; // ascii and basic latin blocks ( 0x0000 - 0x00FF )
private static byte[] bcR1 = new byte[368]; // hebrew and arabic blocks ( 0x0590 - 0x06FF )
private static int[] bcS1; // interval start indices
private static int[] bcE1; // interval end indices
private static byte[] bcC1; // interval bid classes
/**
* Generate a class managing bidi class properties for Unicode characters.
*
* @param bidiFileName name (as URL) of file containing bidi type data
* @param outFileName name of the output file
* @throws Exception
*/
private static void convertBidiClassProperties(String bidiFileName, String outFileName) throws Exception {
readBidiClassProperties(bidiFileName);
// generate class
PrintWriter out = new PrintWriter(new FileWriter(outFileName));
License.writeJavaLicenseId(out);
out.println();
out.println("package org.apache.fop.complexscripts.bidi;");
out.println();
out.println("import java.util.Arrays;");
out.println("import org.apache.fop.complexscripts.bidi.BidiConstants;");
out.println();
out.println("// CSOFF: WhitespaceAfterCheck");
out.println("// CSOFF: LineLengthCheck");
out.println();
out.println("/*");
out.println(" * !!! THIS IS A GENERATED FILE !!!");
out.println(" * If updates to the source are needed, then:");
out.println(" * - apply the necessary modifications to");
out.println(" * 'src/codegen/unicode/java/org/apache/fop/complexscripts/bidi/GenerateBidiClass.java'");
out.println(" * - run 'ant codegen-unicode', which will generate a new BidiClass.java");
out.println(" * in 'src/java/org/apache/fop/complexscripts/bidi'");
out.println(" * - commit BOTH changed files");
out.println(" */");
out.println();
out.println("/** Bidirectional class utilities. */");
out.println("public final class BidiClass {");
out.println();
out.println("private BidiClass() {");
out.println("}");
out.println();
dumpData(out);
out.println("/**");
out.println(" * Lookup bidi class for character expressed as unicode scalar value.");
out.println(" * @param ch a unicode scalar value");
out.println(" * @return bidi class");
out.println(" */");
out.println("public static int getBidiClass ( int ch ) {");
out.println(" if ( ch <= 0x00FF ) {");
out.println(" return bcL1 [ ch - 0x0000 ];");
out.println(" } else if ( ( ch >= 0x0590 ) && ( ch <= 0x06FF ) ) {");
out.println(" return bcR1 [ ch - 0x0590 ];");
out.println(" } else {");
out.println(" return getBidiClass ( ch, bcS1, bcE1, bcC1 );");
out.println(" }");
out.println("}");
out.println();
out.println("private static int getBidiClass ( int ch, int[] sa, int[] ea, byte[] ca ) {");
out.println(" int k = Arrays.binarySearch ( sa, ch );");
out.println(" if ( k >= 0 ) {");
out.println(" return ca [ k ];");
out.println(" } else {");
out.println(" k = - ( k + 1 );");
out.println(" if ( k == 0 ) {");
out.println(" return BidiConstants.L;");
out.println(" } else if ( ch <= ea [ k - 1 ] ) {");
out.println(" return ca [ k - 1 ];");
out.println(" } else {");
out.println(" return BidiConstants.L;");
out.println(" }");
out.println(" }");
out.println("}");
out.println();
out.println("}");
out.flush();
out.close();
}
/**
* Read bidi class property data.
*
* @param bidiFileName name (as URL) of bidi type data
*/
private static void readBidiClassProperties(String bidiFileName) throws Exception {
// read property names
BufferedReader b = new BufferedReader(new InputStreamReader(new URL(bidiFileName).openStream()));
String line;
int lineNumber = 0;
TreeSet intervals = new TreeSet();
while ((line = b.readLine()) != null) {
lineNumber++;
if (line.startsWith("#")) {
continue;
} else if (line.length() == 0) {
continue;
} else {
if (line.indexOf("#") != -1) {
line = (line.split("#")) [ 0 ];
}
String[] fa = line.split(";");
if (fa.length == 2) {
int[] interval = parseInterval(fa[0].trim());
byte bidiClass = (byte) parseBidiClass(fa[1].trim());
if (interval[1] == interval[0]) { // singleton
int c = interval[0];
if (c <= 0x00FF) {
if (bcL1 [ c - 0x0000 ] == 0) {
bcL1 [ c - 0x0000 ] = bidiClass;
} else {
throw new Exception("duplicate singleton entry: " + c);
}
} else if ((c >= 0x0590) && (c <= 0x06FF)) {
if (bcR1 [ c - 0x0590 ] == 0) {
bcR1 [ c - 0x0590 ] = bidiClass;
} else {
throw new Exception("duplicate singleton entry: " + c);
}
} else {
addInterval(intervals, c, c, bidiClass);
}
} else { // non-singleton
int s = interval[0];
int e = interval[1]; // inclusive
if (s <= 0x00FF) {
for (int i = s; i <= e; i++) {
if (i <= 0x00FF) {
if (bcL1 [ i - 0x0000 ] == 0) {
bcL1 [ i - 0x0000 ] = bidiClass;
} else {
throw new Exception("duplicate singleton entry: " + i);
}
} else {
addInterval(intervals, i, e, bidiClass);
break;
}
}
} else if ((s >= 0x0590) && (s <= 0x06FF)) {
for (int i = s; i <= e; i++) {
if (i <= 0x06FF) {
if (bcR1 [ i - 0x0590 ] == 0) {
bcR1 [ i - 0x0590 ] = bidiClass;
} else {
throw new Exception("duplicate singleton entry: " + i);
}
} else {
addInterval(intervals, i, e, bidiClass);
break;
}
}
} else {
addInterval(intervals, s, e, bidiClass);
}
}
} else {
throw new Exception("bad syntax, line(" + lineNumber + "): " + line);
}
}
}
// compile interval search data
int ivIndex = 0;
int niv = intervals.size();
bcS1 = new int [ niv ];
bcE1 = new int [ niv ];
bcC1 = new byte [ niv ];
for (Iterator it = intervals.iterator(); it.hasNext(); ivIndex++) {
Interval iv = (Interval) it.next();
bcS1[ivIndex] = iv.start;
bcE1[ivIndex] = iv.end;
bcC1[ivIndex] = (byte) iv.bidiClass;
}
// test data
test();
}
private static int[] parseInterval(String interval) throws Exception {
int s;
int e;
String[] fa = interval.split("\\.\\.");
if (fa.length == 1) {
s = Integer.parseInt(fa[0], 16);
e = s;
} else if (fa.length == 2) {
s = Integer.parseInt(fa[0], 16);
e = Integer.parseInt(fa[1], 16);
} else {
throw new Exception("bad interval syntax: " + interval);
}
if (e < s) {
throw new Exception("bad interval, start must be less than or equal to end: " + interval);
}
return new int[] {s, e};
}
private static int parseBidiClass(String bidiClass) {
int bc = 0;
if ("L".equals(bidiClass)) {
bc = BidiConstants.L;
} else if ("LRE".equals(bidiClass)) {
bc = BidiConstants.LRE;
} else if ("LRO".equals(bidiClass)) {
bc = BidiConstants.LRO;
} else if ("R".equals(bidiClass)) {
bc = BidiConstants.R;
} else if ("AL".equals(bidiClass)) {
bc = BidiConstants.AL;
} else if ("RLE".equals(bidiClass)) {
bc = BidiConstants.RLE;
} else if ("RLO".equals(bidiClass)) {
bc = BidiConstants.RLO;
} else if ("PDF".equals(bidiClass)) {
bc = BidiConstants.PDF;
} else if ("EN".equals(bidiClass)) {
bc = BidiConstants.EN;
} else if ("ES".equals(bidiClass)) {
bc = BidiConstants.ES;
} else if ("ET".equals(bidiClass)) {
bc = BidiConstants.ET;
} else if ("AN".equals(bidiClass)) {
bc = BidiConstants.AN;
} else if ("CS".equals(bidiClass)) {
bc = BidiConstants.CS;
} else if ("NSM".equals(bidiClass)) {
bc = BidiConstants.NSM;
} else if ("BN".equals(bidiClass)) {
bc = BidiConstants.BN;
} else if ("B".equals(bidiClass)) {
bc = BidiConstants.B;
} else if ("S".equals(bidiClass)) {
bc = BidiConstants.S;
} else if ("WS".equals(bidiClass)) {
bc = BidiConstants.WS;
} else if ("ON".equals(bidiClass)) {
bc = BidiConstants.ON;
} else {
throw new IllegalArgumentException("unknown bidi class: " + bidiClass);
}
return bc;
}
private static void addInterval(SortedSet intervals, int start, int end, int bidiClass) {
intervals.add(new Interval(start, end, bidiClass));
}
private static void dumpData(PrintWriter out) {
boolean first;
StringBuffer sb = new StringBuffer();
// bcL1
first = true;
sb.setLength(0);
out.println("private static byte[] bcL1 = {");
for (int i = 0; i < bcL1.length; i++) {
if (!first) {
sb.append(",");
} else {
first = false;
}
sb.append(bcL1[i]);
if (sb.length() > 120) {
sb.append(',');
out.println(sb);
first = true;
sb.setLength(0);
}
}
if (sb.length() > 0) {
out.println(sb);
}
out.println("};");
out.println();
// bcR1
first = true;
sb.setLength(0);
out.println("private static byte[] bcR1 = {");
for (int i = 0; i < bcR1.length; i++) {
if (!first) {
sb.append(",");
} else {
first = false;
}
sb.append(bcR1[i]);
if (sb.length() > 120) {
sb.append(',');
out.println(sb);
first = true;
sb.setLength(0);
}
}
if (sb.length() > 0) {
out.println(sb);
}
out.println("};");
out.println();
// bcS1
first = true;
sb.setLength(0);
out.println("private static int[] bcS1 = {");
for (int i = 0; i < bcS1.length; i++) {
if (!first) {
sb.append(",");
} else {
first = false;
}
sb.append(bcS1[i]);
if (sb.length() > 120) {
sb.append(',');
out.println(sb);
first = true;
sb.setLength(0);
}
}
if (sb.length() > 0) {
out.println(sb);
}
out.println("};");
out.println();
// bcE1
first = true;
sb.setLength(0);
out.println("private static int[] bcE1 = {");
for (int i = 0; i < bcE1.length; i++) {
if (!first) {
sb.append(",");
} else {
first = false;
}
sb.append(bcE1[i]);
if (sb.length() > 120) {
sb.append(',');
out.println(sb);
first = true;
sb.setLength(0);
}
}
if (sb.length() > 0) {
out.println(sb);
}
out.println("};");
out.println();
// bcC1
first = true;
sb.setLength(0);
out.println("private static byte[] bcC1 = {");
for (int i = 0; i < bcC1.length; i++) {
if (!first) {
sb.append(",");
} else {
first = false;
}
sb.append(bcC1[i]);
if (sb.length() > 120) {
sb.append(',');
out.println(sb);
first = true;
sb.setLength(0);
}
}
if (sb.length() > 0) {
out.println(sb);
}
out.println("};");
out.println();
}
private static int getBidiClass(int ch) {
if (ch <= 0x00FF) {
return bcL1 [ ch - 0x0000 ];
} else if ((ch >= 0x0590) && (ch <= 0x06FF)) {
return bcR1 [ ch - 0x0590 ];
} else {
return getBidiClass(ch, bcS1, bcE1, bcC1);
}
}
private static int getBidiClass(int ch, int[] sa, int[] ea, byte[] ca) {
int k = Arrays.binarySearch(sa, ch);
if (k >= 0) {
return ca [ k ];
} else {
k = -(k + 1);
if (k == 0) {
return BidiConstants.L;
} else if (ch <= ea [ k - 1 ]) {
return ca [ k - 1 ];
} else {
return BidiConstants.L;
}
}
}
private static final int[] TEST_DATA =
{
0x000000, BidiConstants.BN,
0x000009, BidiConstants.S,
0x00000A, BidiConstants.B,
0x00000C, BidiConstants.WS,
0x000020, BidiConstants.WS,
0x000023, BidiConstants.ET,
0x000028, BidiConstants.ON,
0x00002B, BidiConstants.ES,
0x00002C, BidiConstants.CS,
0x000031, BidiConstants.EN,
0x00003A, BidiConstants.CS,
0x000041, BidiConstants.L,
0x000300, BidiConstants.NSM,
0x000374, BidiConstants.ON,
0x0005BE, BidiConstants.R,
0x000601, BidiConstants.AN,
0x000608, BidiConstants.AL,
0x000670, BidiConstants.NSM,
0x000710, BidiConstants.AL,
0x0007FA, BidiConstants.R,
0x000970, BidiConstants.L,
0x001392, BidiConstants.ON,
0x002000, BidiConstants.WS,
0x00200E, BidiConstants.L,
0x00200F, BidiConstants.R,
0x00202A, BidiConstants.LRE,
0x00202B, BidiConstants.RLE,
0x00202C, BidiConstants.PDF,
0x00202D, BidiConstants.LRO,
0x00202E, BidiConstants.RLO,
0x0020E1, BidiConstants.NSM,
0x002212, BidiConstants.ES,
0x002070, BidiConstants.EN,
0x003000, BidiConstants.WS,
0x003009, BidiConstants.ON,
0x00FBD4, BidiConstants.AL,
0x00FE69, BidiConstants.ET,
0x00FF0C, BidiConstants.CS,
0x00FEFF, BidiConstants.BN,
0x01034A, BidiConstants.L,
0x010E60, BidiConstants.AN,
0x01F100, BidiConstants.EN,
0x0E0001, BidiConstants.BN,
0x0E0100, BidiConstants.NSM,
0x10FFFF, BidiConstants.BN
};
private static void test() throws Exception {
for (int i = 0, n = TEST_DATA.length / 2; i < n; i++) {
int ch = TEST_DATA [ i * 2 + 0 ];
int tc = TEST_DATA [ i * 2 + 1 ];
int bc = getBidiClass(ch);
if (bc != tc) {
throw new Exception("test mapping failed for character (0x" + Integer.toHexString(ch) + "): expected " + tc + ", got " + bc);
}
}
}
/**
* Main entry point for generator.
* @param args array of command line arguments
*/
public static void main(String[] args) {
String bidiFileName = "http://www.unicode.org/Public/UNIDATA/extracted/DerivedBidiClass.txt";
String outFileName = "BidiClass.java";
boolean ok = true;
for (int i = 0; i < args.length; i = i + 2) {
if (i + 1 == args.length) {
ok = false;
} else {
String opt = args[i];
if ("-b".equals(opt)) {
bidiFileName = args [i + 1];
} else if ("-o".equals(opt)) {
outFileName = args [i + 1];
} else {
ok = false;
}
}
}
if (!ok) {
System.out.println("Usage: GenerateBidiClass [-b <bidiFile>] [-o <outputFile>]");
System.out.println(" defaults:");
System.out.println(" <bidiFile>: " + bidiFileName);
System.out.println(" <outputFile>: " + outFileName);
} else {
try {
convertBidiClassProperties(bidiFileName, outFileName);
System.out.println("Generated " + outFileName + " from");
System.out.println(" <bidiFile>: " + bidiFileName);
} catch (Exception e) {
System.out.println("An unexpected error occured");
e.printStackTrace();
}
}
}
private static class Interval implements Comparable {
int start;
int end;
int bidiClass;
Interval(int start, int end, int bidiClass) {
this.start = start;
this.end = end;
this.bidiClass = bidiClass;
}
public int compareTo(Object o) {
Interval iv = (Interval) o;
if (start < iv.start) {
return -1;
} else if (start > iv.start) {
return 1;
} else if (end < iv.end) {
return -1;
} else if (end > iv.end) {
return 1;
} else {
return 0;
}
}
}
}
@@ -0,0 +1,410 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.hyphenation;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.HashMap;
import java.util.Map;
import org.apache.fop.util.License;
/**
* Create the default classes file classes.xml,
* for use in building hyphenation patterns
* from pattern files which do not contain their own classes.
* The class contains three methods to do that.
* The method fromJava gets its infirmation from Java's compiled-in Unicode Character Database,
* the method fromUCD gets its information from the UCD files,
* the method fromTeX gets its information from the file unicode-letters-XeTeX.tex,
* which is the basis of XeTeX's unicode support.
* In the build file only the method from UCD is used;
* the other two methods are there for demonstration.
* The methods fromJava and fromTeX are commented out because they are not Java 1.4 compliant.
*/
public final class UnicodeClasses {
/** directory containing unicode properties files */
public static final String UNICODE_DIR = "http://www.unicode.org/Public/UNIDATA/";
/**
* Disallow constructor for this utility class
*/
private UnicodeClasses() { }
/**
* Write a comment that this is a generated file,
* and instructions on how to generate it
* @param w the writer which writes the comment
* @throws IOException if the write operation fails
*/
public static void writeGenerated(Writer w) throws IOException {
w.write("<!-- !!! THIS IS A GENERATED FILE !!! -->\n");
w.write("<!-- If updates are needed, then: -->\n");
w.write("<!-- * run 'ant codegen-hyphenation-classes', -->\n");
w.write("<!-- which will generate a new file classes.xml -->\n");
w.write("<!-- in 'src/java/org/apache/fop/hyphenation' -->\n");
w.write("<!-- * commit the changed file -->\n");
}
/**
* Generate classes.xml from Java's compiled-in Unicode Character Database
* @param hexcode whether to prefix each class with the hexcode (only for debugging purposes)
* @param outfilePath output file
* @throws IOException if an I/O exception occurs
*/
public static void fromJava(boolean hexcode, String outfilePath) throws IOException {
File f = new File(outfilePath);
if (f.exists()) {
f.delete();
}
f.createNewFile();
FileOutputStream fw = new FileOutputStream(f);
OutputStreamWriter ow = new OutputStreamWriter(fw, StandardCharsets.UTF_8);
int maxChar;
maxChar = Character.MAX_VALUE;
ow.write("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
License.writeXMLLicenseId(ow);
ow.write("\n");
writeGenerated(ow);
ow.write("\n");
ow.write("<classes>\n");
// loop over the first Unicode plane
for (int code = Character.MIN_VALUE; code <= maxChar; ++code) {
// skip surrogate area
if (code == Character.MIN_SURROGATE) {
code = Character.MAX_SURROGATE;
continue;
}
// we are only interested in LC, UC and TC letters which are their own LC,
// and in 'other letters'
if (!(((Character.isLowerCase(code) || Character.isUpperCase(code)
|| Character.isTitleCase(code))
&& code == Character.toLowerCase(code))
|| Character.getType(code) == Character.OTHER_LETTER)) {
continue;
}
// skip a number of blocks
Character.UnicodeBlock ubi = Character.UnicodeBlock.of(code);
if (ubi.equals(Character.UnicodeBlock.SUPERSCRIPTS_AND_SUBSCRIPTS)
|| ubi.equals(Character.UnicodeBlock.LETTERLIKE_SYMBOLS)
|| ubi.equals(Character.UnicodeBlock.ALPHABETIC_PRESENTATION_FORMS)
|| ubi.equals(Character.UnicodeBlock.HALFWIDTH_AND_FULLWIDTH_FORMS)
|| ubi.equals(Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS)
|| ubi.equals(Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A)
|| ubi.equals(Character.UnicodeBlock.HANGUL_SYLLABLES)) {
continue;
}
int uppercode = Character.toUpperCase(code);
int titlecode = Character.toTitleCase(code);
StringBuilder s = new StringBuilder();
if (hexcode) {
s.append("0x" + Integer.toHexString(code) + " ");
}
s.append(Character.toChars(code));
if (uppercode != code) {
s.append(Character.toChars(uppercode));
}
if (titlecode != code && titlecode != uppercode) {
s.append(Character.toChars(titlecode));
}
ow.write(s.toString() + "\n");
}
ow.write("</classes>\n");
ow.flush();
ow.close();
}
/** The 1st column in the UCD file. */
public static final int UNICODE = 0;
/** The 3rd column in the UCD file. */
public static final int GENERAL_CATEGORY = 2;
/** The 13th column in the UCD file. */
public static final int SIMPLE_UPPERCASE_MAPPING = 12;
/** The 14th column in the UCD file. */
public static final int SIMPLE_LOWERCASE_MAPPING = 13;
/** The 15th column in the UCD file. */
public static final int SIMPLE_TITLECASE_MAPPING = 14;
/** The number of columns in the UCD file. */
public static final int NUM_FIELDS = 15;
/**
* Generate classes.xml from Unicode Character Database files
* @param hexcode whether to prefix each class with the hexcode (only for debugging purposes)
* @param unidataPath path to the directory with UCD files
* @param outfilePath output file
* @throws IOException if the input files are not found
* @throws URISyntaxException if {@code unidataPath} cannot be converted to a URI
*/
public static void fromUCD(boolean hexcode, String unidataPath, String outfilePath)
throws IOException, URISyntaxException {
URI unidata;
if (unidataPath.endsWith("/")) {
unidata = new URI(unidataPath);
} else {
unidata = new URI(unidataPath + "/");
}
String scheme = unidata.getScheme();
if (scheme == null || !(scheme.equals("file") || scheme.equals("http"))) {
throw new FileNotFoundException(
"URI with file or http scheme required for UNIDATA input directory");
}
File f = new File(outfilePath);
if (f.exists()) {
f.delete();
}
f.createNewFile();
FileOutputStream fw = new FileOutputStream(f);
OutputStreamWriter ow = new OutputStreamWriter(fw, StandardCharsets.UTF_8);
URI inuri = unidata.resolve("Blocks.txt");
InputStream inis = null;
if (scheme.equals("file")) {
File in = new File(inuri);
inis = new FileInputStream(in);
} else if (scheme.equals("http")) {
inis = inuri.toURL().openStream();
}
InputStreamReader insr = new InputStreamReader(inis, StandardCharsets.UTF_8);
BufferedReader inbr = new BufferedReader(insr);
Map blocks = new HashMap();
for (String line = inbr.readLine(); line != null; line = inbr.readLine()) {
if (line.startsWith("#") || line.matches("^\\s*$")) {
continue;
}
String[] parts = line.split(";");
String block = parts[1].trim();
String[] indices = parts[0].split("\\.\\.");
int[] ind = {Integer.parseInt(indices[0], 16), Integer.parseInt(indices[1], 16)};
blocks.put(block, ind);
}
inbr.close();
inuri = unidata.resolve("UnicodeData.txt");
if (scheme.equals("file")) {
File in = new File(inuri);
inis = new FileInputStream(in);
} else if (scheme.equals("http")) {
inis = inuri.toURL().openStream();
}
insr = new InputStreamReader(inis, StandardCharsets.UTF_8);
inbr = new BufferedReader(insr);
int maxChar;
maxChar = Character.MAX_VALUE;
ow.write("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
License.writeXMLLicenseId(ow);
ow.write("\n");
writeGenerated(ow);
ow.write("\n");
ow.write("<classes>\n");
for (String line = inbr.readLine(); line != null; line = inbr.readLine()) {
String[] fields = line.split(";", NUM_FIELDS);
int code = Integer.parseInt(fields[UNICODE], 16);
if (code > maxChar) {
break;
}
if (((fields[GENERAL_CATEGORY].equals("Ll") || fields[GENERAL_CATEGORY].equals("Lu")
|| fields[GENERAL_CATEGORY].equals("Lt"))
&& ("".equals(fields[SIMPLE_LOWERCASE_MAPPING])
|| fields[UNICODE].equals(fields[SIMPLE_LOWERCASE_MAPPING])))
|| fields[GENERAL_CATEGORY].equals("Lo")) {
String[] blockNames = {"Superscripts and Subscripts",
"Letterlike Symbols",
"Alphabetic Presentation Forms",
"Halfwidth and Fullwidth Forms",
"CJK Unified Ideographs",
"CJK Unified Ideographs Extension A",
"Hangul Syllables"};
int j;
for (j = 0; j < blockNames.length; ++j) {
int[] ind = (int[]) blocks.get(blockNames[j]);
if (code >= ind[0] && code <= ind[1]) {
break;
}
}
if (j < blockNames.length) {
continue;
}
int uppercode = -1;
int titlecode = -1;
if (!"".equals(fields[SIMPLE_UPPERCASE_MAPPING])) {
uppercode = Integer.parseInt(fields[SIMPLE_UPPERCASE_MAPPING], 16);
}
if (!"".equals(fields[SIMPLE_TITLECASE_MAPPING])) {
titlecode = Integer.parseInt(fields[SIMPLE_TITLECASE_MAPPING], 16);
}
StringBuilder s = new StringBuilder();
if (hexcode) {
s.append("0x" + fields[UNICODE].replaceFirst("^0+", "").toLowerCase() + " ");
}
s.append(Character.toChars(code));
if (uppercode != -1 && uppercode != code) {
s.append(Character.toChars(uppercode));
}
if (titlecode != -1 && titlecode != code && titlecode != uppercode) {
s.append(Character.toChars(titlecode));
}
ow.write(s.toString() + "\n");
}
}
ow.write("</classes>\n");
ow.flush();
ow.close();
inbr.close();
}
/**
* Generate classes.xml from XeTeX's Unicode letters file
* @param hexcode whether to prefix each class with the hexcode (only for debugging purposes)
* @param lettersPath path to XeTeX's Unicode letters file unicode-letters-XeTeX.tex
* @param outfilePath output file
* @throws IOException in case of an I/O exception
*/
public static void fromTeX(boolean hexcode, String lettersPath, String outfilePath)
throws IOException {
File in = new File(lettersPath);
File f = new File(outfilePath);
if (f.exists()) {
f.delete();
}
f.createNewFile();
FileOutputStream fw = new FileOutputStream(f);
OutputStreamWriter ow = new OutputStreamWriter(fw, StandardCharsets.UTF_8);
FileInputStream inis = new FileInputStream(in);
InputStreamReader insr = new InputStreamReader(inis, StandardCharsets.UTF_8);
BufferedReader inbr = new BufferedReader(insr);
ow.write("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
License.writeXMLLicenseId(ow);
ow.write("\n");
writeGenerated(ow);
ow.write("\n");
ow.write("<classes>\n");
for (String line = inbr.readLine(); line != null; line = inbr.readLine()) {
String[] codes = line.split("\\s+");
if (!(codes[0].equals("\\L") || codes[0].equals("\\l"))) {
continue;
}
if (codes.length == 3) {
ow.write("\"" + line + "\" has two codes");
continue;
}
if (codes[0].equals("\\l") && codes.length != 2) {
ow.write("\"" + line + "\" should have one code");
continue;
} else if (codes[0].equals("\\L") && codes.length != 4) {
ow.write("\"" + line + "\" should have three codes");
continue;
}
if (codes[0].equals("\\l") || (codes[0].equals("\\L") && codes[1].equals(codes[3]))) {
StringBuilder s = new StringBuilder();
if (hexcode) {
s.append("0x" + codes[1].replaceFirst("^0+", "").toLowerCase() + " ");
}
s.append(Character.toChars(Integer.parseInt(codes[1], 16)));
if (codes[0].equals("\\L")) {
s.append(Character.toChars(Integer.parseInt(codes[2], 16)));
}
ow.write(s.toString() + "\n");
}
}
ow.write("</classes>\n");
ow.flush();
ow.close();
inbr.close();
}
/**
* @param args [--hexcode] [--java|--ucd|--tex] outfile [infile]
* @throws IOException if the input file cannot be found
* @throws URISyntaxException if the input URI is incorrect
*/
public static void main(String[] args) throws IOException, URISyntaxException {
String type = "ucd";
String prefix = "--";
String infile = null;
String outfile = null;
boolean hexcode = false;
int i;
for (i = 0; i < args.length && args[i].startsWith(prefix); ++i) {
String option = args[i].substring(prefix.length());
if (option.equals("java") || option.equals("ucd") || option.equals("tex")) {
type = option;
} else if (option.equals("hexcode")) {
hexcode = true;
} else {
System.err.println("Unknown option: " + option);
System.exit(1);
}
}
if (i < args.length) {
outfile = args[i];
} else {
System.err.println("Output file is required; aborting");
System.exit(1);
}
if (++i < args.length) {
infile = args[i];
}
if (type.equals("java") && infile != null) {
System.err.println("Type java does not allow an infile");
System.exit(1);
} else if (type.equals("ucd") && infile == null) {
infile = UNICODE_DIR;
} else if (type.equals("tex") && infile == null) {
System.err.println("Type tex requires an input file");
System.exit(1);
}
if (type.equals("java")) {
fromJava(hexcode, outfile);
} else if (type.equals("ucd")) {
fromUCD(hexcode, infile, outfile);
} else if (type.equals("tex")) {
fromTeX(hexcode, infile, outfile);
} else {
System.err.println("Unknown type: " + type + ", nothing done");
System.exit(1);
}
}
}
@@ -0,0 +1,704 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.text.linebreak;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.fop.util.License;
// CSOFF: LineLengthCheck
/**
* <p>Utility for generating a Java class representing line break properties
* from the Unicode property files.</p>
* <p>Customizations:
* <ul>
* <li>The pair table file is a cut+paste of the sample table from the TR14
* HTML file into a text file.</li>
* <li>Because the sample table does not cover all line break classes, check the
* 'not in pair table' list of property value short names.</li>
* <li>Check MAX_LINE_LENGTH.</li>
* </ul>
*
*/
public final class GenerateLineBreakUtils {
private GenerateLineBreakUtils() {
}
private static final int MAX_LINE_LENGTH = 110;
private static final byte DIRECT_BREAK = 0; // _ in table
private static final byte INDIRECT_BREAK = 1; // % in table
private static final byte COMBINING_INDIRECT_BREAK = 2; // # in table
private static final byte COMBINING_PROHIBITED_BREAK = 3; // @ in table
private static final byte PROHIBITED_BREAK = 4; // ^ in table
private static final byte EXPLICIT_BREAK = 5; // ! in rules
private static final String BREAK_CLASS_TOKENS = "_%#@^!";
private static final String[] NOT_IN_PAIR_TABLE = {
"AI", "BK", "CB", "CR", "LF", "NL", "SA", "SG", "SP", "XX"
};
private static byte[] lineBreakProperties = new byte[0x10000];
private static Map lineBreakPropertyValues = new HashMap();
private static List lineBreakPropertyShortNames = new ArrayList();
private static List lineBreakPropertyLongNames = new ArrayList();
/**
* Generate a class managing line break properties for Unicode characters and a sample
* table for the table driven line breaking algorithm described in
* <a href="http://unicode.org/reports/tr14/#PairBasedImplementation">UTR #14</a>.
* TODO: Code points above the base plane are simply ignored.
*
* @param lineBreakFileName Name of line break property file (part of Unicode files).
* @param propertyValueFileName Name of property values alias file (part of Unicode files).
* @param breakPairFileName Name of pair table file (<i>not</i> part of the unicode files).
* @param outFileName Name of the output file.
* @throws Exception in case anything goes wrong.
*/
private static void convertLineBreakProperties(
String lineBreakFileName,
String propertyValueFileName,
String breakPairFileName,
String outFileName)
throws Exception {
readLineBreakProperties(lineBreakFileName, propertyValueFileName);
// read break pair table
int lineBreakPropertyValueCount = lineBreakPropertyValues.size();
int tableSize = lineBreakPropertyValueCount - NOT_IN_PAIR_TABLE.length;
Map notInPairTableMap = new HashMap(NOT_IN_PAIR_TABLE.length);
for (int i = 0; i < NOT_IN_PAIR_TABLE.length; i++) {
Object v = lineBreakPropertyValues.get(NOT_IN_PAIR_TABLE[i]);
if (v == null) {
throw new Exception("'not in pair table' property not found: " + NOT_IN_PAIR_TABLE[i]);
}
notInPairTableMap.put(NOT_IN_PAIR_TABLE[i], v);
}
byte[][] pairTable = new byte[tableSize][];
byte[] columnHeader = new byte[tableSize];
byte[] rowHeader = new byte[tableSize];
byte[] columnMap = new byte[lineBreakPropertyValueCount + 1];
Arrays.fill(columnMap, (byte)255);
byte[] rowMap = new byte[lineBreakPropertyValueCount + 1];
Arrays.fill(rowMap, (byte)255);
BufferedReader b = new BufferedReader(new FileReader(breakPairFileName));
String line = b.readLine();
int lineNumber = 1;
String[] lineTokens;
String name;
// read header
if (line != null) {
lineTokens = line.split("\\s+");
byte columnNumber = 0;
for (int i = 0; i < lineTokens.length; ++i) {
name = lineTokens[i];
if (name.length() > 0) {
if (columnNumber >= columnHeader.length) {
throw new Exception(breakPairFileName + ':' + lineNumber + ": unexpected column header " + name);
}
if (notInPairTableMap.get(name) != null) {
throw new Exception(breakPairFileName + ':' + lineNumber + ": invalid column header " + name);
}
Byte v = (Byte)lineBreakPropertyValues.get(name);
if (v != null) {
byte vv = v.byteValue();
columnHeader[columnNumber] = vv;
columnMap[vv] = columnNumber;
} else {
throw new Exception(breakPairFileName + ':' + lineNumber + ": unknown column header " + name);
}
columnNumber++;
}
}
if (columnNumber < columnHeader.length) {
StringBuffer missing = new StringBuffer();
for (int j = 0; j < lineBreakPropertyShortNames.size(); j++) {
boolean found = false;
for (int k = 0; k < columnNumber; k++) {
if (columnHeader[k] == j + 1) {
found = true;
break;
}
}
if (!found) {
if (missing.length() > 0) {
missing.append(", ");
}
missing.append((String)lineBreakPropertyShortNames.get(j));
}
}
throw new Exception(
breakPairFileName + ':' + lineNumber + ": missing column for properties: " + missing.toString());
}
} else {
throw new Exception(breakPairFileName + ':' + lineNumber + ": can't read table header");
}
line = b.readLine().trim();
lineNumber++;
byte rowNumber = 0;
while (line != null && line.length() > 0) {
if (rowNumber >= rowHeader.length) {
throw new Exception(breakPairFileName + ':' + lineNumber + ": unexpected row " + line);
}
pairTable[rowNumber] = new byte[tableSize];
lineTokens = line.split("\\s+");
if (lineTokens.length > 0) {
name = lineTokens[0];
if (notInPairTableMap.get(name) != null) {
throw new Exception(breakPairFileName + ':' + lineNumber + ": invalid row header " + name);
}
Byte v = (Byte)lineBreakPropertyValues.get(name);
if (v != null) {
byte vv = v.byteValue();
rowHeader[rowNumber] = vv;
rowMap[vv] = rowNumber;
} else {
throw new Exception(breakPairFileName + ':' + lineNumber + ": unknown row header " + name);
}
} else {
throw new Exception(breakPairFileName + ':' + lineNumber + ": can't read row header");
}
int columnNumber = 0;
String token;
for (int i = 1; i < lineTokens.length; ++i) {
token = lineTokens[i];
if (token.length() == 1) {
byte tokenBreakClass = (byte)BREAK_CLASS_TOKENS.indexOf(token.charAt(0));
if (tokenBreakClass >= 0) {
pairTable[rowNumber][columnNumber] = tokenBreakClass;
} else {
throw new Exception(breakPairFileName + ':' + lineNumber + ": unexpected token: " + token);
}
} else {
throw new Exception(breakPairFileName + ':' + lineNumber + ": token too long: " + token);
}
columnNumber++;
}
line = b.readLine().trim();
lineNumber++;
rowNumber++;
}
if (rowNumber < rowHeader.length) {
StringBuffer missing = new StringBuffer();
for (int j = 0; j < lineBreakPropertyShortNames.size(); j++) {
boolean found = false;
for (int k = 0; k < rowNumber; k++) {
if (rowHeader[k] == j + 1) {
found = true;
break;
}
}
if (!found) {
if (missing.length() > 0) {
missing.append(", ");
}
missing.append((String)lineBreakPropertyShortNames.get(j));
}
}
throw new Exception(
breakPairFileName + ':' + lineNumber + ": missing row for properties: " + missing.toString());
}
// generate class
int rowsize = 512;
int blocksize = lineBreakProperties.length / rowsize;
byte[][] row = new byte[rowsize][];
int idx = 0;
StringBuffer doStaticLinkCode = new StringBuffer();
PrintWriter out = new PrintWriter(new FileWriter(outFileName));
License.writeJavaLicenseId(out);
out.println();
out.println("package org.apache.fop.text.linebreak;");
out.println();
out.println("/*");
out.println(" * !!! THIS IS A GENERATED FILE !!!");
out.println(" * If updates to the source are needed, then:");
out.println(" * - apply the necessary modifications to");
out.println(" * 'src/codegen/unicode/java/org/apache/fop/text/linebreak/GenerateLineBreakUtils.java'");
out.println(" * - run 'ant codegen-unicode', which will generate a new LineBreakUtils.java");
out.println(" * in 'src/java/org/apache/fop/text/linebreak'");
out.println(" * - commit BOTH changed files");
out.println(" */");
out.println();
out.println("// CSOFF: WhitespaceAfterCheck");
out.println("// CSOFF: LineLengthCheck");
out.println();
out.println("/** Line breaking utilities. */");
out.println("public final class LineBreakUtils {");
out.println();
out.println(" private LineBreakUtils() {");
out.println(" }");
out.println();
out.println(" /** Break class constant */");
out.println(" public static final byte DIRECT_BREAK = " + DIRECT_BREAK + ';');
out.println(" /** Break class constant */");
out.println(" public static final byte INDIRECT_BREAK = " + INDIRECT_BREAK + ';');
out.println(" /** Break class constant */");
out.println(" public static final byte COMBINING_INDIRECT_BREAK = " + COMBINING_INDIRECT_BREAK + ';');
out.println(" /** Break class constant */");
out.println(" public static final byte COMBINING_PROHIBITED_BREAK = " + COMBINING_PROHIBITED_BREAK + ';');
out.println(" /** Break class constant */");
out.println(" public static final byte PROHIBITED_BREAK = " + PROHIBITED_BREAK + ';');
out.println(" /** Break class constant */");
out.println(" public static final byte EXPLICIT_BREAK = " + EXPLICIT_BREAK + ';');
out.println();
out.println(" private static final byte[][] PAIR_TABLE = {");
boolean printComma = false;
for (int i = 1; i <= lineBreakPropertyValueCount; i++) {
if (printComma) {
out.println(",");
} else {
printComma = true;
}
out.print(" {");
boolean localPrintComma = false;
for (int j = 1; j <= lineBreakPropertyValueCount; j++) {
if (localPrintComma) {
out.print(", ");
} else {
localPrintComma = true;
}
if (columnMap[j] != -1 && rowMap[i] != -1) {
out.print(pairTable[rowMap[i]][columnMap[j]]);
} else {
out.print('0');
}
}
out.print('}');
}
out.println("};");
out.println();
out.println(" private static byte[][] lineBreakProperties = new byte[" + rowsize + "][];");
out.println();
out.println(" private static void init0() {");
int rowsPrinted = 0;
int initSections = 0;
for (int i = 0; i < rowsize; i++) {
boolean found = false;
for (int j = 0; j < i; j++) {
if (row[j] != null) {
boolean matched = true;
for (int k = 0; k < blocksize; k++) {
if (row[j][k] != lineBreakProperties[idx + k]) {
matched = false;
break;
}
}
if (matched) {
found = true;
doStaticLinkCode.append(" lineBreakProperties[");
doStaticLinkCode.append(i);
doStaticLinkCode.append("] = lineBreakProperties[");
doStaticLinkCode.append(j);
doStaticLinkCode.append("];\n");
break;
}
}
}
if (!found) {
if (rowsPrinted >= 64) {
out.println(" }");
out.println();
initSections++;
out.println(" private static void init" + initSections + "() {");
rowsPrinted = 0;
}
row[i] = new byte[blocksize];
boolean printLocalComma = false;
out.print(" lineBreakProperties[" + i + "] = new byte[] { ");
for (int k = 0; k < blocksize; k++) {
row[i][k] = lineBreakProperties[idx + k];
if (printLocalComma) {
out.print(", ");
} else {
printLocalComma = true;
}
out.print(row[i][k]);
}
out.println("};");
rowsPrinted++;
}
idx += blocksize;
}
out.println(" }");
out.println();
out.println(" static {");
for (int i = 0; i <= initSections; i++) {
out.println(" init" + i + "();");
}
out.print(doStaticLinkCode);
out.println(" }");
out.println();
for (int i = 0; i < lineBreakPropertyShortNames.size(); i++) {
String shortName = (String)lineBreakPropertyShortNames.get(i);
out.println(" /** Linebreak property constant */");
out.print(" public static final byte LINE_BREAK_PROPERTY_");
out.print(shortName);
out.print(" = ");
out.print(i + 1);
out.println(';');
}
out.println();
final String shortNamePrefix = " private static String[] lineBreakPropertyShortNames = {";
out.print(shortNamePrefix);
int lineLength = shortNamePrefix.length();
printComma = false;
for (int i = 0; i < lineBreakPropertyShortNames.size(); i++) {
name = (String)lineBreakPropertyShortNames.get(i);
if (printComma) {
if (lineLength <= MAX_LINE_LENGTH - 2) {
out.print(", ");
} else {
out.print(",");
}
// count the space anyway to force a linebreak if the comma causes lineLength == MAX_LINE_LENGTH
lineLength += 2;
} else {
printComma = true;
}
if (lineLength > MAX_LINE_LENGTH) {
out.println();
out.print(" ");
lineLength = 8;
}
out.print('"');
out.print(name);
out.print('"');
lineLength += (2 + name.length());
}
out.println("};");
out.println();
final String longNamePrefix = " private static String[] lineBreakPropertyLongNames = {";
out.print(longNamePrefix);
lineLength = longNamePrefix.length();
printComma = false;
for (int i = 0; i < lineBreakPropertyLongNames.size(); i++) {
name = (String)lineBreakPropertyLongNames.get(i);
if (printComma) {
out.print(',');
lineLength++;
} else {
printComma = true;
}
if (lineLength > MAX_LINE_LENGTH) {
out.println();
out.print(" ");
lineLength = 8;
}
out.print('"');
out.print(name);
out.print('"');
lineLength += (2 + name.length());
}
out.println("};");
out.println();
out.println(" /**");
out.println(" * Return the short name for the linebreak property corresponding");
out.println(" * to the given symbolic constant.");
out.println(" *");
out.println(" * @param i the numeric value of the linebreak property");
out.println(" * @return the short name of the linebreak property");
out.println(" */");
out.println(" public static String getLineBreakPropertyShortName(byte i) {");
out.println(" if (i > 0 && i <= lineBreakPropertyShortNames.length) {");
out.println(" return lineBreakPropertyShortNames[i - 1];");
out.println(" } else {");
out.println(" return null;");
out.println(" }");
out.println(" }");
out.println();
out.println(" /**");
out.println(" * Return the long name for the linebreak property corresponding");
out.println(" * to the given symbolic constant.");
out.println(" *");
out.println(" * @param i the numeric value of the linebreak property");
out.println(" * @return the long name of the linebreak property");
out.println(" */");
out.println(" public static String getLineBreakPropertyLongName(byte i) {");
out.println(" if (i > 0 && i <= lineBreakPropertyLongNames.length) {");
out.println(" return lineBreakPropertyLongNames[i - 1];");
out.println(" } else {");
out.println(" return null;");
out.println(" }");
out.println(" }");
out.println();
out.println(" /**");
out.println(" * Return the linebreak property constant for the given <code>char</code>");
out.println(" *");
out.println(" * @param c the <code>char</code> whose linebreak property to return");
out.println(" * @return the constant representing the linebreak property");
out.println(" */");
out.println(" public static byte getLineBreakProperty(char c) {");
out.println(" return lineBreakProperties[c / " + blocksize + "][c % " + blocksize + "];");
out.println(" }");
out.println();
out.println(" /**");
out.println(" * Return the break class constant for the given pair of linebreak");
out.println(" * property constants.");
out.println(" *");
out.println(" * @param lineBreakPropertyBefore the linebreak property for the first character");
out.println(" * in a two-character sequence");
out.println(" * @param lineBreakPropertyAfter the linebreak property for the second character");
out.println(" * in a two-character sequence");
out.println(" * @return the constant representing the break class");
out.println(" */");
out.println(
" public static byte getLineBreakPairProperty(int lineBreakPropertyBefore, int lineBreakPropertyAfter) {");
out.println(" return PAIR_TABLE[lineBreakPropertyBefore - 1][lineBreakPropertyAfter - 1];");
out.println(" }");
out.println();
out.println("}");
out.flush();
out.close();
}
/**
* Read line break property value names and the actual properties for the Unicode
* characters from the respective Unicode files.
* TODO: Code points above the base plane are simply ignored.
*
* @param lineBreakFileName Name of line break property file.
* @param propertyValueFileName Name of property values alias file.
* @throws Exception in case anything goes wrong.
*/
private static void readLineBreakProperties(String lineBreakFileName, String propertyValueFileName)
throws Exception {
// read property names
BufferedReader b = new BufferedReader(new InputStreamReader(new URL(propertyValueFileName).openStream()));
String line = b.readLine();
int lineNumber = 1;
byte propertyIndex = 1;
byte indexForUnknown = 0;
while (line != null) {
if (line.startsWith("lb")) {
String shortName;
String longName = null;
int semi = line.indexOf(';');
if (semi < 0) {
throw new Exception(
propertyValueFileName + ':' + lineNumber + ": missing property short name in " + line);
}
line = line.substring(semi + 1);
semi = line.indexOf(';');
if (semi > 0) {
shortName = line.substring(0, semi).trim();
longName = line.substring(semi + 1).trim();
semi = longName.indexOf(';');
if (semi > 0) {
longName = longName.substring(0, semi).trim();
}
} else {
shortName = line.trim();
}
if (shortName.equals("XX")) {
indexForUnknown = propertyIndex;
}
lineBreakPropertyValues.put(shortName, new Byte((byte)propertyIndex));
lineBreakPropertyShortNames.add(shortName);
lineBreakPropertyLongNames.add(longName);
propertyIndex++;
if (propertyIndex <= 0) {
throw new Exception(propertyValueFileName + ':' + lineNumber + ": property rolled over in " + line);
}
}
line = b.readLine();
lineNumber++;
}
if (indexForUnknown == 0) {
throw new Exception("index for XX (unknown) line break property value not found");
}
// read property values
Arrays.fill(lineBreakProperties, (byte)0);
b = new BufferedReader(new InputStreamReader(new URL(lineBreakFileName).openStream()));
line = b.readLine();
lineNumber = 1;
while (line != null) {
int idx = line.indexOf('#');
if (idx >= 0) {
line = line.substring(0, idx);
}
line = line.trim();
if (line.length() > 0) {
idx = line.indexOf(';');
if (idx <= 0) {
throw new Exception(lineBreakFileName + ':' + lineNumber + ": No field delimiter in " + line);
}
Byte v = (Byte)lineBreakPropertyValues.get(line.substring(idx + 1).trim());
if (v == null) {
throw new Exception(lineBreakFileName + ':' + lineNumber + ": Unknown property value in " + line);
}
String codepoint = line.substring(0, idx);
int low;
int high;
idx = codepoint.indexOf("..");
try {
if (idx >= 0) {
low = Integer.parseInt(codepoint.substring(0, idx), 16);
high = Integer.parseInt(codepoint.substring(idx + 2), 16);
} else {
low = Integer.parseInt(codepoint, 16);
high = low;
}
} catch (NumberFormatException e) {
throw new Exception(lineBreakFileName + ':' + lineNumber + ": Invalid codepoint number in " + line);
}
if (high > 0xFFFF) {
// ignore non-baseplane characters for now
} else {
if (low < 0 || high < 0) {
throw new Exception(
lineBreakFileName + ':' + lineNumber + ": Negative codepoint(s) in " + line);
}
byte vv = v.byteValue();
for (int i = low; i <= high; i++) {
if (lineBreakProperties[i] != 0) {
throw new Exception(
lineBreakFileName
+ ':'
+ lineNumber
+ ": Property already set for "
+ ((char)i)
+ " in "
+ line);
}
lineBreakProperties[i] = vv;
}
}
}
line = b.readLine();
lineNumber++;
}
}
/**
* Determine a good block size for the two stage optimized storage of the
* line breaking properties. Note: the memory utilization calculation is a rule of thumb,
* don't take it too serious.
*
* @param lineBreakFileName Name of line break property file.
* @param propertyValueFileName Name of property values alias file.
* @throws Exception in case anything goes wrong.
*/
private static void optimizeBlocks(String lineBreakFileName, String propertyValueFileName) throws Exception {
readLineBreakProperties(lineBreakFileName, propertyValueFileName);
for (int i = 0; i < 16; i++) {
int rowsize = 1 << i;
int blocksize = lineBreakProperties.length / (rowsize);
byte[][] row = new byte[rowsize][];
int idx = 0;
int nrOfDistinctBlocks = 0;
for (int j = 0; j < rowsize; j++) {
byte[] block = new byte[blocksize];
for (int k = 0; k < blocksize; k++) {
block[k] = lineBreakProperties[idx];
idx++;
}
boolean found = false;
for (int k = 0; k < j; k++) {
if (row[k] != null) {
boolean matched = true;
for (int l = 0; l < blocksize; l++) {
if (row[k][l] != block[l]) {
matched = false;
break;
}
}
if (matched) {
found = true;
break;
}
}
}
if (!found) {
row[j] = block;
nrOfDistinctBlocks++;
} else {
row[j] = null;
}
}
int size = rowsize * 4 + nrOfDistinctBlocks * blocksize;
System.out.println(
"i=" + i + " blocksize=" + blocksize + " blocks=" + nrOfDistinctBlocks + " size=" + size);
}
}
/**
* Main entry point for running GenerateLineBreakUtils
* @param args array of command line arg
*/
public static void main(String[] args) {
String lineBreakFileName = "http://www.unicode.org/Public/UNIDATA/LineBreak.txt";
String propertyValueFileName = "http://www.unicode.org/Public/UNIDATA/PropertyValueAliases.txt";
String breakPairFileName = "src/codegen/unicode/data/LineBreakPairTable.txt";
String outFileName = "LineBreakUtils.java";
boolean ok = true;
for (int i = 0; i < args.length; i = i + 2) {
if (i + 1 == args.length) {
ok = false;
} else {
String opt = args[i];
if ("-l".equals(opt)) {
lineBreakFileName = args[i + 1];
} else if ("-p".equals(opt)) {
propertyValueFileName = args[i + 1];
} else if ("-b".equals(opt)) {
breakPairFileName = args[i + 1];
} else if ("-o".equals(opt)) {
outFileName = args[i + 1];
} else {
ok = false;
}
}
}
if (!ok) {
System.out.println("Usage: GenerateLineBreakUtils [-l <lineBreakFile>] [-p <propertyValueFile>] [-b <breakPairFile>] [-o <outputFile>]");
System.out.println(" defaults:");
System.out.println(" <lineBreakFile>: " + lineBreakFileName);
System.out.println(" <propertyValueFile>: " + propertyValueFileName);
System.out.println(" <breakPairFile>: " + breakPairFileName);
System.out.println(" <outputFile>: " + outFileName);
} else {
try {
convertLineBreakProperties(lineBreakFileName, propertyValueFileName, breakPairFileName, outFileName);
System.out.println("Generated " + outFileName + " from");
System.out.println(" <lineBreakFile>: " + lineBreakFileName);
System.out.println(" <propertyValueFile>: " + propertyValueFileName);
System.out.println(" <breakPairFile>: " + breakPairFileName);
} catch (Exception e) {
System.out.println("An unexpected error occured");
e.printStackTrace();
}
}
}
}
@@ -0,0 +1,122 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.util;
import java.io.IOException;
import java.io.StringWriter;
import java.io.Writer;
/**
* Write the Apache license text in various forms
*/
public final class License {
private License() {
}
/**
* The Apache license text as a string array
*/
public static final String[] LICENSE
= {"Licensed to the Apache Software Foundation (ASF) under one or more",
"contributor license agreements. See the NOTICE file distributed with",
"this work for additional information regarding copyright ownership.",
"The ASF licenses this file to You under the Apache License, Version 2.0",
"(the \"License\"); you may not use this file except in compliance with",
"the License. You may obtain a copy of the License at",
"",
" http://www.apache.org/licenses/LICENSE-2.0",
"",
"Unless required by applicable law or agreed to in writing, software",
"distributed under the License is distributed on an \"AS IS\" BASIS,",
"WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.",
"See the License for the specific language governing permissions and",
"limitations under the License."
};
/**
* The subversion Id keyword line
*/
public static final String ID = "$Id$";
/**
* Calculate the maximum line length in the Apache license text
* for use in formatting
*/
private static int maxLength;
static {
int j = 0;
for (int i = 0; i < LICENSE.length; ++i) {
if (j < LICENSE[i].length()) {
j = LICENSE[i].length();
}
}
maxLength = j;
}
/**
* Write the Apache license text as commented lines for a Java file
* @param w the writer which writes the comment
* @throws IOException if the write operation fails
*/
public static void writeJavaLicenseId(Writer w) throws IOException {
w.write("/*\n");
for (int i = 0; i < LICENSE.length; ++i) {
if (LICENSE[i].equals("")) {
w.write(" *\n");
} else {
w.write(" * " + LICENSE[i] + "\n");
}
}
w.write(" */\n");
w.write("\n");
w.write("/* " + ID + " */\n");
}
/**
* Write the Apache license text as commented lines for an XML file
* @param w the writer which writes the comment
* @throws IOException if the write operation fails
*/
public static void writeXMLLicenseId(Writer w) throws IOException {
for (int i = 0; i < LICENSE.length; ++i) {
w.write(String.format("<!-- %-" + maxLength + "s -->\n", new Object[] {LICENSE[i]}));
}
w.write("\n");
w.write("<!-- " + ID + " -->\n");
}
/**
* For testing purposes
* @param args optional, --java or --xml
* @throws IOException if the write operation fails
*/
public static void main(String[] args) throws IOException {
StringWriter w = new StringWriter();
if (args.length == 0 || args[0].equals("--java")) {
writeJavaLicenseId(w);
} else if (args[0].equals("--xml")) {
writeXMLLicenseId(w);
}
System.out.println(w.toString());
}
}
@@ -0,0 +1,170 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import org.w3c.dom.Document;
import org.xml.sax.Locator;
import org.apache.xmlgraphics.image.loader.ImageException;
import org.apache.fop.events.EventBroadcaster;
import org.apache.fop.events.EventProducer;
/**
* Event producer interface for resource events (missing images, fonts etc.).
*/
public interface ResourceEventProducer extends EventProducer {
/**
* Provider class for the event producer.
*/
final class Provider {
private Provider() {
}
/**
* Returns an event producer.
* @param broadcaster the event broadcaster to use
* @return the requested event producer
*/
public static ResourceEventProducer get(EventBroadcaster broadcaster) {
return broadcaster.getEventProducerFor(ResourceEventProducer.class);
}
}
/**
* Image not found.
* @param source the event source
* @param uri the original URI of the image
* @param fnfe the "file not found" exception
* @param loc the location of the error or null
* @event.severity ERROR
*/
void imageNotFound(Object source, String uri, FileNotFoundException fnfe, Locator loc);
/**
* Error while processing image.
* @param source the event source
* @param uri the original URI of the image
* @param e the image exception
* @param loc the location of the error or null
* @event.severity ERROR
*/
void imageError(Object source, String uri, ImageException e, Locator loc);
/**
* I/O error while loading an image.
* @param source the event source
* @param uri the original URI of the image
* @param ioe the I/O exception
* @param loc the location of the error or null
* @event.severity ERROR
*/
void imageIOError(Object source, String uri, IOException ioe, Locator loc);
/**
* Error while writing/serializing an image to an output format.
* @param source the event source
* @param e the original exception
* @event.severity ERROR
*/
void imageWritingError(Object source, Exception e);
/**
* Error while handling a URI.
* @param source the event source
* @param uri the original URI of the image
* @param e the original exception
* @param loc the location of the error or null
* @event.severity ERROR
*/
void uriError(Object source, String uri, Exception e, Locator loc);
/**
* Intrinsic size of fo:instream-foreign-object could not be determined.
* @param source the event source
* @param loc the location of the error or null
* @event.severity ERROR
*/
void ifoNoIntrinsicSize(Object source, Locator loc);
/**
* Error processing foreign XML content.
* @param source the event source
* @param doc the foreign XML
* @param namespaceURI the namespace URI of the foreign XML
* @param e the original exception
* @event.severity ERROR
*/
void foreignXMLProcessingError(Object source, Document doc, String namespaceURI, Exception e);
/**
* No handler for foreign XML content.
* @param source the event source
* @param doc the foreign XML
* @param namespaceURI the namespace URI of the foreign XML
* @event.severity ERROR
*/
void foreignXMLNoHandler(Object source, Document doc, String namespaceURI);
/**
* Cannot delete a temporary file.
* @param source the event source
* @param tempFile the temporary file
* @event.severity ERROR
*/
void cannotDeleteTempFile(Object source, File tempFile);
/**
* Catalog Resolver not found along the class path
* @param source the event source
* @event.severity ERROR
*/
void catalogResolverNotFound(Object source);
/**
* Catalog Resolver not created, due to InstantiationException or IllegalAccessException
* @param source the event source
* @param message the exception message
* @event.severity ERROR
*/
void catalogResolverNotCreated(Object source, String message);
/**
* Warning in an image.
* @param source the event source
* @param message warning
* @event.severity WARN
*/
void imageWarning(Object source, String message);
/**
* Hyphenation not found.
* @param source the event source
* @param uri the original URI of the hyphenation
* @event.severity WARN
*/
void hyphenationNotFound(Object source, String uri);
}
@@ -0,0 +1,62 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop;
/**
* This class is used to evaluate the version information contained in the Manifest of FOP's JAR.
* Note that this class can only find the version information if it's in the org.apache.fop package
* as this package equals the one specified in the manifest.
*/
public final class Version {
private Version() { }
/**
* Get the version of FOP
* @return the version string
*/
public static String getVersion() {
String version = null;
Package jarinfo = Version.class.getPackage();
if (jarinfo != null) {
version = jarinfo.getImplementationVersion();
}
if (version == null) {
//Fallback if FOP is used in a development environment
// CSOFF: LineLength
String headURL = "$HeadURL$";
// CSON: LineLength
version = headURL;
final String pathPrefix = "/xmlgraphics/fop/";
int pos = version.indexOf(pathPrefix);
if (pos >= 0) {
version = version.substring(pos + pathPrefix.length() - 1, version.length() - 2);
pos = version.indexOf("/src/");
version = version.substring(1, pos);
version = " " + version;
} else {
version = "";
}
version = "SVN" + version;
}
return version;
}
}
@@ -0,0 +1,44 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.accessibility;
/**
* Helper class for FOP's accessibility features.
*/
public final class Accessibility {
/** Constant string for the rendering options key to enable accessibility features. */
public static final String ACCESSIBILITY = "accessibility";
/** Constant string for the rendering options key to suppress empty tags from structure tree. */
public static final String KEEP_EMPTY_TAGS = "keep-empty-tags";
public static final String STATIC_REGION_PER_PAGE = "static-region-per-page";
/**
* The value to be set on the 'role' property for the element and its descendants to
* be considered as artifacts.
*/
public static final String ROLE_ARTIFACT = "artifact";
private Accessibility() { }
}
@@ -0,0 +1,53 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.accessibility;
import org.apache.fop.events.EventBroadcaster;
import org.apache.fop.events.EventProducer;
/**
* Event producer for accessibility-related events.
*/
public interface AccessibilityEventProducer extends EventProducer {
/** Provider class for the event producer. */
public final class Provider {
private Provider() { }
/**
* Returns an event producer.
*
* @param broadcaster the event broadcaster to use
* @return the event producer
*/
public static AccessibilityEventProducer get(EventBroadcaster broadcaster) {
return broadcaster.getEventProducerFor(AccessibilityEventProducer.class);
}
}
/**
* The structure tree is missing in the XML file.
*
* @param source the event source
* @event.severity FATAL
*/
void noStructureTreeInXML(Object source);
}
@@ -0,0 +1,63 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.accessibility;
import java.util.Locale;
import org.xml.sax.Attributes;
/**
* This implementation ignores all structure tree events.
*/
public final class DummyStructureTreeEventHandler implements StructureTreeEventHandler {
/** The singleton instance of this class. */
public static final StructureTreeEventHandler INSTANCE = new DummyStructureTreeEventHandler();
private DummyStructureTreeEventHandler() { }
/** {@inheritDoc} */
public void startPageSequence(Locale locale, String role) {
}
/** {@inheritDoc} */
public void endPageSequence() {
}
/** {@inheritDoc} */
public StructureTreeElement startNode(String name, Attributes attributes, StructureTreeElement parent) {
return null;
}
/** {@inheritDoc} */
public void endNode(String name) {
}
/** {@inheritDoc} */
public StructureTreeElement startImageNode(String name, Attributes attributes, StructureTreeElement parent) {
return null;
}
/** {@inheritDoc} */
public StructureTreeElement startReferencedNode(String name, Attributes attributes, StructureTreeElement parent) {
return null;
}
}
@@ -0,0 +1,127 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.accessibility;
import java.util.Locale;
import org.xml.sax.Attributes;
import org.xml.sax.ContentHandler;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.AttributesImpl;
import org.apache.fop.fo.FOElementMapping;
import org.apache.fop.fo.extensions.ExtensionElementMapping;
import org.apache.fop.fo.extensions.InternalElementMapping;
import org.apache.fop.render.intermediate.IFConstants;
import org.apache.fop.util.XMLConstants;
/**
* Converts structure tree events to SAX events.
*/
public final class StructureTree2SAXEventAdapter implements StructureTreeEventHandler {
private final ContentHandler contentHandler;
private StructureTree2SAXEventAdapter(ContentHandler currentContentHandler) {
this.contentHandler = currentContentHandler;
}
/**
* Factory method that creates a new instance.
* @param contentHandler The handler that receives SAX events
* @return -
*/
public static StructureTreeEventHandler newInstance(ContentHandler contentHandler) {
return new StructureTree2SAXEventAdapter(contentHandler);
}
/** {@inheritDoc} */
public void startPageSequence(Locale locale, String role) {
try {
AttributesImpl attributes = new AttributesImpl();
if (role != null) {
attributes.addAttribute("", "type", "type", XMLConstants.CDATA, role);
}
contentHandler.startPrefixMapping(
InternalElementMapping.STANDARD_PREFIX, InternalElementMapping.URI);
contentHandler.startPrefixMapping(
ExtensionElementMapping.STANDARD_PREFIX, ExtensionElementMapping.URI);
contentHandler.startElement(IFConstants.NAMESPACE,
IFConstants.EL_STRUCTURE_TREE, IFConstants.EL_STRUCTURE_TREE,
attributes);
} catch (SAXException e) {
throw new RuntimeException(e);
}
}
/** {@inheritDoc} */
public void endPageSequence() {
try {
contentHandler.endElement(IFConstants.NAMESPACE, IFConstants.EL_STRUCTURE_TREE,
IFConstants.EL_STRUCTURE_TREE);
contentHandler.endPrefixMapping(
ExtensionElementMapping.STANDARD_PREFIX);
contentHandler.endPrefixMapping(
InternalElementMapping.STANDARD_PREFIX);
} catch (SAXException e) {
throw new RuntimeException(e);
}
}
/** {@inheritDoc} */
public StructureTreeElement startNode(String name, Attributes attributes, StructureTreeElement parent) {
try {
if (name.equals("#PCDATA")) {
name = "marked-content";
contentHandler.startElement(IFConstants.NAMESPACE, name,
name, attributes);
} else {
contentHandler.startElement(FOElementMapping.URI, name,
FOElementMapping.STANDARD_PREFIX + ":" + name,
attributes);
}
return null;
} catch (SAXException e) {
throw new RuntimeException(e);
}
}
/** {@inheritDoc} */
public void endNode(String name) {
try {
contentHandler.endElement(FOElementMapping.URI, name,
FOElementMapping.STANDARD_PREFIX + ":" + name);
} catch (SAXException e) {
throw new RuntimeException(e);
}
}
/** {@inheritDoc} */
public StructureTreeElement startImageNode(String name, Attributes attributes, StructureTreeElement parent) {
return startNode(name, attributes, null);
}
/** {@inheritDoc} */
public StructureTreeElement startReferencedNode(String name, Attributes attributes, StructureTreeElement parent) {
return startNode(name, attributes, null);
}
}
@@ -0,0 +1,28 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.accessibility;
/**
* An object that represents the structure of the document in the output format.
* In PDF, an implementation of this interface will typically result into the
* creation of a structure element dictionary (a dictionary of type StructElem).
*/
public interface StructureTreeElement {
}
@@ -0,0 +1,86 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.accessibility;
import java.util.Locale;
import org.xml.sax.Attributes;
/**
* Receive notifications relating to the structure tree of an FO document.
* A structure tree is a reduced version of the document's FO tree, containing only the logical
* structure that is used by accessible output formats.
*/
public interface StructureTreeEventHandler {
/**
* Starts a page sequence structure tree node.
*
* @param locale The locale of the page sequence
* @param role the value of the role property. May be null.
*/
void startPageSequence(Locale locale, String role);
/**
* Starts a structure tree node.
*
* @param name the name of the structure tree node
* @param attributes the node properties
* @param parent the parent of the node. May be null, in which case the parent node is
* the node corresponding to the previous call to this method
* @return the corresponding structure tree element
*/
StructureTreeElement startNode(String name, Attributes attributes, StructureTreeElement parent);
/**
* Ends a structure tree node.
*
* @param name the name of the structure tree node
*/
void endNode(String name);
/**
* Starts an image node.
*
* @param name the name of the structure tree node
* @param attributes the node properties
* @param parent the parent of the node. May be null, in which case the parent node is
* the node corresponding to the previous call to this method
* @return the corresponding structure tree element
*/
StructureTreeElement startImageNode(String name, Attributes attributes, StructureTreeElement parent);
/**
* Starts a node that can be referenced by other nodes. This is usually a
* node that can have Marked Content References as children.
*
* @param name the name of the structure tree node
* @param attributes the node properties
* @param parent the parent of the node. May be null, in which case the parent node is
* the node corresponding to the previous call to this method
* @return the corresponding structure tree element
*/
StructureTreeElement startReferencedNode(String name, Attributes attributes, StructureTreeElement parent);
/**
* Ends a page sequence structure tree node.
*/
void endPageSequence();
}
@@ -0,0 +1,69 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.accessibility.fo;
import java.util.ArrayList;
import java.util.List;
import org.apache.fop.fo.FOEventHandler;
class Event {
private List<Event> children;
protected FOEventHandler eventHandler;
protected Event parent;
protected boolean hasContent;
public Event(FO2StructureTreeConverter structureTreeConverter) {
eventHandler = structureTreeConverter.converter;
}
public Event(Event parent) {
this.parent = parent;
}
private void init() {
if (children == null) {
children = new ArrayList<>();
}
}
public void run() {
if (hasContent()) {
for (Event e : children) {
e.run();
}
}
children.clear();
}
private boolean hasContent() {
init();
for (Event e : children) {
if (e.hasContent()) {
return true;
}
}
return hasContent;
}
public void add(Event child) {
init();
children.add(child);
}
}
@@ -0,0 +1,903 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.accessibility.fo;
import java.util.HashMap;
import java.util.Map;
import java.util.Stack;
import org.xml.sax.SAXException;
import org.apache.fop.accessibility.Accessibility;
import org.apache.fop.accessibility.StructureTreeEventHandler;
import org.apache.fop.fo.DelegatingFOEventHandler;
import org.apache.fop.fo.FOEventHandler;
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FOText;
import org.apache.fop.fo.extensions.ExternalDocument;
import org.apache.fop.fo.flow.AbstractRetrieveMarker;
import org.apache.fop.fo.flow.BasicLink;
import org.apache.fop.fo.flow.Block;
import org.apache.fop.fo.flow.BlockContainer;
import org.apache.fop.fo.flow.Character;
import org.apache.fop.fo.flow.ExternalGraphic;
import org.apache.fop.fo.flow.Footnote;
import org.apache.fop.fo.flow.FootnoteBody;
import org.apache.fop.fo.flow.Inline;
import org.apache.fop.fo.flow.InstreamForeignObject;
import org.apache.fop.fo.flow.Leader;
import org.apache.fop.fo.flow.ListBlock;
import org.apache.fop.fo.flow.ListItem;
import org.apache.fop.fo.flow.ListItemBody;
import org.apache.fop.fo.flow.ListItemLabel;
import org.apache.fop.fo.flow.PageNumber;
import org.apache.fop.fo.flow.PageNumberCitation;
import org.apache.fop.fo.flow.PageNumberCitationLast;
import org.apache.fop.fo.flow.RetrieveMarker;
import org.apache.fop.fo.flow.RetrieveTableMarker;
import org.apache.fop.fo.flow.Wrapper;
import org.apache.fop.fo.flow.table.Table;
import org.apache.fop.fo.flow.table.TableBody;
import org.apache.fop.fo.flow.table.TableCaption;
import org.apache.fop.fo.flow.table.TableCell;
import org.apache.fop.fo.flow.table.TableColumn;
import org.apache.fop.fo.flow.table.TableFooter;
import org.apache.fop.fo.flow.table.TableHeader;
import org.apache.fop.fo.flow.table.TableRow;
import org.apache.fop.fo.pagination.Flow;
import org.apache.fop.fo.pagination.PageSequence;
import org.apache.fop.fo.pagination.Root;
import org.apache.fop.fo.pagination.StaticContent;
import org.apache.fop.fo.properties.CommonAccessibility;
import org.apache.fop.fo.properties.CommonAccessibilityHolder;
/**
* Allows to create the structure tree of an FO document, by converting FO
* events into appropriate structure tree events.
*/
public class FO2StructureTreeConverter extends DelegatingFOEventHandler {
/** The top of the {@link converters} stack. */
protected FOEventHandler converter;
private Stack<FOEventHandler> converters = new Stack<FOEventHandler>();
private final StructureTreeEventTrigger structureTreeEventTrigger;
/** The descendants of some elements like fo:leader must be ignored. */
private final FOEventHandler eventSwallower = new FOEventHandler() {
};
private final Map<AbstractRetrieveMarker, State> states = new HashMap<AbstractRetrieveMarker, State>();
private static final class State {
private final FOEventHandler converter;
private final Stack<FOEventHandler> converters;
@SuppressWarnings("unchecked")
State(FO2StructureTreeConverter o) {
this.converter = o.converter;
this.converters = (Stack<FOEventHandler>) o.converters.clone();
}
}
private Event root = new Event((Event) null);
private Event currentNode = root;
private void startContent(Event event, boolean hasContent) {
if (getUserAgent().isKeepEmptyTags()) {
event.run();
} else {
Event node = new Event(currentNode);
event.hasContent = hasContent;
node.add(event);
currentNode.add(node);
currentNode = node;
}
}
private void content(Event event, boolean hasContent) {
if (getUserAgent().isKeepEmptyTags()) {
event.run();
} else {
currentNode.add(event);
event.hasContent = hasContent;
}
}
private void endContent(Event event) {
if (getUserAgent().isKeepEmptyTags()) {
event.run();
} else {
currentNode.add(event);
currentNode = currentNode.parent;
if (currentNode == root) {
root.run();
}
}
}
/**
* Creates a new instance.
*
* @param structureTreeEventHandler the object that will hold the structure tree
* @param delegate the FO event handler that must be wrapped by this instance
*/
public FO2StructureTreeConverter(StructureTreeEventHandler structureTreeEventHandler,
FOEventHandler delegate) {
super(delegate);
this.structureTreeEventTrigger = new StructureTreeEventTrigger(structureTreeEventHandler);
this.converter = structureTreeEventTrigger;
}
@Override
public void startDocument() throws SAXException {
converter.startDocument();
super.startDocument();
}
@Override
public void endDocument() throws SAXException {
converter.endDocument();
super.endDocument();
}
@Override
public void startRoot(Root root) {
converter.startRoot(root);
super.startRoot(root);
}
@Override
public void endRoot(Root root) {
converter.endRoot(root);
super.endRoot(root);
}
@Override
public void startPageSequence(PageSequence pageSeq) {
converter.startPageSequence(pageSeq);
super.startPageSequence(pageSeq);
}
@Override
public void endPageSequence(PageSequence pageSeq) {
converter.endPageSequence(pageSeq);
super.endPageSequence(pageSeq);
}
@Override
public void startPageNumber(final PageNumber pagenum) {
startContent(new Event(this) {
public void run() {
eventHandler.startPageNumber(pagenum);
}
}, true);
super.startPageNumber(pagenum);
}
@Override
public void endPageNumber(final PageNumber pagenum) {
endContent(new Event(this) {
public void run() {
eventHandler.endPageNumber(pagenum);
}
});
super.endPageNumber(pagenum);
}
@Override
public void startPageNumberCitation(final PageNumberCitation pageCite) {
startContent(new Event(this) {
public void run() {
eventHandler.startPageNumberCitation(pageCite);
}
}, true);
super.startPageNumberCitation(pageCite);
}
@Override
public void endPageNumberCitation(final PageNumberCitation pageCite) {
endContent(new Event(this) {
public void run() {
eventHandler.endPageNumberCitation(pageCite);
}
});
super.endPageNumberCitation(pageCite);
}
@Override
public void startPageNumberCitationLast(final PageNumberCitationLast pageLast) {
startContent(new Event(this) {
public void run() {
eventHandler.startPageNumberCitationLast(pageLast);
}
}, true);
super.startPageNumberCitationLast(pageLast);
}
@Override
public void endPageNumberCitationLast(final PageNumberCitationLast pageLast) {
endContent(new Event(this) {
public void run() {
eventHandler.endPageNumberCitationLast(pageLast);
}
});
super.endPageNumberCitationLast(pageLast);
}
@Override
public void startStatic(final StaticContent staticContent) {
handleStartArtifact(staticContent);
startContent(new Event(this) {
public void run() {
eventHandler.startStatic(staticContent);
}
}, true);
super.startStatic(staticContent);
}
@Override
public void endStatic(final StaticContent staticContent) {
endContent(new Event(this) {
public void run() {
eventHandler.endStatic(staticContent);
}
});
handleEndArtifact(staticContent);
super.endStatic(staticContent);
}
@Override
public void startFlow(Flow fl) {
converter.startFlow(fl);
super.startFlow(fl);
}
@Override
public void endFlow(Flow fl) {
converter.endFlow(fl);
super.endFlow(fl);
}
@Override
public void startBlock(final Block bl) {
startContent(new Event(this) {
public void run() {
eventHandler.startBlock(bl);
}
}, false);
super.startBlock(bl);
}
@Override
public void endBlock(final Block bl) {
endContent(new Event(this) {
public void run() {
eventHandler.endBlock(bl);
}
});
super.endBlock(bl);
}
@Override
public void startBlockContainer(final BlockContainer blc) {
startContent(new Event(this) {
public void run() {
eventHandler.startBlockContainer(blc);
}
}, false);
super.startBlockContainer(blc);
}
@Override
public void endBlockContainer(final BlockContainer blc) {
endContent(new Event(this) {
public void run() {
eventHandler.endBlockContainer(blc);
}
});
super.endBlockContainer(blc);
}
@Override
public void startInline(final Inline inl) {
startContent(new Event(this) {
public void run() {
eventHandler.startInline(inl);
}
}, true);
super.startInline(inl);
}
@Override
public void endInline(final Inline inl) {
endContent(new Event(this) {
public void run() {
eventHandler.endInline(inl);
}
});
super.endInline(inl);
}
@Override
public void startTable(final Table tbl) {
startContent(new Event(this) {
public void run() {
eventHandler.startTable(tbl);
}
}, true);
super.startTable(tbl);
}
@Override
public void endTable(final Table tbl) {
endContent(new Event(this) {
public void run() {
eventHandler.endTable(tbl);
}
});
super.endTable(tbl);
}
public void startTableCaption(final TableCaption tableCaption) {
startContent(new Event(this) {
public void run() {
eventHandler.startTableCaption(tableCaption);
}
}, true);
super.startTableCaption(tableCaption);
}
public void endTableCaption(final TableCaption tableCaption) {
endContent(new Event(this) {
public void run() {
eventHandler.endTableCaption(tableCaption);
}
});
super.endTableCaption(tableCaption);
}
@Override
public void startColumn(final TableColumn tc) {
startContent(new Event(this) {
public void run() {
eventHandler.startColumn(tc);
}
}, true);
super.startColumn(tc);
}
@Override
public void endColumn(final TableColumn tc) {
endContent(new Event(this) {
public void run() {
eventHandler.endColumn(tc);
}
});
super.endColumn(tc);
}
@Override
public void startHeader(final TableHeader header) {
handleStartArtifact(header);
startContent(new Event(this) {
public void run() {
eventHandler.startHeader(header);
}
}, false);
super.startHeader(header);
}
@Override
public void endHeader(final TableHeader header) {
endContent(new Event(this) {
public void run() {
eventHandler.endHeader(header);
}
});
handleEndArtifact(header);
super.endHeader(header);
}
@Override
public void startFooter(final TableFooter footer) {
handleStartArtifact(footer);
startContent(new Event(this) {
public void run() {
eventHandler.startFooter(footer);
}
}, false);
super.startFooter(footer);
}
@Override
public void endFooter(final TableFooter footer) {
endContent(new Event(this) {
public void run() {
eventHandler.endFooter(footer);
}
});
handleEndArtifact(footer);
super.endFooter(footer);
}
@Override
public void startBody(final TableBody body) {
startContent(new Event(this) {
public void run() {
eventHandler.startBody(body);
}
}, true);
super.startBody(body);
}
@Override
public void endBody(final TableBody body) {
endContent(new Event(this) {
public void run() {
eventHandler.endBody(body);
}
});
super.endBody(body);
}
@Override
public void startRow(final TableRow tr) {
startContent(new Event(this) {
public void run() {
eventHandler.startRow(tr);
}
}, false);
super.startRow(tr);
}
@Override
public void endRow(final TableRow tr) {
endContent(new Event(this) {
public void run() {
eventHandler.endRow(tr);
}
});
super.endRow(tr);
}
@Override
public void startCell(final TableCell tc) {
startContent(new Event(this) {
public void run() {
eventHandler.startCell(tc);
}
}, false);
super.startCell(tc);
}
@Override
public void endCell(final TableCell tc) {
endContent(new Event(this) {
public void run() {
eventHandler.endCell(tc);
}
});
super.endCell(tc);
}
@Override
public void startList(final ListBlock lb) {
startContent(new Event(this) {
public void run() {
eventHandler.startList(lb);
}
}, true);
super.startList(lb);
}
@Override
public void endList(final ListBlock lb) {
endContent(new Event(this) {
public void run() {
eventHandler.endList(lb);
}
});
super.endList(lb);
}
@Override
public void startListItem(final ListItem li) {
startContent(new Event(this) {
public void run() {
eventHandler.startListItem(li);
}
}, true);
super.startListItem(li);
}
@Override
public void endListItem(final ListItem li) {
endContent(new Event(this) {
public void run() {
eventHandler.endListItem(li);
}
});
super.endListItem(li);
}
@Override
public void startListLabel(final ListItemLabel listItemLabel) {
startContent(new Event(this) {
public void run() {
eventHandler.startListLabel(listItemLabel);
}
}, true);
super.startListLabel(listItemLabel);
}
@Override
public void endListLabel(final ListItemLabel listItemLabel) {
endContent(new Event(this) {
public void run() {
eventHandler.endListLabel(listItemLabel);
}
});
super.endListLabel(listItemLabel);
}
@Override
public void startListBody(final ListItemBody listItemBody) {
startContent(new Event(this) {
public void run() {
eventHandler.startListBody(listItemBody);
}
}, true);
super.startListBody(listItemBody);
}
@Override
public void endListBody(final ListItemBody listItemBody) {
endContent(new Event(this) {
public void run() {
eventHandler.endListBody(listItemBody);
}
});
super.endListBody(listItemBody);
}
@Override
public void startMarkup() {
startContent(new Event(this) {
public void run() {
eventHandler.startMarkup();
}
}, true);
super.startMarkup();
}
@Override
public void endMarkup() {
endContent(new Event(this) {
public void run() {
eventHandler.endMarkup();
}
});
super.endMarkup();
}
@Override
public void startLink(final BasicLink basicLink) {
startContent(new Event(this) {
public void run() {
eventHandler.startLink(basicLink);
}
}, true);
super.startLink(basicLink);
}
@Override
public void endLink(final BasicLink basicLink) {
endContent(new Event(this) {
public void run() {
eventHandler.endLink(basicLink);
}
});
super.endLink(basicLink);
}
@Override
public void image(final ExternalGraphic eg) {
handleStartArtifact(eg);
content(new Event(this) {
public void run() {
eventHandler.image(eg);
}
}, true);
super.image(eg);
handleEndArtifact(eg);
}
@Override
public void pageRef() {
content(new Event(this) {
public void run() {
eventHandler.pageRef();
}
}, true);
super.pageRef();
}
@Override
public void startInstreamForeignObject(final InstreamForeignObject ifo) {
handleStartArtifact(ifo);
startContent(new Event(this) {
public void run() {
eventHandler.startInstreamForeignObject(ifo);
}
}, true);
super.startInstreamForeignObject(ifo);
}
@Override
public void endInstreamForeignObject(final InstreamForeignObject ifo) {
endContent(new Event(this) {
public void run() {
eventHandler.endInstreamForeignObject(ifo);
}
});
handleEndArtifact(ifo);
super.endInstreamForeignObject(ifo);
}
@Override
public void startFootnote(final Footnote footnote) {
startContent(new Event(this) {
public void run() {
eventHandler.startFootnote(footnote);
}
}, true);
super.startFootnote(footnote);
}
@Override
public void endFootnote(final Footnote footnote) {
endContent(new Event(this) {
public void run() {
eventHandler.endFootnote(footnote);
}
});
super.endFootnote(footnote);
}
@Override
public void startFootnoteBody(final FootnoteBody body) {
startContent(new Event(this) {
public void run() {
eventHandler.startFootnoteBody(body);
}
}, true);
super.startFootnoteBody(body);
}
@Override
public void endFootnoteBody(final FootnoteBody body) {
endContent(new Event(this) {
public void run() {
eventHandler.endFootnoteBody(body);
}
});
super.endFootnoteBody(body);
}
@Override
public void startLeader(final Leader l) {
converters.push(converter);
converter = eventSwallower;
startContent(new Event(this) {
public void run() {
eventHandler.startLeader(l);
}
}, false);
super.startLeader(l);
}
@Override
public void endLeader(final Leader l) {
endContent(new Event(this) {
public void run() {
eventHandler.endLeader(l);
}
});
converter = converters.pop();
super.endLeader(l);
}
@Override
public void startWrapper(final Wrapper wrapper) {
handleStartArtifact(wrapper);
startContent(new Event(this) {
public void run() {
eventHandler.startWrapper(wrapper);
}
}, true);
super.startWrapper(wrapper);
}
@Override
public void endWrapper(final Wrapper wrapper) {
endContent(new Event(this) {
public void run() {
eventHandler.endWrapper(wrapper);
}
});
handleEndArtifact(wrapper);
super.endWrapper(wrapper);
}
@Override
public void startRetrieveMarker(final RetrieveMarker retrieveMarker) {
startContent(new Event(this) {
public void run() {
eventHandler.startRetrieveMarker(retrieveMarker);
}
}, true);
saveState(retrieveMarker);
super.startRetrieveMarker(retrieveMarker);
}
private void saveState(AbstractRetrieveMarker retrieveMarker) {
states.put(retrieveMarker, new State(this));
}
@Override
public void endRetrieveMarker(final RetrieveMarker retrieveMarker) {
endContent(new Event(this) {
public void run() {
eventHandler.endRetrieveMarker(retrieveMarker);
}
});
super.endRetrieveMarker(retrieveMarker);
}
@Override
public void restoreState(final RetrieveMarker retrieveMarker) {
restoreRetrieveMarkerState(retrieveMarker);
content(new Event(this) {
public void run() {
eventHandler.restoreState(retrieveMarker);
}
}, true);
super.restoreState(retrieveMarker);
}
@Override
public void endRestoreState(RetrieveMarker retrieveMarker) {
boolean isInsideArtifact = false;
FONode obj = retrieveMarker.getParent();
while (obj != null && !isInsideArtifact) {
if (obj instanceof CommonAccessibilityHolder && isArtifact((CommonAccessibilityHolder)obj)) {
isInsideArtifact = true;
} else {
obj = obj.getParent();
}
}
if (isInsideArtifact && !converters.isEmpty()) {
converter = converters.pop();
}
}
@SuppressWarnings("unchecked")
private void restoreRetrieveMarkerState(AbstractRetrieveMarker retrieveMarker) {
State state = states.get(retrieveMarker);
this.converter = state.converter;
this.converters = (Stack<FOEventHandler>) state.converters.clone();
}
@Override
public void startRetrieveTableMarker(final RetrieveTableMarker retrieveTableMarker) {
startContent(new Event(this) {
public void run() {
eventHandler.startRetrieveTableMarker(retrieveTableMarker);
}
}, true);
saveState(retrieveTableMarker);
super.startRetrieveTableMarker(retrieveTableMarker);
}
@Override
public void endRetrieveTableMarker(final RetrieveTableMarker retrieveTableMarker) {
endContent(new Event(this) {
public void run() {
eventHandler.endRetrieveTableMarker(retrieveTableMarker);
}
});
super.endRetrieveTableMarker(retrieveTableMarker);
}
@Override
public void restoreState(final RetrieveTableMarker retrieveTableMarker) {
restoreRetrieveMarkerState(retrieveTableMarker);
currentNode.add(new Event(this) {
public void run() {
eventHandler.restoreState(retrieveTableMarker);
}
});
super.restoreState(retrieveTableMarker);
}
@Override
public void character(final Character c) {
content(new Event(this) {
public void run() {
eventHandler.character(c);
}
}, true);
super.character(c);
}
@Override
public void characters(final FOText foText) {
content(new Event(this) {
public void run() {
eventHandler.characters(foText);
}
}, foText.length() > 0);
super.characters(foText);
}
@Override
public void startExternalDocument(final ExternalDocument document) {
startContent(new Event(this) {
public void run() {
eventHandler.startExternalDocument(document);
}
}, true);
super.startExternalDocument(document);
}
@Override
public void endExternalDocument(final ExternalDocument document) {
endContent(new Event(this) {
public void run() {
eventHandler.endExternalDocument(document);
}
});
super.endExternalDocument(document);
}
private void handleStartArtifact(CommonAccessibilityHolder fobj) {
if (isArtifact(fobj)) {
converters.push(converter);
converter = eventSwallower;
}
}
private void handleEndArtifact(CommonAccessibilityHolder fobj) {
if (isArtifact(fobj)) {
converter = converters.pop();
}
}
private boolean isArtifact(CommonAccessibilityHolder fobj) {
CommonAccessibility accessibility = fobj.getCommonAccessibility();
return Accessibility.ROLE_ARTIFACT.equalsIgnoreCase(accessibility.getRole());
}
}
@@ -0,0 +1,585 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.accessibility.fo;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.Stack;
import javax.xml.XMLConstants;
import org.xml.sax.helpers.AttributesImpl;
import org.apache.fop.accessibility.StructureTreeElement;
import org.apache.fop.accessibility.StructureTreeEventHandler;
import org.apache.fop.fo.FOEventHandler;
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FOText;
import org.apache.fop.fo.FObj;
import org.apache.fop.fo.extensions.ExtensionElementMapping;
import org.apache.fop.fo.extensions.ExternalDocument;
import org.apache.fop.fo.extensions.InternalElementMapping;
import org.apache.fop.fo.flow.AbstractRetrieveMarker;
import org.apache.fop.fo.flow.BasicLink;
import org.apache.fop.fo.flow.Block;
import org.apache.fop.fo.flow.BlockContainer;
import org.apache.fop.fo.flow.Character;
import org.apache.fop.fo.flow.ExternalGraphic;
import org.apache.fop.fo.flow.Footnote;
import org.apache.fop.fo.flow.FootnoteBody;
import org.apache.fop.fo.flow.Inline;
import org.apache.fop.fo.flow.InstreamForeignObject;
import org.apache.fop.fo.flow.ListBlock;
import org.apache.fop.fo.flow.ListItem;
import org.apache.fop.fo.flow.ListItemBody;
import org.apache.fop.fo.flow.ListItemLabel;
import org.apache.fop.fo.flow.PageNumber;
import org.apache.fop.fo.flow.PageNumberCitation;
import org.apache.fop.fo.flow.PageNumberCitationLast;
import org.apache.fop.fo.flow.RetrieveMarker;
import org.apache.fop.fo.flow.RetrieveTableMarker;
import org.apache.fop.fo.flow.Wrapper;
import org.apache.fop.fo.flow.table.Table;
import org.apache.fop.fo.flow.table.TableBody;
import org.apache.fop.fo.flow.table.TableCaption;
import org.apache.fop.fo.flow.table.TableCell;
import org.apache.fop.fo.flow.table.TableFooter;
import org.apache.fop.fo.flow.table.TableHeader;
import org.apache.fop.fo.flow.table.TableRow;
import org.apache.fop.fo.pagination.Flow;
import org.apache.fop.fo.pagination.LayoutMasterSet;
import org.apache.fop.fo.pagination.PageSequence;
import org.apache.fop.fo.pagination.Root;
import org.apache.fop.fo.pagination.StaticContent;
import org.apache.fop.fo.properties.CommonAccessibilityHolder;
import org.apache.fop.fo.properties.CommonHyphenation;
import org.apache.fop.util.LanguageTags;
import org.apache.fop.util.XMLUtil;
/**
* A bridge between {@link FOEventHandler} and {@link StructureTreeEventHandler}.
*/
class StructureTreeEventTrigger extends FOEventHandler {
private StructureTreeEventHandler structureTreeEventHandler;
private LayoutMasterSet layoutMasterSet;
private Stack<Table> tables = new Stack<Table>();
private Stack<Boolean> inTableHeader = new Stack<Boolean>();
private Stack<Locale> locales = new Stack<Locale>();
private final Map<AbstractRetrieveMarker, State> states = new HashMap<AbstractRetrieveMarker, State>();
private static final class State {
private final Stack<Table> tables;
private final Stack<Boolean> inTableHeader;
private final Stack<Locale> locales;
@SuppressWarnings("unchecked")
State(StructureTreeEventTrigger o) {
this.tables = (Stack<Table>) o.tables.clone();
this.inTableHeader = (Stack<Boolean>) o.inTableHeader.clone();
this.locales = (Stack<Locale>) o.locales.clone();
}
}
public StructureTreeEventTrigger(StructureTreeEventHandler structureTreeEventHandler) {
this.structureTreeEventHandler = structureTreeEventHandler;
}
@Override
public void startRoot(Root root) {
locales.push(root.getLocale());
}
@Override
public void endRoot(Root root) {
locales.pop();
}
@Override
public void startPageSequence(PageSequence pageSeq) {
if (layoutMasterSet == null) {
layoutMasterSet = pageSeq.getRoot().getLayoutMasterSet();
}
Locale locale = pageSeq.getLocale();
if (locale != null) {
locales.push(locale);
} else {
locales.push(locales.peek());
}
String role = pageSeq.getCommonAccessibility().getRole();
structureTreeEventHandler.startPageSequence(locale, role);
}
@Override
public void endPageSequence(PageSequence pageSeq) {
structureTreeEventHandler.endPageSequence();
locales.pop();
}
@Override
public void startPageNumber(PageNumber pagenum) {
startElementWithID(pagenum);
}
@Override
public void endPageNumber(PageNumber pagenum) {
endElement(pagenum);
}
@Override
public void startPageNumberCitation(PageNumberCitation pageCite) {
startElementWithID(pageCite);
}
@Override
public void endPageNumberCitation(PageNumberCitation pageCite) {
endElement(pageCite);
}
@Override
public void startPageNumberCitationLast(PageNumberCitationLast pageLast) {
startElementWithID(pageLast);
}
@Override
public void endPageNumberCitationLast(PageNumberCitationLast pageLast) {
endElement(pageLast);
}
@Override
public void startStatic(StaticContent staticContent) {
AttributesImpl flowName = createFlowNameAttribute(staticContent.getFlowName());
startElement(staticContent, flowName);
}
private AttributesImpl createFlowNameAttribute(String flowName) {
String regionName = layoutMasterSet.getDefaultRegionNameFor(flowName);
AttributesImpl attribute = new AttributesImpl();
addNoNamespaceAttribute(attribute, Flow.FLOW_NAME, regionName);
return attribute;
}
@Override
public void endStatic(StaticContent staticContent) {
endElement(staticContent);
}
@Override
public void startFlow(Flow fl) {
AttributesImpl flowName = createFlowNameAttribute(fl.getFlowName());
startElement(fl, flowName);
}
@Override
public void endFlow(Flow fl) {
endElement(fl);
}
@Override
public void startBlock(Block bl) {
CommonHyphenation hyphProperties = bl.getCommonHyphenation();
AttributesImpl attributes = createLangAttribute(hyphProperties);
startElement(bl, attributes);
}
private AttributesImpl createLangAttribute(CommonHyphenation hyphProperties) {
Locale locale = hyphProperties.getLocale();
AttributesImpl attributes = new AttributesImpl();
if (locale == null || locale.equals(locales.peek())) {
locales.push(locales.peek());
} else {
locales.push(locale);
addAttribute(attributes, XMLConstants.XML_NS_URI, "lang", "xml",
LanguageTags.toLanguageTag(locale));
}
return attributes;
}
@Override
public void endBlock(Block bl) {
endElement(bl);
locales.pop();
}
@Override
public void startBlockContainer(BlockContainer blc) {
startElement(blc);
}
@Override
public void endBlockContainer(BlockContainer blc) {
endElement(blc);
}
@Override
public void startInline(Inline inl) {
startElement(inl);
}
@Override
public void endInline(Inline inl) {
endElement(inl);
}
@Override
public void startTable(Table tbl) {
tables.push(tbl);
startElement(tbl);
}
@Override
public void endTable(Table tbl) {
endElement(tbl);
tables.pop();
}
public void startTableCaption(TableCaption tableCaption) {
startElement(tableCaption);
}
public void endTableCaption(TableCaption tableCaption) {
endElement(tableCaption);
}
@Override
public void startHeader(TableHeader header) {
inTableHeader.push(Boolean.TRUE);
startElement(header);
}
@Override
public void endHeader(TableHeader header) {
endElement(header);
inTableHeader.pop();
}
@Override
public void startFooter(TableFooter footer) {
// TODO Shouldn't it be true?
inTableHeader.push(Boolean.FALSE);
startElement(footer);
}
@Override
public void endFooter(TableFooter footer) {
endElement(footer);
inTableHeader.pop();
}
@Override
public void startBody(TableBody body) {
inTableHeader.push(Boolean.FALSE);
startElement(body);
}
@Override
public void endBody(TableBody body) {
endElement(body);
inTableHeader.pop();
}
@Override
public void startRow(TableRow tr) {
startElement(tr);
}
@Override
public void endRow(TableRow tr) {
endElement(tr);
}
@Override
public void startCell(TableCell tc) {
AttributesImpl attributes = new AttributesImpl();
addSpanAttribute(attributes, "number-columns-spanned", tc.getNumberColumnsSpanned());
addSpanAttribute(attributes, "number-rows-spanned", tc.getNumberRowsSpanned());
boolean rowHeader = inTableHeader.peek();
boolean columnHeader = tables.peek().getColumn(tc.getColumnNumber() - 1).isHeader();
if (rowHeader || columnHeader) {
final String th = "TH";
String role = tc.getCommonAccessibility().getRole();
/* Do not override a custom role */
if (role == null) {
role = th;
addNoNamespaceAttribute(attributes, "role", th);
}
if (role.equals(th)) {
if (columnHeader) {
String scope = rowHeader ? "Both" : "Row";
addAttribute(attributes, InternalElementMapping.URI, InternalElementMapping.SCOPE,
InternalElementMapping.STANDARD_PREFIX, scope);
}
}
}
startElement(tc, attributes);
}
private void addSpanAttribute(AttributesImpl attributes, String attributeName, int span) {
if (span > 1) {
addNoNamespaceAttribute(attributes, attributeName, Integer.toString(span));
}
}
@Override
public void endCell(TableCell tc) {
endElement(tc);
}
@Override
public void startList(ListBlock lb) {
startElement(lb);
}
@Override
public void endList(ListBlock lb) {
endElement(lb);
}
@Override
public void startListItem(ListItem li) {
startElement(li);
}
@Override
public void endListItem(ListItem li) {
endElement(li);
}
@Override
public void startListLabel(ListItemLabel listItemLabel) {
startElement(listItemLabel);
}
@Override
public void endListLabel(ListItemLabel listItemLabel) {
endElement(listItemLabel);
}
@Override
public void startListBody(ListItemBody listItemBody) {
startElement(listItemBody);
}
@Override
public void endListBody(ListItemBody listItemBody) {
endElement(listItemBody);
}
@Override
public void startLink(BasicLink basicLink) {
startElementWithIDAndAltText(basicLink, basicLink.getAltText());
}
@Override
public void endLink(BasicLink basicLink) {
endElement(basicLink);
}
@Override
public void image(ExternalGraphic eg) {
startElementWithIDAndAltText(eg, eg.getAltText());
endElement(eg);
}
@Override
public void startExternalDocument(ExternalDocument externalDocument) {
startElementWithIDAndAltText(externalDocument, null);
endElement(externalDocument);
}
@Override
public void startInstreamForeignObject(InstreamForeignObject ifo) {
startElementWithIDAndAltText(ifo, ifo.getAltText());
}
@Override
public void endInstreamForeignObject(InstreamForeignObject ifo) {
endElement(ifo);
}
@Override
public void startFootnote(Footnote footnote) {
startElement(footnote);
}
@Override
public void endFootnote(Footnote footnote) {
endElement(footnote);
}
@Override
public void startFootnoteBody(FootnoteBody body) {
startElement(body);
}
@Override
public void endFootnoteBody(FootnoteBody body) {
endElement(body);
}
@Override
public void startWrapper(Wrapper wrapper) {
startElement(wrapper);
}
@Override
public void endWrapper(Wrapper wrapper) {
endElement(wrapper);
}
@Override
public void startRetrieveMarker(RetrieveMarker retrieveMarker) {
startElementWithID(retrieveMarker);
saveState(retrieveMarker);
}
void saveState(AbstractRetrieveMarker retrieveMarker) {
states.put(retrieveMarker, new State(this));
}
@Override
public void endRetrieveMarker(RetrieveMarker retrieveMarker) {
endElement(retrieveMarker);
}
@Override
public void restoreState(RetrieveMarker retrieveMarker) {
restoreRetrieveMarkerState(retrieveMarker);
}
@SuppressWarnings("unchecked")
private void restoreRetrieveMarkerState(AbstractRetrieveMarker retrieveMarker) {
State state = states.get(retrieveMarker);
tables = (Stack<Table>) state.tables.clone();
inTableHeader = (Stack<Boolean>) state.inTableHeader.clone();
locales = (Stack<Locale>) state.locales.clone();
}
@Override
public void startRetrieveTableMarker(RetrieveTableMarker retrieveTableMarker) {
startElementWithID(retrieveTableMarker);
saveState(retrieveTableMarker);
}
@Override
public void endRetrieveTableMarker(RetrieveTableMarker retrieveTableMarker) {
endElement(retrieveTableMarker);
}
@Override
public void restoreState(RetrieveTableMarker retrieveTableMarker) {
restoreRetrieveMarkerState(retrieveTableMarker);
}
@Override
public void character(Character c) {
AttributesImpl attributes = createLangAttribute(c.getCommonHyphenation());
startElementWithID(c, attributes);
endElement(c);
locales.pop();
}
@Override
public void characters(FOText foText) {
startElementWithID(foText);
endElement(foText);
}
private StructureTreeElement startElement(FONode node) {
AttributesImpl attributes = new AttributesImpl();
if (node instanceof Inline) {
Inline in = (Inline)node;
if (!in.getAbbreviation().equals("")) {
addAttribute(attributes, ExtensionElementMapping.URI, "abbreviation",
ExtensionElementMapping.STANDARD_PREFIX, in.getAbbreviation());
}
}
return startElement(node, attributes);
}
private void startElementWithID(FONode node) {
startElementWithID(node, new AttributesImpl());
}
private void startElementWithID(FONode node, AttributesImpl attributes) {
String localName = node.getLocalName();
if (node instanceof CommonAccessibilityHolder) {
addRole((CommonAccessibilityHolder) node, attributes);
}
node.setStructureTreeElement(
structureTreeEventHandler.startReferencedNode(localName, attributes,
node.getParent().getStructureTreeElement()));
}
private void startElementWithIDAndAltText(FObj node, String altText) {
AttributesImpl attributes = new AttributesImpl();
String localName = node.getLocalName();
addRole((CommonAccessibilityHolder)node, attributes);
addAttribute(attributes, ExtensionElementMapping.URI, "alt-text",
ExtensionElementMapping.STANDARD_PREFIX, altText);
node.setStructureTreeElement(
structureTreeEventHandler.startImageNode(localName, attributes,
node.getParent().getStructureTreeElement()));
}
private StructureTreeElement startElement(FONode node, AttributesImpl attributes) {
String localName = node.getLocalName();
if (node instanceof CommonAccessibilityHolder) {
addRole((CommonAccessibilityHolder) node, attributes);
}
return structureTreeEventHandler.startNode(localName, attributes,
node.getParent().getStructureTreeElement());
}
private void addNoNamespaceAttribute(AttributesImpl attributes, String name, String value) {
attributes.addAttribute("", name, name, XMLUtil.CDATA, value);
}
private void addAttribute(AttributesImpl attributes,
String namespace, String localName, String prefix, String value) {
assert namespace.length() > 0 && prefix.length() > 0;
String qualifiedName = prefix + ":" + localName;
attributes.addAttribute(namespace, localName, qualifiedName, XMLUtil.CDATA, value);
}
private void addRole(CommonAccessibilityHolder node, AttributesImpl attributes) {
String role = node.getCommonAccessibility().getRole();
if (role != null) {
addNoNamespaceAttribute(attributes, "role", role);
}
}
private void endElement(FONode node) {
String localName = node.getLocalName();
structureTreeEventHandler.endNode(localName);
}
}
@@ -0,0 +1,48 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id: Accessibility.java 1343632 2012-05-29 09:48:03Z vhennebert $ */
package org.apache.fop.activity;
import org.apache.fop.configuration.Configurable;
import org.apache.fop.configuration.Configuration;
import org.apache.fop.configuration.ConfigurationException;
public final class ContainerUtil {
private ContainerUtil() {
// Never invoked.
}
public static void configure(Configurable configurable, Configuration configuration) {
try {
configurable.configure(configuration);
} catch (ConfigurationException e) {
e.printStackTrace();
throw new IllegalStateException(e);
}
}
public static void initialize(Initializable initializable) {
try {
initializable.initialize();
} catch (Exception e) {
e.printStackTrace();
throw new IllegalStateException(e);
}
}
}
@@ -0,0 +1,24 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id: Accessibility.java 1343632 2012-05-29 09:48:03Z vhennebert $ */
package org.apache.fop.activity;
public interface Initializable {
void initialize() throws Exception;
}
@@ -0,0 +1,241 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.afp;
import java.awt.geom.AffineTransform;
import org.apache.fop.fo.Constants;
import org.apache.fop.render.intermediate.BorderPainter;
import org.apache.fop.util.ColorUtil;
/**
* Handles the drawing of borders/lines in AFP
*/
public class AFPBorderPainter extends AbstractAFPPainter {
/**
* Main constructor
*
* @param paintingState the AFP painting state converter
* @param dataStream the AFP datastream
*/
public AFPBorderPainter(AFPPaintingState paintingState, DataStream dataStream) {
super(paintingState, dataStream);
}
/** {@inheritDoc} */
public void paint(PaintingInfo paintInfo) {
Integer bytesAvailable = dataStream.getCurrentPage().getPresentationTextObject().getBytesAvailable();
if (bytesAvailable != null && bytesAvailable < 1024) {
dataStream.getCurrentPage().endPresentationObject();
}
BorderPaintingInfo borderPaintInfo = (BorderPaintingInfo)paintInfo;
float w = borderPaintInfo.getX2() - borderPaintInfo.getX1();
float h = borderPaintInfo.getY2() - borderPaintInfo.getY1();
if ((w < 0) || (h < 0)) {
log.error("Negative extent received. Border won't be painted.");
return;
}
int pageWidth = dataStream.getCurrentPage().getWidth();
int pageHeight = dataStream.getCurrentPage().getHeight();
AFPUnitConverter unitConv = paintingState.getUnitConverter();
AffineTransform at = paintingState.getData().getTransform();
float x1 = unitConv.pt2units(borderPaintInfo.getX1());
float y1 = unitConv.pt2units(borderPaintInfo.getY1());
float x2 = unitConv.pt2units(borderPaintInfo.getX2());
float y2 = unitConv.pt2units(borderPaintInfo.getY2());
switch (paintingState.getRotation()) {
case 90:
x1 += at.getTranslateY();
y1 += (float) (pageWidth - at.getTranslateX());
x2 += at.getTranslateY();
y2 += (float) (pageWidth - at.getTranslateX());
break;
case 180:
x1 += (float) (pageWidth - at.getTranslateX());
y1 += (float) (pageHeight - at.getTranslateY());
x2 += (float) (pageWidth - at.getTranslateX());
y2 += (float) (pageHeight - at.getTranslateY());
break;
case 270:
x1 = (float) (pageHeight - at.getTranslateY());
y1 += (float) at.getTranslateX();
x2 += x1;
y2 += (float) at.getTranslateX();
break;
case 0:
default:
x1 += at.getTranslateX();
y1 += at.getTranslateY();
x2 += at.getTranslateX();
y2 += at.getTranslateY();
break;
}
AFPLineDataInfo lineDataInfo = new AFPLineDataInfo();
lineDataInfo.setColor(borderPaintInfo.getColor());
lineDataInfo.setRotation(paintingState.getRotation());
lineDataInfo.setX1(Math.round(x1));
lineDataInfo.setY1(Math.round(y1));
float thickness;
if (borderPaintInfo.isHorizontal()) {
thickness = y2 - y1;
} else {
thickness = x2 - x1;
}
lineDataInfo.setThickness(Math.round(thickness));
// handle border-*-style
int styleSpaceWidth = Math.round(unitConv.mpt2units(borderPaintInfo.getStyle().getSpaceWidth()));
switch (borderPaintInfo.getStyle().getEnumValue()) {
case Constants.EN_DOUBLE:
int thickness3 = (int)Math.floor(thickness / 3f);
lineDataInfo.setThickness(thickness3);
if (borderPaintInfo.isHorizontal()) {
lineDataInfo.setX2(Math.round(x2));
lineDataInfo.setY2(lineDataInfo.getY1());
dataStream.createLine(lineDataInfo);
int distance = thickness3 * 2;
lineDataInfo = new AFPLineDataInfo(lineDataInfo);
lineDataInfo.setY1(lineDataInfo.getY1() + distance);
lineDataInfo.setY2(lineDataInfo.getY2() + distance);
dataStream.createLine(lineDataInfo);
} else {
lineDataInfo.setX2(lineDataInfo.getX1());
lineDataInfo.setY2(Math.round(y2));
dataStream.createLine(lineDataInfo);
int distance = thickness3 * 2;
lineDataInfo = new AFPLineDataInfo(lineDataInfo);
lineDataInfo.setX1(lineDataInfo.getX1() + distance);
lineDataInfo.setX2(lineDataInfo.getX2() + distance);
dataStream.createLine(lineDataInfo);
}
break;
case Constants.EN_DASHED:
if (borderPaintInfo.isHorizontal()) {
int dashWidth = (int) unitConv.pt2units(BorderPainter.dashWidthCalculator(w, h));
lineDataInfo.setX2(lineDataInfo.getX1() + dashWidth);
lineDataInfo.setY2(lineDataInfo.getY1());
int ex2 = Math.round(x2);
int spaceWidth = (int) (BorderPainter.DASHED_BORDER_SPACE_RATIO * dashWidth);
if (styleSpaceWidth > 0) {
spaceWidth = styleSpaceWidth;
}
while (lineDataInfo.getX2() <= ex2 && dashWidth > 0) {
dataStream.createLine(lineDataInfo);
lineDataInfo.setX1(lineDataInfo.getX2() + spaceWidth);
lineDataInfo.setX2(lineDataInfo.getX1() + dashWidth);
}
} else {
int dashWidth = (int) unitConv.pt2units(BorderPainter.dashWidthCalculator(h, w));
lineDataInfo.setX2(lineDataInfo.getX1());
lineDataInfo.setY2(lineDataInfo.getY1() + dashWidth);
int ey2 = Math.round(y2);
int spaceWidth = (int) (BorderPainter.DASHED_BORDER_SPACE_RATIO * dashWidth);
if (styleSpaceWidth > 0) {
spaceWidth = styleSpaceWidth;
}
while (lineDataInfo.getY2() <= ey2 && dashWidth > 0) {
dataStream.createLine(lineDataInfo);
lineDataInfo.setY1(lineDataInfo.getY2() + spaceWidth);
lineDataInfo.setY2(lineDataInfo.getY1() + dashWidth);
}
}
break;
case Constants.EN_DOTTED:
case Constants.EN_SQUARE:
if (borderPaintInfo.isHorizontal()) {
lineDataInfo.setX2(lineDataInfo.getX1() + lineDataInfo.getThickness());
lineDataInfo.setY2(lineDataInfo.getY1());
int ex2 = Math.round(x2);
int spaceWidth = lineDataInfo.getThickness() * 3;
if (styleSpaceWidth > 0) {
spaceWidth = styleSpaceWidth;
}
while (lineDataInfo.getX1() + lineDataInfo.getThickness() < ex2) {
dataStream.createLine(lineDataInfo);
lineDataInfo.setX1(lineDataInfo.getX1() + spaceWidth);
lineDataInfo.setX2(lineDataInfo.getX1() + lineDataInfo.getThickness());
}
} else {
lineDataInfo.setX2(lineDataInfo.getX1());
lineDataInfo.setY2(lineDataInfo.getY1() + lineDataInfo.getThickness());
int ey2 = Math.round(y2);
int spaceWidth = lineDataInfo.getThickness() * 3;
if (styleSpaceWidth > 0) {
spaceWidth = styleSpaceWidth;
}
while (lineDataInfo.getY1() + lineDataInfo.getThickness() < ey2) {
dataStream.createLine(lineDataInfo);
lineDataInfo.setY1(lineDataInfo.getY1() + spaceWidth);
lineDataInfo.setY2(lineDataInfo.getY1() + lineDataInfo.getThickness());
}
}
break;
case Constants.EN_GROOVE:
case Constants.EN_RIDGE:
//TODO
int yNew;
lineDataInfo.setX2(Math.round(x2));
float colFactor = (borderPaintInfo.getStyle().getEnumValue() == Constants.EN_GROOVE ? 0.4f : -0.4f);
float h3 = (y2 - y1) / 3;
lineDataInfo.setColor(
ColorUtil.lightenColor(borderPaintInfo.getColor(), -colFactor));
lineDataInfo.setThickness(Math.round(h3));
yNew = Math.round(y1);
lineDataInfo.setY1(yNew);
lineDataInfo.setY2(yNew);
dataStream.createLine(lineDataInfo);
lineDataInfo.setColor(borderPaintInfo.getColor());
yNew = Math.round(y1 + h3);
lineDataInfo.setY1(yNew);
lineDataInfo.setY2(yNew);
dataStream.createLine(lineDataInfo);
lineDataInfo.setColor(ColorUtil.lightenColor(borderPaintInfo.getColor(), colFactor));
yNew = Math.round(y1 + h3 + h3);
lineDataInfo.setY1(yNew);
lineDataInfo.setY2(yNew);
dataStream.createLine(lineDataInfo);
break;
case Constants.EN_HIDDEN:
break;
case Constants.EN_INSET:
case Constants.EN_OUTSET:
case Constants.EN_SOLID:
default:
if (borderPaintInfo.isHorizontal()) {
lineDataInfo.setX2(Math.round(x2));
lineDataInfo.setY2(lineDataInfo.getY1());
} else {
lineDataInfo.setX2(lineDataInfo.getX1());
lineDataInfo.setY2(Math.round(y2));
}
dataStream.createLine(lineDataInfo);
}
}
}
@@ -0,0 +1,64 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.afp;
/**
* Constants used by the AFP renderer.
*
*/
public interface AFPConstants {
/**
* The encoding to use to convert to EBCIDIC
*/
String EBCIDIC_ENCODING = "Cp1146";
/**
* The encoding to use to convert to ASCII
*/
String ASCII_ENCODING = "Cp1252";
/**
* The encoding to use to convert to US ASCII (7 bit)
*/
String US_ASCII_ENCODING = "US-ASCII";
/**
* The scaling of the default transform is set to
* approximately 72 user space coordinates per square inch
*/
int DPI_72 = 72;
/**
* 72dpi in millipoints
*/
int DPI_72_MPTS = DPI_72 * 1000;
/**
* The line width is set as a multiplier of a default line with; the width of the default
* line width is implementation defined, which probably means different devices use different
* actual widths; this means that the source line width (as specified in, say, a SVG line
* element) needs to be corrected by a fudge factor that depends on the output device so that
* the final output (print to paper, screen viewer) looks as intended.
*/
float LINE_WIDTH_CORRECTION = 2.5f;
}
@@ -0,0 +1,308 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.afp;
import java.awt.geom.Rectangle2D;
import org.apache.xmlgraphics.image.codec.tiff.TIFFImage;
import org.apache.xmlgraphics.java2d.Graphics2DImagePainter;
import org.apache.fop.afp.ioca.IDEStructureParameter;
import org.apache.fop.afp.ioca.ImageContent;
import org.apache.fop.afp.modca.AbstractDataObject;
import org.apache.fop.afp.modca.AbstractNamedAFPObject;
import org.apache.fop.afp.modca.Document;
import org.apache.fop.afp.modca.GraphicsObject;
import org.apache.fop.afp.modca.ImageObject;
import org.apache.fop.afp.modca.IncludeObject;
import org.apache.fop.afp.modca.ObjectContainer;
import org.apache.fop.afp.modca.Overlay;
import org.apache.fop.afp.modca.PageSegment;
import org.apache.fop.afp.modca.Registry;
import org.apache.fop.afp.modca.ResourceObject;
import org.apache.fop.afp.modca.triplets.MappingOptionTriplet;
import org.apache.fop.afp.modca.triplets.ObjectClassificationTriplet;
/**
* Factory for high level data objects (Image/Graphics etc)
*/
public class AFPDataObjectFactory {
private final Factory factory;
/**
* Main constructor
*
* @param factory an object factory
*/
public AFPDataObjectFactory(Factory factory) {
this.factory = factory;
}
/**
* Creates and configures an ObjectContainer.
*
* @param dataObjectInfo the object container info
* @return a newly created Object Container
*/
public ObjectContainer createObjectContainer(AFPDataObjectInfo dataObjectInfo) {
ObjectContainer objectContainer = factory.createObjectContainer();
// set data object viewport (i.e. position, rotation, dimension, resolution)
objectContainer.setViewport(dataObjectInfo);
// set object classification
Registry.ObjectType objectType = dataObjectInfo.getObjectType();
AFPResourceInfo resourceInfo = dataObjectInfo.getResourceInfo();
AFPResourceLevel resourceLevel = resourceInfo.getLevel();
final boolean dataInContainer = true;
final boolean containerHasOEG = dataObjectInfo.isMetadataInObjectContainer() || resourceLevel.isInline();
final boolean dataInOCD = true;
objectContainer.setObjectClassification(
ObjectClassificationTriplet.CLASS_TIME_INVARIANT_PAGINATED_PRESENTATION_OBJECT,
objectType, dataInContainer, containerHasOEG, dataInOCD);
objectContainer.setData(dataObjectInfo.getData());
return objectContainer;
}
/**
* Creates and configures an IOCA Image Object.
*
* @param imageObjectInfo the image object info
* @return a newly created IOCA Image Object
*/
public ImageObject createImage(AFPImageObjectInfo imageObjectInfo) {
// IOCA bitmap image
ImageObject imageObj = factory.createImageObject();
// set data object viewport (i.e. position, rotation, dimension, resolution)
imageObj.setViewport(imageObjectInfo);
if (imageObjectInfo.hasCompression()) {
int compression = imageObjectInfo.getCompression();
switch (compression) {
case TIFFImage.COMP_FAX_G3_1D:
imageObj.setEncoding(ImageContent.COMPID_G3_MH);
break;
case TIFFImage.COMP_FAX_G3_2D:
imageObj.setEncoding(ImageContent.COMPID_G3_MR);
break;
case TIFFImage.COMP_FAX_G4_2D:
imageObj.setEncoding(ImageContent.COMPID_G3_MMR);
break;
case ImageContent.COMPID_JPEG:
imageObj.setEncoding((byte)compression);
break;
default:
throw new IllegalStateException(
"Invalid compression scheme: " + compression);
}
}
ImageContent content = imageObj.getImageSegment().getImageContent();
int bitsPerPixel = imageObjectInfo.getBitsPerPixel();
imageObj.setIDESize((byte) bitsPerPixel);
IDEStructureParameter ideStruct;
switch (bitsPerPixel) {
case 1:
//Skip IDE Structure Parameter
break;
case 4:
case 8:
//A grayscale image
ideStruct = content.needIDEStructureParameter();
ideStruct.setBitsPerComponent(new int[] {bitsPerPixel});
ideStruct.setColorModel(IDEStructureParameter.COLOR_MODEL_YCBCR);
break;
case 24:
ideStruct = content.needIDEStructureParameter();
ideStruct.setDefaultRGBColorModel();
break;
case 32:
ideStruct = content.needIDEStructureParameter();
ideStruct.setDefaultCMYKColorModel();
break;
default:
throw new IllegalArgumentException("Unsupported number of bits per pixel: "
+ bitsPerPixel);
}
if (bitsPerPixel > 1 && imageObjectInfo.isSubtractive()) {
ideStruct = content.needIDEStructureParameter();
ideStruct.setSubtractive(imageObjectInfo.isSubtractive());
}
imageObj.setData(imageObjectInfo.getData());
imageObj.setTransparencyMask(imageObjectInfo.getTransparencyMask());
return imageObj;
}
/**
* Creates and returns a new graphics object.
*
* @param graphicsObjectInfo the graphics object info
* @return a new graphics object
*/
public GraphicsObject createGraphic(AFPGraphicsObjectInfo graphicsObjectInfo) {
// set newly created graphics object in g2d
GraphicsObject graphicsObj = factory.createGraphicsObject();
// set data object viewport (i.e. position, rotation, dimension, resolution)
graphicsObj.setViewport(graphicsObjectInfo);
AFPGraphics2D g2d = graphicsObjectInfo.getGraphics2D();
g2d.setGraphicsObject(graphicsObj);
//set color converter (i.e. an rgb to grayscale converter)
graphicsObj.setColorConverter(g2d.getPaintingState().getColorConverter());
// paint to graphics object
Graphics2DImagePainter painter = graphicsObjectInfo.getPainter();
Rectangle2D area = graphicsObjectInfo.getArea();
g2d.scale(1, -1);
g2d.translate(0, -area.getHeight());
painter.paint(g2d, area);
graphicsObj.setComplete(true);
// return painted graphics object
return graphicsObj;
}
/**
* Creates and returns a new include object.
*
* @param includeName the include name
* @param dataObjectInfo a data object info
*
* @return a new include object
*/
public IncludeObject createInclude(String includeName, AFPDataObjectInfo dataObjectInfo) {
IncludeObject includeObj = factory.createInclude(includeName);
if (dataObjectInfo.isUseIocaImages() && dataObjectInfo instanceof AFPImageObjectInfo) {
// IOCA image object
includeObj.setObjectType(IncludeObject.TYPE_IMAGE);
} else if (dataObjectInfo instanceof AFPGraphicsObjectInfo) {
// graphics object
includeObj.setObjectType(IncludeObject.TYPE_GRAPHIC);
} else {
// object container
includeObj.setObjectType(IncludeObject.TYPE_OTHER);
// set mandatory object classification (type other)
Registry.ObjectType objectType = dataObjectInfo.getObjectType();
if (objectType != null) {
// set object classification
final boolean dataInContainer = true;
final boolean containerHasOEG = dataObjectInfo.isMetadataInObjectContainer();
final boolean dataInOCD = true;
includeObj.setObjectClassification(
// object scope not defined
ObjectClassificationTriplet.CLASS_TIME_VARIANT_PRESENTATION_OBJECT,
objectType, dataInContainer, containerHasOEG, dataInOCD);
} else {
throw new IllegalStateException(
"Failed to set Object Classification Triplet on Object Container.");
}
}
AFPObjectAreaInfo objectAreaInfo = dataObjectInfo.getObjectAreaInfo();
int xOffset = objectAreaInfo.getX();
int yOffset = objectAreaInfo.getY();
includeObj.setObjectAreaOffset(xOffset, yOffset);
int rotation = objectAreaInfo.getRotation();
includeObj.setObjectAreaOrientation(rotation);
if (!dataObjectInfo.isMetadataInObjectContainer()) {
int width = objectAreaInfo.getWidth();
int height = objectAreaInfo.getHeight();
includeObj.setObjectAreaSize(width, height);
int widthRes = objectAreaInfo.getWidthRes();
int heightRes = objectAreaInfo.getHeightRes();
includeObj.setMeasurementUnits(widthRes, heightRes);
includeObj.setMappingOption(MappingOptionTriplet.SCALE_TO_FIT);
}
return includeObj;
}
/**
* Creates a resource object wrapper for named includable data objects
*
* @param namedObj an named object
* @param resourceInfo resource information
* @param objectType the object type
* @param dataObjectInfo
* @return a new resource object wrapper
*/
public ResourceObject createResource(AbstractNamedAFPObject namedObj, AFPResourceInfo resourceInfo,
Registry.ObjectType objectType, AFPDataObjectInfo dataObjectInfo) {
ResourceObject resourceObj = null;
String resourceName = resourceInfo.getName();
if (resourceName != null) {
resourceObj = factory.createResource(resourceName);
} else {
resourceObj = factory.createResource();
}
if (namedObj instanceof Document) {
resourceObj.setType(ResourceObject.TYPE_DOCUMENT);
} else if (namedObj instanceof PageSegment) {
resourceObj.setType(ResourceObject.TYPE_PAGE_SEGMENT);
} else if (namedObj instanceof Overlay) {
resourceObj.setType(ResourceObject.TYPE_OVERLAY_OBJECT);
} else if (namedObj instanceof AbstractDataObject) {
AbstractDataObject dataObj = (AbstractDataObject)namedObj;
if (namedObj instanceof ObjectContainer) {
resourceObj.setType(ResourceObject.TYPE_OBJECT_CONTAINER);
// set object classification
final boolean dataInContainer = true;
final boolean containerHasOEG = dataObjectInfo.isMetadataInObjectContainer();
final boolean dataInOCD = true;
// mandatory triplet for object container
resourceObj.setObjectClassification(
ObjectClassificationTriplet.CLASS_TIME_INVARIANT_PAGINATED_PRESENTATION_OBJECT,
objectType, dataInContainer, containerHasOEG, dataInOCD);
} else if (namedObj instanceof ImageObject) {
// ioca image type
resourceObj.setType(ResourceObject.TYPE_IMAGE);
} else if (namedObj instanceof GraphicsObject) {
resourceObj.setType(ResourceObject.TYPE_GRAPHIC);
} else {
throw new UnsupportedOperationException(
"Unsupported resource object for data object type " + dataObj);
}
} else {
throw new UnsupportedOperationException(
"Unsupported resource object type " + namedObj);
}
// set the resource information/classification on the data object
resourceObj.setDataObject(namedObj);
return resourceObj;
}
}
@@ -0,0 +1,320 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.afp;
import org.apache.fop.afp.modca.Registry;
import org.apache.fop.afp.modca.triplets.MappingOptionTriplet;
/**
* A list of parameters associated with an AFP data objects
*/
public class AFPDataObjectInfo {
/** the object area info */
private AFPObjectAreaInfo objectAreaInfo;
/** resource info */
private AFPResourceInfo resourceInfo;
/** the data object width */
private int dataWidth;
/** the data object height */
private int dataHeight;
/** the object registry mimetype */
private String mimeType;
/** the object data in a byte array */
private byte[] data;
private byte[] transparencyMask;
/** the object data height resolution */
private int dataHeightRes;
/** the object data width resolution */
private int dataWidthRes;
/** controls whether to create a page segment or a simple object */
private boolean createPageSegment;
/** controls the mapping of the image data into the image area */
private byte mappingOption = MappingOptionTriplet.SCALE_TO_FILL;
/**
* decides wether we use ioca images or object containers
*/
private boolean useIocaImages = true;
public static final byte DEFAULT_MAPPING_OPTION = 0x00;
/**
* Default constructor
*/
public AFPDataObjectInfo() {
}
private AFPPaintingState paintingState;
public void setPaintingState(AFPPaintingState paintingState) {
this.paintingState = paintingState;
}
public boolean isMetadataInObjectContainer() {
return paintingState != null && paintingState.isMetadataInObjectContainer();
}
/**
* Sets the image mime type
*
* @param mimeType the image mime type
*/
public void setMimeType(String mimeType) {
this.mimeType = mimeType;
}
/**
* Returns the mime type of this data object
*
* @return the mime type of this data object
*/
public String getMimeType() {
return mimeType;
}
/**
* Convenience method to return the object type
*
* @return the object type
*/
public Registry.ObjectType getObjectType() {
return Registry.getInstance().getObjectType(getMimeType());
}
/**
* Returns the resource level at which this data object should reside
*
* @return the resource level at which this data object should reside
*/
public AFPResourceInfo getResourceInfo() {
if (resourceInfo == null) {
this.resourceInfo = new AFPResourceInfo();
}
return resourceInfo;
}
/**
* Sets the resource level at which this object should reside
*
* @param resourceInfo the resource level at which this data object should reside
*/
public void setResourceInfo(AFPResourceInfo resourceInfo) {
this.resourceInfo = resourceInfo;
}
/**
* Sets the object area info
*
* @param objectAreaInfo the object area info
*/
public void setObjectAreaInfo(AFPObjectAreaInfo objectAreaInfo) {
this.objectAreaInfo = objectAreaInfo;
}
/**
* Returns the object area info
*
* @return the object area info
*/
public AFPObjectAreaInfo getObjectAreaInfo() {
return this.objectAreaInfo;
}
/**
* Returns the uri of this data object
*
* @return the uri of this data object
*/
public String getUri() {
return getResourceInfo().getUri();
}
/**
* Sets the data object uri
*
* @param uri the data object uri
*/
public void setUri(String uri) {
getResourceInfo().setUri(uri);
}
/**
* Returns the image data width
*
* @return the image data width
*/
public int getDataWidth() {
return dataWidth;
}
/**
* Sets the image data width
*
* @param imageDataWidth the image data width
*/
public void setDataWidth(int imageDataWidth) {
this.dataWidth = imageDataWidth;
}
/**
* Returns the image data height
*
* @return the image data height
*/
public int getDataHeight() {
return dataHeight;
}
/**
* Sets the image data height
*
* @param imageDataHeight the image data height
*/
public void setDataHeight(int imageDataHeight) {
this.dataHeight = imageDataHeight;
}
/**
* Returns the data height resolution
*
* @return the data height resolution
*/
public int getDataHeightRes() {
return this.dataHeightRes;
}
/**
* Sets the data height resolution
*
* @param dataHeightRes the data height resolution
*/
public void setDataHeightRes(int dataHeightRes) {
this.dataHeightRes = dataHeightRes;
}
/**
* Returns the data width resolution
*
* @return the data width resolution
*/
public int getDataWidthRes() {
return this.dataWidthRes;
}
/**
* Sets the data width resolution
*
* @param dataWidthRes the data width resolution
*/
public void setDataWidthRes(int dataWidthRes) {
this.dataWidthRes = dataWidthRes;
}
/**
* Sets the object data
*
* @param data the object data
*/
public void setData(byte[] data) {
this.data = data;
}
/**
* Returns the object data
*
* @return the object data
*/
public byte[] getData() {
return this.data;
}
public void setTransparencyMask(byte[] transparencyMask) {
this.transparencyMask = transparencyMask;
}
public byte[] getTransparencyMask() {
return transparencyMask;
}
/**
* Controls whether to create a page segment or a normal object.
* @param value true for page segments, false for objects
*/
public void setCreatePageSegment(boolean value) {
this.createPageSegment = value;
}
/**
* Indicates whether a page segment or a normal object shall be created.
* @return true for page segments, false for objects
*/
public boolean isCreatePageSegment() {
return this.createPageSegment;
}
/**
* Sets the way an image is mapped into its target area.
* @param mappingOption the mapping option (Valid values: see Mapping Option Triplet)
*/
public void setMappingOption(byte mappingOption) {
this.mappingOption = mappingOption;
}
/**
* Returns the way an image is mapped into its target area. By default, this is "scale to fill"
* behavior.
* @return the mapping option value from the Mapping Option Triplet
*/
public byte getMappingOption() {
return mappingOption;
}
public void setUseIocaImages(boolean useIocaImages) {
this.useIocaImages = useIocaImages;
}
public boolean isUseIocaImages() {
return useIocaImages;
}
/** {@inheritDoc} */
public String toString() {
return "AFPDataObjectInfo{"
+ "mimeType=" + mimeType
+ ", dataWidth=" + dataWidth
+ ", dataHeight=" + dataHeight
+ ", dataWidthRes=" + dataWidthRes
+ ", dataHeightRes=" + dataHeightRes
+ (objectAreaInfo != null ? ", objectAreaInfo=" + objectAreaInfo : "")
+ (resourceInfo != null ? ", resourceInfo=" + resourceInfo : "");
}
}
@@ -0,0 +1,112 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.afp;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.geom.AffineTransform;
import java.awt.geom.Point2D;
import java.io.IOException;
import org.apache.xmlgraphics.image.loader.ImageSize;
import org.apache.xmlgraphics.util.MimeConstants;
import org.apache.fop.afp.AFPResourceLevel.ResourceType;
import org.apache.fop.afp.modca.triplets.MappingOptionTriplet;
import org.apache.fop.util.bitmap.DitherUtil;
/**
* A painter of rectangles in AFP
*/
public class AFPDitheredRectanglePainter extends AbstractAFPPainter {
private AFPResourceManager resourceManager;
/**
* Main constructor
*
* @param paintingState the AFP painting state
* @param dataStream the AFP datastream
* @param resourceManager the resource manager
*/
public AFPDitheredRectanglePainter(AFPPaintingState paintingState, DataStream dataStream,
AFPResourceManager resourceManager) {
super(paintingState, dataStream);
this.resourceManager = resourceManager;
}
/** {@inheritDoc} */
public void paint(PaintingInfo paintInfo) throws IOException {
RectanglePaintingInfo rectanglePaintInfo = (RectanglePaintingInfo)paintInfo;
if (rectanglePaintInfo.getWidth() <= 0 || rectanglePaintInfo.getHeight() <= 0) {
return;
}
int ditherMatrix = DitherUtil.DITHER_MATRIX_8X8;
Dimension ditherSize = new Dimension(ditherMatrix, ditherMatrix);
//Prepare an FS10 bi-level image
AFPImageObjectInfo imageObjectInfo = new AFPImageObjectInfo();
imageObjectInfo.setMimeType(MimeConstants.MIME_AFP_IOCA_FS10);
//imageObjectInfo.setCreatePageSegment(true);
imageObjectInfo.getResourceInfo().setLevel(new AFPResourceLevel(ResourceType.INLINE));
imageObjectInfo.getResourceInfo().setImageDimension(ditherSize);
imageObjectInfo.setBitsPerPixel(1);
imageObjectInfo.setColor(false);
//Note: the following may not be supported by older implementations
imageObjectInfo.setMappingOption(MappingOptionTriplet.REPLICATE_AND_TRIM);
//Dither image size
int resolution = paintingState.getResolution();
ImageSize ditherBitmapSize = new ImageSize(
ditherSize.width, ditherSize.height, resolution);
imageObjectInfo.setDataHeightRes((int)Math.round(
ditherBitmapSize.getDpiHorizontal() * 10));
imageObjectInfo.setDataWidthRes((int)Math.round(
ditherBitmapSize.getDpiVertical() * 10));
imageObjectInfo.setDataWidth(ditherSize.width);
imageObjectInfo.setDataHeight(ditherSize.height);
//Create dither image
Color col = paintingState.getColor();
byte[] dither = DitherUtil.getBayerDither(ditherMatrix, col, false);
imageObjectInfo.setData(dither);
//Positioning
int rotation = paintingState.getRotation();
AffineTransform at = paintingState.getData().getTransform();
Point2D origin = at.transform(new Point2D.Float(
rectanglePaintInfo.getX() * 1000,
rectanglePaintInfo.getY() * 1000), null);
AFPUnitConverter unitConv = paintingState.getUnitConverter();
float width = unitConv.pt2units(rectanglePaintInfo.getWidth());
float height = unitConv.pt2units(rectanglePaintInfo.getHeight());
AFPObjectAreaInfo objectAreaInfo = new AFPObjectAreaInfo(
(int) Math.round(origin.getX()),
(int) Math.round(origin.getY()),
Math.round(width), Math.round(height), resolution, rotation);
imageObjectInfo.setObjectAreaInfo(objectAreaInfo);
//Create rectangle
resourceManager.createObject(imageObjectInfo);
}
}
@@ -0,0 +1,133 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.afp;
import org.apache.fop.events.EventBroadcaster;
import org.apache.fop.events.EventProducer;
/**
* Event producer interface for AFP-specific events.
*/
public interface AFPEventProducer extends EventProducer {
/** Provider class for the event producer. */
static final class Provider {
private Provider() {
}
/**
* Returns an event producer.
* @param broadcaster the event broadcaster to use
* @return the event producer
*/
public static AFPEventProducer get(EventBroadcaster broadcaster) {
return broadcaster.getEventProducerFor(AFPEventProducer.class);
}
}
/**
* Warn about using default font setup.
*
* @param source the event source
* @event.severity WARN
*/
void warnDefaultFontSetup(Object source);
/**
* Warn about a missing default "any" font configuration.
*
* @param source the event source
* @param style the font style
* @param weight the font weight
* @event.severity WARN
*/
void warnMissingDefaultFont(Object source, String style, int weight);
/**
* A character set encoding error occurred.
*
* @param source the event source
* @param charSetName the character set name
* @param encoding the encoding
* @event.severity ERROR
*/
void characterSetEncodingError(Object source, String charSetName, String encoding);
/**
* Triggered when an external resource fails to be embedded.
*
* @param source the event source
* @param resourceName the name of the resource where the error occurred
* @param e the original exception
* @event.severity ERROR
*/
void resourceEmbeddingError(Object source, String resourceName, Exception e);
/**
* A mandatory font configuration node is missing at location.
* @param source the event source
* @param missingConfig the expected configuration element
* @param location the position of the missing element within the config file.
* @event.severity ERROR
*/
void fontConfigMissing(Object source, String missingConfig, String location);
/**
* The character set given has an invalid name.
* @param source the event source
* @param msg the error message
* @event.severity ERROR
*/
void characterSetNameInvalid(Object source, String msg);
/**
* The code page for an AFP font could not be found.
* @param source the event source
* @param e the original exception
* @event.severity ERROR
*/
void codePageNotFound(Object source, Exception e);
/**
* This is a generic event for invalid configuration errors.
* @param source the event source
* @param e the original exception
* @event.severity ERROR
*/
void invalidConfiguration(Object source, Exception e);
/**
* The characterset is missing metric information for the specified character
* @param source the event source
* @param character the character with missing metric information.
* @param charSet the character set containing missing metric information
* @event.severity WARN
*/
void charactersetMissingMetrics(Object source, char character, String charSet);
/**
* Double-byte fonts are not currently supported in SVG.
* @param source the event source
* @param fontFamily name of DB font
* @event.severity WARN
*/
void invalidDBFontInSVG(Object source, String fontFamily);
}
@@ -0,0 +1,752 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.afp;
import java.awt.AlphaComposite;
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.GraphicsConfiguration;
import java.awt.Image;
import java.awt.Paint;
import java.awt.Rectangle;
import java.awt.Shape;
import java.awt.Stroke;
import java.awt.geom.AffineTransform;
import java.awt.geom.Area;
import java.awt.geom.Ellipse2D;
import java.awt.geom.Line2D;
import java.awt.geom.PathIterator;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
import java.awt.image.ImageObserver;
import java.awt.image.RenderedImage;
import java.awt.image.renderable.RenderableImage;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.xmlgraphics.image.loader.ImageInfo;
import org.apache.xmlgraphics.image.loader.ImageSize;
import org.apache.xmlgraphics.image.loader.impl.ImageRendered;
import org.apache.xmlgraphics.java2d.AbstractGraphics2D;
import org.apache.xmlgraphics.java2d.GraphicContext;
import org.apache.xmlgraphics.java2d.GraphicsConfigurationWithTransparency;
import org.apache.xmlgraphics.java2d.StrokingTextHandler;
import org.apache.xmlgraphics.java2d.TextHandler;
import org.apache.xmlgraphics.util.UnitConv;
import org.apache.fop.afp.goca.GraphicsSetLineEnd;
import org.apache.fop.afp.goca.GraphicsSetLineType;
import org.apache.fop.afp.modca.GraphicsObject;
import org.apache.fop.afp.modca.ResourceObject;
import org.apache.fop.afp.util.CubicBezierApproximator;
import org.apache.fop.fonts.FontInfo;
import org.apache.fop.render.afp.AFPImageHandlerRenderedImage;
import org.apache.fop.render.afp.AFPRenderingContext;
import org.apache.fop.svg.NativeImageHandler;
/**
* This is a concrete implementation of {@link AbstractGraphics2D} (and
* therefore of {@link java.awt.Graphics2D}) which is able to generate GOCA byte
* codes.
*
* @see org.apache.xmlgraphics.java2d.AbstractGraphics2D
*/
public class AFPGraphics2D extends AbstractGraphics2D implements NativeImageHandler {
private static final Log LOG = LogFactory.getLog(AFPGraphics2D.class);
private static final int X = 0;
private static final int Y = 1;
private static final int X1 = 0;
private static final int Y1 = 1;
private static final int X2 = 2;
private static final int Y2 = 3;
private static final int X3 = 4;
private static final int Y3 = 5;
/** graphics object */
private GraphicsObject graphicsObj;
/** Fallback text handler */
protected TextHandler fallbackTextHandler = new StrokingTextHandler();
/** Custom text handler */
protected TextHandler customTextHandler;
/** AFP resource manager */
private AFPResourceManager resourceManager;
/** AFP resource info */
private AFPResourceInfo resourceInfo;
/** Current AFP state */
private AFPPaintingState paintingState;
/** AFP graphics configuration */
private final GraphicsConfigurationWithTransparency graphicsConfig = new GraphicsConfigurationWithTransparency();
/** The AFP FontInfo */
private FontInfo fontInfo;
/**
* Main constructor
*
* @param textAsShapes
* if true, all text is turned into shapes in the convertion. No
* text is output.
* @param paintingState painting state
* @param resourceManager resource manager
* @param resourceInfo resource info
* @param fontInfo font info
*/
public AFPGraphics2D(boolean textAsShapes, AFPPaintingState paintingState,
AFPResourceManager resourceManager, AFPResourceInfo resourceInfo,
FontInfo fontInfo) {
super(textAsShapes);
setPaintingState(paintingState);
setResourceManager(resourceManager);
setResourceInfo(resourceInfo);
setFontInfo(fontInfo);
}
/**
* Copy Constructor
*
* @param g2d
* a AFPGraphics2D whose properties should be copied
*/
public AFPGraphics2D(AFPGraphics2D g2d) {
super(g2d);
this.paintingState = g2d.paintingState;
this.resourceManager = g2d.resourceManager;
this.resourceInfo = g2d.resourceInfo;
this.fontInfo = g2d.fontInfo;
this.graphicsObj = g2d.graphicsObj;
this.fallbackTextHandler = g2d.fallbackTextHandler;
this.customTextHandler = g2d.customTextHandler;
}
/**
* Sets the AFP resource manager
*
* @param resourceManager the AFP resource manager
*/
private void setResourceManager(AFPResourceManager resourceManager) {
this.resourceManager = resourceManager;
}
/**
* Returns the AFP resource manager associated with this {@link java.awt.Graphics2D} instance.
* @return the resource manager
*/
public AFPResourceManager getResourceManager() {
return this.resourceManager;
}
/**
* Sets the AFP resource info
*
* @param resourceInfo the AFP resource info
*/
private void setResourceInfo(AFPResourceInfo resourceInfo) {
this.resourceInfo = resourceInfo;
}
/**
* Returns the GOCA graphics object
*
* @return the GOCA graphics object
*/
public GraphicsObject getGraphicsObject() {
return this.graphicsObj;
}
/**
* Sets the GOCA graphics object
*
* @param obj the GOCA graphics object
*/
public void setGraphicsObject(GraphicsObject obj) {
this.graphicsObj = obj;
}
/**
* Sets the AFP painting state
*
* @param paintingState the AFP painting state
*/
private void setPaintingState(AFPPaintingState paintingState) {
this.paintingState = paintingState;
}
/**
* Returns the AFP painting state
*
* @return the AFP painting state
*/
public AFPPaintingState getPaintingState() {
return this.paintingState;
}
/**
* Sets the FontInfo
*
* @param fontInfo the FontInfo
*/
private void setFontInfo(FontInfo fontInfo) {
this.fontInfo = fontInfo;
}
/**
* Returns the FontInfo
*
* @return the FontInfo
*/
public FontInfo getFontInfo() {
return this.fontInfo;
}
/**
* Sets the GraphicContext
*
* @param gc
* GraphicContext to use
*/
public void setGraphicContext(GraphicContext gc) {
this.gc = gc;
}
private int getResolution() {
return this.paintingState.getResolution();
}
/**
* Converts a length value to an absolute value.
* Please note that this only uses the "ScaleY" factor, so this will result
* in a bad value should "ScaleX" and "ScaleY" be different.
* @param length the length
* @return the absolute length
*/
public double convertToAbsoluteLength(double length) {
AffineTransform current = getTransform();
double mult = getResolution() / (double)UnitConv.IN2PT;
double factor = -current.getScaleY() / mult;
return length * factor;
}
/**
* Apply the stroke to the AFP graphics object.
* This takes the java stroke and outputs the appropriate settings
* to the AFP graphics object so that the stroke attributes are handled.
*
* @param stroke the java stroke
*/
protected void applyStroke(Stroke stroke) {
if (stroke instanceof BasicStroke) {
BasicStroke basicStroke = (BasicStroke) stroke;
// set line width and correct it; NOTE: apparently we need to correct the width so that the
// output looks OK since the default with depends on the output device
float lineWidth = basicStroke.getLineWidth();
float correction = paintingState.getLineWidthCorrection();
graphicsObj.setLineWidth(lineWidth * correction);
//No line join, miter limit and end cap support in GOCA. :-(
// set line type/style (note: this is an approximation at best!)
float[] dashArray = basicStroke.getDashArray();
if (paintingState.setDashArray(dashArray)) {
byte type = GraphicsSetLineType.DEFAULT; // normally SOLID
if (dashArray != null) {
type = GraphicsSetLineType.DOTTED; // default to plain DOTTED if dashed line
// float offset = basicStroke.getDashPhase();
if (dashArray.length == 2) {
if (dashArray[0] < dashArray[1]) {
type = GraphicsSetLineType.SHORT_DASHED;
} else if (dashArray[0] > dashArray[1]) {
type = GraphicsSetLineType.LONG_DASHED;
}
} else if (dashArray.length == 4) {
if (dashArray[0] > dashArray[1]
&& dashArray[2] < dashArray[3]) {
type = GraphicsSetLineType.DASH_DOT;
} else if (dashArray[0] < dashArray[1]
&& dashArray[2] < dashArray[3]) {
type = GraphicsSetLineType.DOUBLE_DOTTED;
}
} else if (dashArray.length == 6) {
if (dashArray[0] > dashArray[1]
&& dashArray[2] < dashArray[3]
&& dashArray[4] < dashArray[5]) {
type = GraphicsSetLineType.DASH_DOUBLE_DOTTED;
}
}
}
graphicsObj.setLineType(type);
}
graphicsObj.setLineEnd(GraphicsSetLineEnd.FLAT);
} else {
LOG.warn("Unsupported Stroke: " + stroke.getClass().getName());
}
}
/**
* Apply the java paint to the AFP.
* This takes the java paint sets up the appropriate AFP commands
* for the drawing with that paint.
* Currently this supports the gradients and patterns from batik.
*
* @param paint the paint to convert to AFP
* @param fill true if the paint should be set for filling
* @return true if the paint is handled natively, false if the paint should be rasterized
*/
private boolean applyPaint(Paint paint, boolean fill) {
if (paint instanceof Color) {
return true;
}
LOG.debug("NYI: applyPaint() " + paint + " fill=" + fill);
// if (paint instanceof TexturePaint) {
// TexturePaint texturePaint = (TexturePaint)paint;
// BufferedImage bufferedImage = texturePaint.getImage();
// AffineTransform at = paintingState.getTransform();
// int x = (int)Math.round(at.getTranslateX());
// int y = (int)Math.round(at.getTranslateY());
// drawImage(bufferedImage, x, y, null);
// }
return false;
}
/**
* Handle the Batik drawing event
*
* @param shape
* the shape to draw
* @param fill
* true if the shape is to be drawn filled
*/
private void doDrawing(Shape shape, boolean fill) {
Shape clip = getClip();
if (clip != null) {
if (shape instanceof Line2D
&& (((Line2D) shape).getX1() == ((Line2D) shape).getX2()
|| ((Line2D) shape).getY1() == ((Line2D) shape).getY2())) {
Rectangle2D bounds = shape.getBounds2D();
Rectangle2D newShape = bounds.createIntersection(clip.getBounds2D());
((Line2D) shape).setLine(newShape.getX(),
newShape.getY(),
newShape.getX() + newShape.getWidth(),
newShape.getY() + newShape.getHeight());
} else if (shape instanceof Rectangle2D) {
Area area = new Area(shape);
area.intersect(new Area(clip));
shape = area.getBounds2D();
} else {
Area area = new Area(shape);
if (!area.isEmpty() && !area.intersects(clip.getBounds2D())) {
return;
}
}
}
if (!fill) {
graphicsObj.newSegment();
}
graphicsObj.setColor(gc.getColor());
applyPaint(gc.getPaint(), fill);
if (fill) {
graphicsObj.beginArea();
} else {
applyStroke(gc.getStroke());
}
AffineTransform trans = gc.getTransform();
PathIterator iter = shape.getPathIterator(trans);
if (shape instanceof Line2D) {
double[] dstPts = new double[6];
iter.currentSegment(dstPts);
int[] coords = new int[4];
coords[X1] = (int) Math.round(dstPts[X]);
coords[Y1] = (int) Math.round(dstPts[Y]);
iter.next();
iter.currentSegment(dstPts);
coords[X2] = (int) Math.round(dstPts[X]);
coords[Y2] = (int) Math.round(dstPts[Y]);
graphicsObj.addLine(coords);
} else if (shape instanceof Rectangle2D) {
double[] dstPts = new double[6];
iter.currentSegment(dstPts);
int[] coords = new int[4];
coords[X2] = (int) Math.round(dstPts[X]);
coords[Y2] = (int) Math.round(dstPts[Y]);
iter.next();
iter.next();
iter.currentSegment(dstPts);
coords[X1] = (int) Math.round(dstPts[X]);
coords[Y1] = (int) Math.round(dstPts[Y]);
graphicsObj.addBox(coords);
} else if (shape instanceof Ellipse2D) {
double[] dstPts = new double[6];
Ellipse2D elip = (Ellipse2D) shape;
double scale = trans.getScaleX();
double radiusWidth = elip.getWidth() / 2;
double radiusHeight = elip.getHeight() / 2;
graphicsObj.setArcParams(
(int)Math.round(radiusWidth * scale),
(int)Math.round(radiusHeight * scale),
0,
0
);
double[] srcPts = new double[] {elip.getCenterX(), elip.getCenterY()};
trans.transform(srcPts, 0, dstPts, 0, 1);
final int mh = 1;
final int mhr = 0;
graphicsObj.addFullArc(
(int)Math.round(dstPts[X]),
(int)Math.round(dstPts[Y]),
mh,
mhr
);
} else {
processPathIterator(iter);
}
if (fill) {
graphicsObj.endArea();
}
}
/**
* Processes a path iterator generating the necessary painting operations.
*
* @param iter PathIterator to process
*/
private void processPathIterator(PathIterator iter) {
double[] dstPts = new double[6];
double[] currentPosition = new double[2];
List<Integer> fillets = new ArrayList<Integer>();
for (int[] openingCoords = new int[2]; !iter.isDone(); iter.next()) {
switch (iter.currentSegment(dstPts)) {
case PathIterator.SEG_LINETO:
flush(fillets);
graphicsObj.addLine(new int[] {
(int)Math.round(dstPts[X]),
(int)Math.round(dstPts[Y])
}, true);
currentPosition = new double[]{dstPts[X], dstPts[Y]};
break;
case PathIterator.SEG_QUADTO:
flush(fillets);
graphicsObj.addFillet(new int[] {
(int)Math.round(dstPts[X1]),
(int)Math.round(dstPts[Y1]),
(int)Math.round(dstPts[X2]),
(int)Math.round(dstPts[Y2])
}, true);
currentPosition = new double[]{dstPts[X2], dstPts[Y2]};
break;
case PathIterator.SEG_CUBICTO:
double[] cubicCoords = new double[] {currentPosition[0], currentPosition[1],
dstPts[X1], dstPts[Y1], dstPts[X2], dstPts[Y2], dstPts[X3], dstPts[Y3]};
double[][] quadParts = CubicBezierApproximator.fixedMidPointApproximation(
cubicCoords);
if (quadParts.length >= 4) {
for (double[] quadPts : quadParts) {
if (quadPts != null && quadPts.length == 4) {
fillets.add((int) Math.round(quadPts[X1]));
fillets.add((int) Math.round(quadPts[Y1]));
fillets.add((int) Math.round(quadPts[X2]));
fillets.add((int) Math.round(quadPts[Y2]));
currentPosition = new double[]{quadPts[X2], quadPts[Y2]};
}
}
}
break;
case PathIterator.SEG_MOVETO:
flush(fillets);
openingCoords = new int[] {
(int)Math.round(dstPts[X]),
(int)Math.round(dstPts[Y])
};
currentPosition = new double[]{dstPts[X], dstPts[Y]};
graphicsObj.setCurrentPosition(openingCoords);
break;
case PathIterator.SEG_CLOSE:
flush(fillets);
graphicsObj.addLine(openingCoords, true);
currentPosition = new double[]{openingCoords[0], openingCoords[1]};
break;
default:
LOG.debug("Unrecognised path iterator type");
break;
}
}
flush(fillets);
}
private void flush(List<Integer> fillets) {
List<int[]> intList = listToIntLists(fillets);
for (int[] ints : intList) {
graphicsObj.addFillet(ints, true);
}
}
private List<int[]> listToIntLists(List<Integer> input) {
List<int[]> out = new ArrayList<int[]>();
while (!input.isEmpty()) {
int[] data = new int[Math.min(100, input.size())];
for (int i = 0; i < data.length; i++) {
data[i] = input.remove(0);
}
out.add(data);
}
return out;
}
/** {@inheritDoc} */
@Override
public void draw(Shape shape) {
LOG.debug("draw() shape=" + shape);
doDrawing(shape, false);
}
/** {@inheritDoc} */
@Override
public void fill(Shape shape) {
LOG.debug("fill() shape=" + shape);
doDrawing(shape, true);
}
/**
* Central handler for IOExceptions for this class.
*
* @param ioe
* IOException to handle
*/
public void handleIOException(IOException ioe) {
// TODO Surely, there's a better way to do this.
LOG.error(ioe.getMessage());
ioe.printStackTrace();
}
/** {@inheritDoc} */
@Override
public void drawString(String str, float x, float y) {
try {
if (customTextHandler != null && !textAsShapes) {
customTextHandler.drawString(this, str, x, y);
} else {
fallbackTextHandler.drawString(this, str, x, y);
}
} catch (IOException ioe) {
handleIOException(ioe);
}
}
/** {@inheritDoc} */
@Override
public GraphicsConfiguration getDeviceConfiguration() {
return graphicsConfig;
}
/** {@inheritDoc} */
@Override
public Graphics create() {
return new AFPGraphics2D(this);
}
/** {@inheritDoc} */
@Override
public void dispose() {
this.graphicsObj = null;
}
/** {@inheritDoc} */
@Override
public boolean drawImage(Image img, int x, int y, ImageObserver observer) {
return drawImage(img, x, y, img.getWidth(observer), img.getHeight(observer), observer);
}
private BufferedImage buildBufferedImage(Dimension size) {
return new BufferedImage(size.width, size.height,
BufferedImage.TYPE_INT_ARGB);
}
/**
* Draws an AWT image into a BufferedImage using an AWT Graphics2D implementation
*
* @param img the AWT image
* @param bufferedImage the AWT buffered image
* @param width the image width
* @param height the image height
* @param observer the image observer
* @return true if the image was drawn
*/
private boolean drawBufferedImage(Image img, BufferedImage bufferedImage,
int width, int height, ImageObserver observer) {
java.awt.Graphics2D g2d = bufferedImage.createGraphics();
try {
g2d.setComposite(AlphaComposite.SrcOver);
Color color = new Color(1, 1, 1, 0);
g2d.setBackground(color);
g2d.setPaint(color);
g2d.fillRect(0, 0, width, height);
int imageWidth = bufferedImage.getWidth();
int imageHeight = bufferedImage.getHeight();
Rectangle clipRect = new Rectangle(0, 0, imageWidth, imageHeight);
g2d.clip(clipRect);
g2d.setComposite(gc.getComposite());
return g2d.drawImage(img, 0, 0, imageWidth, imageHeight, observer);
} finally {
g2d.dispose(); //drawn so dispose immediately to free system resource
}
}
/** {@inheritDoc} */
@Override
public boolean drawImage(Image img, int x, int y, int width, int height,
ImageObserver observer) {
// draw with AWT Graphics2D
Dimension imageSize = new Dimension(width, height);
BufferedImage bufferedImage = buildBufferedImage(imageSize);
boolean drawn = drawBufferedImage(img, bufferedImage, width, height, observer);
if (drawn) {
drawRenderedImage(bufferedImage, new AffineTransform());
}
return false;
}
/** {@inheritDoc} */
@Override
public void drawRenderedImage(RenderedImage img, AffineTransform xform) {
int imgWidth = img.getWidth();
int imgHeight = img.getHeight();
AffineTransform gat = gc.getTransform();
int graphicsObjectHeight
= graphicsObj.getObjectEnvironmentGroup().getObjectAreaDescriptor().getHeight();
double toMillipointFactor = UnitConv.IN2PT * 1000 / (double)paintingState.getResolution();
double x = gat.getTranslateX();
double y = -(gat.getTranslateY() - graphicsObjectHeight);
x = toMillipointFactor * x;
y = toMillipointFactor * y;
double w = toMillipointFactor * imgWidth * gat.getScaleX();
double h = toMillipointFactor * imgHeight * -gat.getScaleY();
AFPImageHandlerRenderedImage handler = new AFPImageHandlerRenderedImage();
String uri = null;
if (resourceManager.getResourceLevelDefaults()
.getDefaultResourceLevel(ResourceObject.TYPE_GRAPHIC).isPrintFile()) {
uri = resourceInfo.getUri();
}
ImageInfo imageInfo = new ImageInfo(uri, null);
imageInfo.setSize(new ImageSize(
img.getWidth(), img.getHeight(), paintingState.getResolution()));
imageInfo.getSize().calcSizeFromPixels();
ImageRendered red = new ImageRendered(imageInfo, img, null);
Rectangle targetPos = new Rectangle(
(int)Math.round(x),
(int)Math.round(y),
(int)Math.round(w),
(int)Math.round(h));
AFPRenderingContext context = new AFPRenderingContext(null,
resourceManager, paintingState, fontInfo, null);
resourceManager.includeCached = false;
try {
handler.handleImage(context, red, targetPos);
} catch (IOException ioe) {
handleIOException(ioe);
}
resourceManager.includeCached = true;
}
/**
* Sets a custom TextHandler implementation that is responsible for painting
* text. The default TextHandler paints all text as shapes. A custom
* implementation can implement text painting using text painting operators.
*
* @param handler
* the custom TextHandler implementation
*/
public void setCustomTextHandler(TextHandler handler) {
this.customTextHandler = handler;
}
/** {@inheritDoc} */
@Override
public void drawRenderableImage(RenderableImage img, AffineTransform xform) {
LOG.debug("drawRenderableImage() NYI: img=" + img + ", xform=" + xform);
}
/** {@inheritDoc} */
@Override
public FontMetrics getFontMetrics(Font f) {
LOG.debug("getFontMetrics() NYI: f=" + f);
return null;
}
/** {@inheritDoc} */
@Override
public void setXORMode(Color col) {
LOG.debug("setXORMode() NYI: col=" + col);
}
/** {@inheritDoc} */
public void addNativeImage(org.apache.xmlgraphics.image.loader.Image image,
float x, float y, float width, float height) {
LOG.debug("NYI: addNativeImage() " + "image=" + image
+ ",x=" + x + ",y=" + y + ",width=" + width + ",height=" + height);
}
/** {@inheritDoc} */
@Override
public void copyArea(int x, int y, int width, int height, int dx, int dy) {
LOG.debug("copyArea() NYI: ");
}
public void clearRect(int x, int y, int width, int height) {
}
}
@@ -0,0 +1,109 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.afp;
import java.awt.Rectangle;
import java.awt.geom.Rectangle2D;
import org.apache.xmlgraphics.java2d.Graphics2DImagePainter;
import org.apache.xmlgraphics.util.MimeConstants;
/**
* A graphics object info which contains necessary painting objects
*/
public class AFPGraphicsObjectInfo extends AFPDataObjectInfo {
/** the graphics object painter implementation */
private Graphics2DImagePainter painter;
/** the graphics object area */
private Rectangle2D area;
/** the AFP graphics 2d implementation */
private AFPGraphics2D g2d;
/**
* Returns the graphics painter
*
* @return the graphics painter
*/
public Graphics2DImagePainter getPainter() {
return this.painter;
}
/**
* Sets the graphics painter
*
* @param graphicsPainter the graphics painter
*/
public void setPainter(Graphics2DImagePainter graphicsPainter) {
this.painter = graphicsPainter;
}
/**
* Returns the graphics area
*
* @return the graphics area
*/
public Rectangle2D getArea() {
AFPObjectAreaInfo objectAreaInfo = getObjectAreaInfo();
int width = objectAreaInfo.getWidth();
int height = objectAreaInfo.getHeight();
return new Rectangle(width, height);
}
/**
* Sets the graphics area area
*
* @param area the graphics object area
*/
public void setArea(Rectangle2D area) {
this.area = area;
}
/**
* Sets the AFP graphics 2D implementation
*
* @param g2d the AFP graphics 2D implementation
*/
public void setGraphics2D(AFPGraphics2D g2d) {
this.g2d = g2d;
}
/**
* Returns the AFP graphics 2D implementation
*
* @return the AFP graphics 2D implementation
*/
public AFPGraphics2D getGraphics2D() {
return this.g2d;
}
/** {@inheritDoc} */
public String toString() {
return "GraphicsObjectInfo{" + super.toString() + "}";
}
/** {@inheritDoc} */
public String getMimeType() {
return MimeConstants.MIME_SVG;
}
}
@@ -0,0 +1,135 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.afp;
/**
* A list of parameters associated with an image
*/
public class AFPImageObjectInfo extends AFPDataObjectInfo {
/** number of bits per pixel used */
private int bitsPerPixel;
/** is this a color image? */
private boolean color;
/** compression type if any */
private int compression = -1;
private boolean subtractive;
/**
* Default constructor
*/
public AFPImageObjectInfo() {
super();
}
/**
* Sets the number of bits per pixel
*
* @param bitsPerPixel the number of bits per pixel
*/
public void setBitsPerPixel(int bitsPerPixel) {
this.bitsPerPixel = bitsPerPixel;
}
/**
* Sets if this image is color
*
* @param color true if this is a color image
*/
public void setColor(boolean color) {
this.color = color;
}
/**
* Returns the number of bits used per pixel
*
* @return the number of bits used per pixel
*/
public int getBitsPerPixel() {
return bitsPerPixel;
}
/**
* Returns true if this is a color image
*
* @return true if this is a color image
*/
public boolean isColor() {
return color;
}
/**
* Returns true if this image uses compression
*
* @return true if this image uses compression
*/
public boolean hasCompression() {
return compression != -1;
}
/**
* Returns the compression type
*
* @return the compression type
*/
public int getCompression() {
return compression;
}
/**
* Sets the compression used with this image
*
* @param compression the type of compression used with this image
*/
public void setCompression(int compression) {
this.compression = compression;
}
/**
* Set either additive or subtractive mode (used for ASFLAG).
* @param subtractive true for subtractive mode, false for additive mode
*/
public void setSubtractive(boolean subtractive) {
this.subtractive = subtractive;
}
/**
* Indicates whether additive or subtractive mode is set.
* @return true for subtractive mode, false for additive mode
*/
public boolean isSubtractive() {
return subtractive;
}
/** {@inheritDoc} */
@Override
public String toString() {
return "AFPImageObjectInfo{" + super.toString()
+ ", compression=" + compression
+ ", color=" + color
+ ", bitsPerPixel=" + bitsPerPixel
+ ", " + (isSubtractive() ? "subtractive" : "additive")
+ "}";
}
}
@@ -0,0 +1,206 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.afp;
import java.awt.Color;
/** Line data information */
public class AFPLineDataInfo {
/** the x1 coordinate */
private int x1;
/** the y1 coordinate */
private int y1;
/** the x2 coordinate */
private int x2;
/** the y2 coordinate */
private int y2;
/** the thickness */
private int thickness;
/** the painting color */
private Color color;
/** the rotation */
private int rotation;
/**
* Default constructor
*/
public AFPLineDataInfo() {
}
/**
* Copy constructor.
* @param template the object to copy
*/
public AFPLineDataInfo(AFPLineDataInfo template) {
this.x1 = template.x1;
this.y1 = template.y1;
this.x2 = template.x2;
this.y2 = template.y2;
this.thickness = template.thickness;
this.color = template.color;
this.rotation = template.rotation;
}
/**
* Returns the X1 coordinate
*
* @return the X1 coordinate
*/
public int getX1() {
return x1;
}
/**
* Sets the X1 coordinate
*
* @param x1 the X1 coordinate
*/
public void setX1(int x1) {
this.x1 = x1;
}
/**
* Returns the Y1 coordinate
*
* @return the Y1 coordinate
*/
public int getY1() {
return y1;
}
/**
* Sets the Y1 coordinate
*
* @param y1 the Y1 coordinate
*/
public void setY1(int y1) {
this.y1 = y1;
}
/**
* Returns the X2 coordinate
*
* @return the X2 coordinate
*/
public int getX2() {
return x2;
}
/**
* Sets the X2 coordinate
*
* @param x2 the X2 coordinate
*/
public void setX2(int x2) {
this.x2 = x2;
}
/**
* Returns the Y2 coordinate
*
* @return the Y2 coordinate
*/
public int getY2() {
return y2;
}
/**
* Sets the Y2 coordinate
*
* @param y2 the Y2 coordinate
*/
public void setY2(int y2) {
this.y2 = y2;
}
/**
* Returns the line thickness
*
* @return the line thickness
*/
public int getThickness() {
return thickness;
}
/**
* Sets the line thickness
*
* @param thickness the line thickness
*/
public void setThickness(int thickness) {
this.thickness = thickness;
}
/**
* Returns line color
*
* @return the line color
*/
public Color getColor() {
return color;
}
/**
* Sets the line color
*
* @param color the line color
*/
public void setColor(Color color) {
this.color = color;
}
/**
* Returns line rotation
*
* @return the line rotation
*/
public int getRotation() {
return rotation;
}
/**
* Sets the line rotation
*
* @param rotation the line rotation
*/
public void setRotation(int rotation) {
this.rotation = rotation;
}
/** {@inheritDoc} */
public String toString() {
return "AFPLineDataInfo{x1=" + x1
+ ", y1=" + y1
+ ", x2=" + x2
+ ", y2=" + y2
+ ", thickness=" + thickness
+ ", color=" + color
+ ", rotation=" + rotation
+ "}";
}
}
@@ -0,0 +1,157 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.afp;
/**
* A common class used to convey locations,
* dimensions and resolutions of data objects.
*/
public class AFPObjectAreaInfo {
private final int x;
private final int y;
private final int width;
private final int height;
private int widthRes;
private int heightRes;
private final int rotation;
/**
* Constructor
*
* @param x the x coordinate
* @param y the y coordinate
* @param width the width
* @param height the height
* @param resolution the resolution (sets both width and height resolutions)
* @param rotation the rotation angle
*/
public AFPObjectAreaInfo(int x, int y, int width, int height, int resolution, int rotation) {
this.x = x;
this.y = y;
this.width = width;
this.height = height;
this.rotation = rotation;
this.widthRes = resolution;
this.heightRes = resolution;
}
/**
* Sets both the width and the height resolutions.
*
* @param resolution the resolution
*/
public void setResolution(int resolution) {
this.widthRes = resolution;
this.heightRes = resolution;
}
/**
* Sets the width resolution.
*
* @param resolution the resolution
*/
public void setWidthRes(int resolution) {
this.widthRes = resolution;
}
/**
* Sets the height resolution.
*
* @param resolution the resolution
*/
public void setHeightRes(int resolution) {
this.heightRes = resolution;
}
/**
* Returns the x coordinate of this data object
*
* @return the x coordinate of this data object
*/
public int getX() {
return x;
}
/**
* Returns the y coordinate of this data object
*
* @return the y coordinate of this data object
*/
public int getY() {
return y;
}
/**
* Returns the width of this data object
*
* @return the width of this data object
*/
public int getWidth() {
return width;
}
/**
* Returns the height of this data object
*
* @return the height of this data object
*/
public int getHeight() {
return height;
}
/**
* Returns the width resolution of this data object
*
* @return the resolution of this data object
*/
public int getWidthRes() {
return widthRes;
}
/**
* Returns the height resolution of this data object
*
* @return the resolution of this data object
*/
public int getHeightRes() {
return heightRes;
}
/**
* Returns the rotation of this data object
*
* @return the rotation of this data object
*/
public int getRotation() {
return rotation;
}
/** {@inheritDoc} */
public String toString() {
return "x=" + x
+ ", y=" + y
+ ", width=" + width
+ ", height=" + height
+ ", widthRes=" + widthRes
+ ", heigtRes=" + heightRes
+ ", rotation=" + rotation;
}
}
@@ -0,0 +1,823 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.afp;
import java.awt.Point;
import java.io.IOException;
import java.io.ObjectInputStream;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.xmlgraphics.java2d.color.ColorConverter;
import org.apache.xmlgraphics.java2d.color.DefaultColorConverter;
import org.apache.fop.afp.fonts.AFPPageFonts;
import org.apache.fop.util.AbstractPaintingState;
/**
* This keeps information about the current painting state when writing to an
* AFP datastream.
*/
public class AFPPaintingState extends org.apache.fop.util.AbstractPaintingState {
private static final long serialVersionUID = 8206711712452344473L;
private static Log log = LogFactory.getLog("org.apache.xmlgraphics.afp");
/** the portrait rotation */
private int portraitRotation;
/** the landscape rotation */
private int landscapeRotation = 270;
/** color image support */
private boolean colorImages;
/** dithering quality setting (0.0f..1.0f) */
private float ditheringQuality;
/** image encoding quality setting (0.0f..1.0f) */
private float bitmapEncodingQuality;
private boolean useIocaImages = true;
/** color image handler */
private transient ColorConverter colorConverter;
/**
* true if certain image formats may be embedded unchanged in their native
* format.
*/
private boolean nativeImagesSupported;
private boolean nativePDFImagesSupported;
private boolean canEmbedJpeg;
/**
* true if CMYK images (requires IOCA FS45 suppport on the target platform)
* may be generated
*/
private boolean cmykImagesSupported;
/** default value for image depth */
private int bitsPerPixel = 8;
/** the output resolution */
private int resolution = 240; // 240 dpi
/**
* A configurable value to correct the line width so that the output matches the expected. Different
* devices may need different values.
*/
private float lineWidthCorrection = AFPConstants.LINE_WIDTH_CORRECTION;
/** determines whether GOCA is enabled or disabled */
private boolean gocaEnabled = true;
/** determines whether to stroke text in GOCA mode or to use text operators where possible */
private boolean strokeGocaText;
/** use page segment with F11 and F45 images*/
private boolean pSeg;
private boolean gocaPSeg;
/** use FS45 images*/
private boolean fs45;
private boolean maskEnabled;
private boolean metadataInObjectContainer;
/** the current page */
private transient AFPPagePaintingState pagePaintingState;
// /** reference orientation */
// private int orientation = 0;
/** a unit converter */
private final transient AFPUnitConverter unitConv;
public AFPPaintingState() {
colorConverter = GrayScaleColorConverter.getInstance();
pagePaintingState = new AFPPagePaintingState();
unitConv = new AFPUnitConverter(this);
}
private void readObject(ObjectInputStream ois) throws ClassNotFoundException, IOException {
ois.defaultReadObject();
}
/**
* Sets the rotation to be used for portrait pages, valid values are 0
* (default), 90, 180, 270.
*
* @param rotation
* The rotation in degrees.
*/
public void setPortraitRotation(int rotation) {
if (rotation == 0 || rotation == 90 || rotation == 180 || rotation == 270) {
portraitRotation = rotation;
} else {
throw new IllegalArgumentException("The portrait rotation must be one"
+ " of the values 0, 90, 180, 270");
}
}
/**
* Returns the rotation to be used for portrait pages
*
* @return the rotation to be used for portrait pages
*/
protected int getPortraitRotation() {
return this.portraitRotation;
}
/**
* Sets the rotation to be used for landscape pages, valid values are 0, 90,
* 180, 270 (default).
*
* @param rotation
* The rotation in degrees.
*/
public void setLandscapeRotation(int rotation) {
if (rotation == 0 || rotation == 90 || rotation == 180 || rotation == 270) {
landscapeRotation = rotation;
} else {
throw new IllegalArgumentException("The landscape rotation must be one"
+ " of the values 0, 90, 180, 270");
}
}
/**
* Returns the landscape rotation
*
* @return the landscape rotation
*/
protected int getLandscapeRotation() {
return this.landscapeRotation;
}
/**
* Sets the number of bits used per pixel
*
* @param bitsPerPixel
* number of bits per pixel
*/
public void setBitsPerPixel(int bitsPerPixel) {
switch (bitsPerPixel) {
case 1:
case 4:
case 8:
this.bitsPerPixel = bitsPerPixel;
break;
default:
log.warn("Invalid bits_per_pixel value, must be 1, 4 or 8.");
this.bitsPerPixel = 8;
break;
}
}
/**
* Returns the number of bits per pixel
*
* @return the number of bits per pixel
*/
public int getBitsPerPixel() {
return this.bitsPerPixel;
}
/**
* Sets whether images are color or not and instantiates a ColorHandler
*
* @param colorImages
* color image output
*/
public void setColorImages(boolean colorImages) {
this.colorImages = colorImages;
if (colorImages) {
this.colorConverter = DefaultColorConverter.getInstance();
}
}
/**
* Returns true if color images are to be used
*
* @return true if color images are to be used
*/
public boolean isColorImages() {
return this.colorImages;
}
/**
* Used to convert color in respect of the colorImages flag
*
* @return the color converter
*/
public ColorConverter getColorConverter() {
return this.colorConverter;
}
/**
* Sets whether images are natively supported or not in the AFP environment
*
* @param nativeImagesSupported
* true if images are natively supported in this AFP environment
*/
public void setNativeImagesSupported(boolean nativeImagesSupported) {
this.nativeImagesSupported = nativeImagesSupported;
}
/**
* Returns true if images are supported natively in this AFP environment
*
* @return true if images are supported natively in this AFP environment
*/
public boolean isNativeImagesSupported() {
return this.nativeImagesSupported;
}
public void setNativePDFImagesSupported(boolean nativePDFImagesSupported) {
this.nativePDFImagesSupported = nativePDFImagesSupported;
}
public boolean isNativePDFImagesSupported() {
return nativePDFImagesSupported;
}
/**
* Set whether or not JPEG images can be embedded within an AFP document.
*
* @param canEmbed true if the JPEG image can be embedded
*/
public void setCanEmbedJpeg(boolean canEmbed) {
canEmbedJpeg = canEmbed;
}
/**
* Returns true if JPEGs can be embedded in an AFP document.
*
* @return true if JPEG embedding is allowed
*/
public boolean canEmbedJpeg() {
return canEmbedJpeg;
}
/**
* Controls whether CMYK images (IOCA FS45) are enabled. By default, support
* is disabled for wider compatibility. When disabled, any CMYK image is
* converted to the selected color format.
*
* @param value
* true to enabled CMYK images
*/
public void setCMYKImagesSupported(boolean value) {
this.cmykImagesSupported = value;
}
/**
* Indicates whether CMYK images (IOCA FS45) are enabled.
*
* @return true if IOCA FS45 is enabled
*/
public boolean isCMYKImagesSupported() {
return this.cmykImagesSupported;
}
/**
* Gets the dithering quality setting to use when converting images to monochrome images.
* @return the dithering quality (a value between 0.0f and 1.0f)
*/
public float getDitheringQuality() {
return this.ditheringQuality;
}
/**
* Sets the dithering quality setting to use when converting images to monochrome images.
* @param quality Defines the desired quality level for the conversion.
* Valid values: a value between 0.0f (fastest) and 1.0f (best)
*/
public void setDitheringQuality(float quality) {
quality = Math.max(quality, 0.0f);
quality = Math.min(quality, 1.0f);
this.ditheringQuality = quality;
}
/**
* Gets the image encoding quality setting to use when encoding bitmap images.
* @return the encoding quality (a value between 0.0f and 1.0f, 1.0 meaning loss-less)
*/
public float getBitmapEncodingQuality() {
return this.bitmapEncodingQuality;
}
/**
* Sets the image encoding quality setting to use when encoding bitmap images.
* @param quality Defines the desired quality level for the conversion.
* Valid values: a value between 0.0f (lowest) and 1.0f (best, loss-less)
*/
public void setBitmapEncodingQuality(float quality) {
quality = Math.max(quality, 0.0f);
quality = Math.min(quality, 1.0f);
this.bitmapEncodingQuality = quality;
}
/**
* Gets the ioca image setting
*
* @return true by default
*/
public boolean isUseIocaImages() {
return this.useIocaImages;
}
/**
* Sets the tag that decides if we use ioca images or object containers
*
* @param useIocaImages true by default
*/
public void setUseIocaImages(boolean useIocaImages) {
this.useIocaImages = useIocaImages;
}
/**
* Sets the output/device resolution
*
* @param resolution
* the output resolution (dpi)
*/
public void setResolution(int resolution) {
if (log.isDebugEnabled()) {
log.debug("renderer-resolution set to: " + resolution + "dpi");
}
this.resolution = resolution;
}
/**
* Sets the line width correction
*
* @param correction the line width multiplying factor correction
*/
public void setLineWidthCorrection(float correction) {
if (log.isDebugEnabled()) {
log.debug("line width correction set to: " + correction);
}
this.lineWidthCorrection = correction;
}
/**
* Returns the output/device resolution.
*
* @return the resolution in dpi
*/
public int getResolution() {
return this.resolution;
}
/**
* Returns the line width correction.
* @return the correction
*/
public float getLineWidthCorrection() {
return this.lineWidthCorrection;
}
/**
* Controls whether GOCA is enabled or disabled.
* @param enabled true if GOCA is enabled, false if it is disabled
*/
public void setGOCAEnabled(boolean enabled) {
this.gocaEnabled = enabled;
}
/**
* Indicates whether GOCA is enabled or disabled.
* @return true if GOCA is enabled, false if GOCA is disabled
*/
public boolean isGOCAEnabled() {
return this.gocaEnabled;
}
/**
* Controls whether to stroke text in GOCA mode or to use text operators where possible.
* @param stroke true to stroke, false to paint with text operators where possible
*/
public void setStrokeGOCAText(boolean stroke) {
this.strokeGocaText = stroke;
}
/**
* Indicates whether to stroke text in GOCA mode or to use text operators where possible.
* @return true to stroke, false to paint with text operators where possible
*/
public boolean isStrokeGOCAText() {
return this.strokeGocaText;
}
/**
* Whether FS11 and SF45 non-inline images should be wrapped in a page segment
* @return true iff images should be wrapped
*/
public boolean getWrapPSeg() {
return pSeg;
}
/**
* Sets whether FS11 and FS45 non-inline images should be wrapped in a page segment
* @param pSeg true iff images should be wrapped
*/
public void setWrapPSeg(boolean pSeg) {
this.pSeg = pSeg;
}
public boolean getWrapGocaPSeg() {
return gocaPSeg;
}
public void setWrapGocaPSeg(boolean pSeg) {
this.gocaPSeg = pSeg;
}
public boolean isMetadataInObjectContainer() {
return metadataInObjectContainer;
}
public void setMetadataInObjectContainer(boolean metadataInObjectContainer) {
this.metadataInObjectContainer = metadataInObjectContainer;
}
/**
* gets whether images should be FS45
* @return true iff images should be FS45
*/
public boolean getFS45() {
return fs45;
}
/**
* sets whether images should be FS45
* @param fs45 true iff images should be FS45
*/
public void setFS45(boolean fs45) {
this.fs45 = fs45;
}
public boolean isMaskEnabled() {
return maskEnabled;
}
public void setMaskEnabled(boolean maskEnabled) {
this.maskEnabled = maskEnabled;
}
/** {@inheritDoc} */
@Override
protected AbstractData instantiateData() {
return new AFPData();
}
/** {@inheritDoc} */
@Override
protected AbstractPaintingState instantiate() {
return new AFPPaintingState();
}
/**
* Returns the painting state of the current page
*
* @return the painting state of the current page
*/
protected AFPPagePaintingState getPagePaintingState() {
return this.pagePaintingState;
}
/**
* Gets the current page fonts
*
* @return the current page fonts
*/
public AFPPageFonts getPageFonts() {
return pagePaintingState.getFonts();
}
/**
* Sets the page width
*
* @param pageWidth
* the page width
*/
public void setPageWidth(int pageWidth) {
pagePaintingState.setWidth(pageWidth);
}
/**
* Returns the page width
*
* @return the page width
*/
public int getPageWidth() {
return pagePaintingState.getWidth();
}
/**
* Sets the page height
*
* @param pageHeight
* the page height
*/
public void setPageHeight(int pageHeight) {
pagePaintingState.setHeight(pageHeight);
}
/**
* Returns the page height
*
* @return the page height
*/
public int getPageHeight() {
return pagePaintingState.getHeight();
}
/**
* Returns the page rotation
*
* @return the page rotation
*/
public int getPageRotation() {
return pagePaintingState.getOrientation();
}
/**
* Sets the uri of the current image
*
* @param uri
* the uri of the current image
*/
public void setImageUri(String uri) {
((AFPData) getData()).imageUri = uri;
}
/**
* Gets the uri of the current image
*
* @return the uri of the current image
*/
public String getImageUri() {
return ((AFPData) getData()).imageUri;
}
/**
* Returns the currently derived rotation
*
* @return the currently derived rotation
*/
public int getRotation() {
return getData().getDerivedRotation();
}
/**
* Returns the unit converter
*
* @return the unit converter
*/
public AFPUnitConverter getUnitConverter() {
return this.unitConv;
}
/**
* Returns a point on the current page, taking the current painting state
* into account.
*
* @param x
* the X-coordinate
* @param y
* the Y-coordinate
* @return a point on the current page
*/
public Point getPoint(int x, int y) {
Point p = new Point();
int rotation = getRotation();
switch (rotation) {
case 90:
p.x = y;
p.y = getPageWidth() - x;
break;
case 180:
p.x = getPageWidth() - x;
p.y = getPageHeight() - y;
break;
case 270:
p.x = getPageHeight() - y;
p.y = x;
break;
default:
p.x = x;
p.y = y;
break;
}
return p;
}
/** {@inheritDoc} */
@Override
public Object clone() {
AFPPaintingState paintingState = (AFPPaintingState) super.clone();
paintingState.pagePaintingState = (AFPPagePaintingState) this.pagePaintingState.clone();
paintingState.portraitRotation = this.portraitRotation;
paintingState.landscapeRotation = this.landscapeRotation;
paintingState.bitsPerPixel = this.bitsPerPixel;
paintingState.colorImages = this.colorImages;
paintingState.colorConverter = this.colorConverter;
paintingState.resolution = this.resolution;
return paintingState;
}
/** {@inheritDoc} */
@Override
public String toString() {
return "AFPPaintingState{" + "portraitRotation=" + portraitRotation
+ ", landscapeRotation=" + landscapeRotation + ", colorImages=" + colorImages
+ ", bitsPerPixel=" + bitsPerPixel + ", resolution=" + resolution + ", pageState="
+ pagePaintingState + super.toString() + "}";
}
/**
* Page level state data
*/
private class AFPPagePaintingState implements Cloneable {
/** page width */
private int width;
/** page height */
private int height;
/** page fonts */
private AFPPageFonts fonts = new AFPPageFonts();
/** page font count */
private int fontCount;
/** page orientation */
private int orientation;
/**
* Returns the page width
*
* @return the page width
*/
protected int getWidth() {
return width;
}
/**
* Sets the page width
*
* @param width
* the page width
*/
protected void setWidth(int width) {
this.width = width;
}
/**
* Returns the page height
*
* @return the page height
*/
protected int getHeight() {
return height;
}
/**
* Sets the page height
*
* @param height
* the page height
*/
protected void setHeight(int height) {
this.height = height;
}
/**
* Returns the page fonts
*
* @return the page fonts
*/
protected AFPPageFonts getFonts() {
return fonts;
}
/**
* Sets the current page fonts
*
* @param fonts
* the current page fonts
*/
protected void setFonts(AFPPageFonts fonts) {
this.fonts = fonts;
}
/**
* Increments and returns the current page font count
*
* @return increment and return the current page font count
*/
protected int incrementFontCount() {
return ++fontCount;
}
/**
* Returns the current page orientation
*
* @return the current page orientation
*/
protected int getOrientation() {
return orientation;
}
/**
* Sets the current page orientation
*
* @param orientation
* the current page orientation
*/
protected void setOrientation(int orientation) {
this.orientation = orientation;
}
/** {@inheritDoc} */
@Override
public Object clone() {
AFPPagePaintingState state = new AFPPagePaintingState();
state.width = this.width;
state.height = this.height;
state.orientation = this.orientation;
state.fonts = new AFPPageFonts(this.fonts);
state.fontCount = this.fontCount;
return state;
}
/** {@inheritDoc} */
@Override
public String toString() {
return "AFPPagePaintingState{width=" + width + ", height=" + height + ", orientation="
+ orientation + ", fonts=" + fonts + ", fontCount=" + fontCount + "}";
}
}
/**
* Block level state data
*/
// @SuppressFBWarnings("SE_INNER_CLASS")
private class AFPData extends org.apache.fop.util.AbstractPaintingState.AbstractData {
private static final long serialVersionUID = -1789481244175275686L;
/** The current fill status */
private boolean filled;
private String imageUri;
/** {@inheritDoc} */
@Override
public Object clone() {
AFPData obj = (AFPData) super.clone();
obj.filled = this.filled;
obj.imageUri = this.imageUri;
return obj;
}
/** {@inheritDoc} */
@Override
public String toString() {
return "AFPData{" + super.toString() + ", filled=" + filled + ", imageUri=" + imageUri
+ "}";
}
/** {@inheritDoc} */
@Override
protected AbstractData instantiate() {
return new AFPData();
}
}
}
@@ -0,0 +1,200 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.afp;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.geom.AffineTransform;
import java.awt.geom.Point2D;
import java.awt.image.BufferedImage;
import java.awt.image.DataBufferByte;
import java.awt.image.RenderedImage;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import org.apache.xmlgraphics.image.loader.ImageSize;
import org.apache.xmlgraphics.java2d.color.ColorWithAlternatives;
import org.apache.xmlgraphics.util.MimeConstants;
import org.apache.fop.util.bitmap.BitmapImageUtil;
/**
* A painter of rectangles in AFP
*/
public class AFPRectanglePainter extends AbstractAFPPainter {
private AFPResourceManager resourceManager;
/**
* Main constructor
*
* @param paintingState the AFP painting state
* @param dataStream the AFP datastream
*/
public AFPRectanglePainter(AFPPaintingState paintingState, DataStream dataStream,
AFPResourceManager resourceManager) {
super(paintingState, dataStream);
this.resourceManager = resourceManager;
}
/** {@inheritDoc} */
public void paint(PaintingInfo paintInfo) throws IOException {
Color color = paintingState.getColor();
if (color instanceof ColorWithAlternatives && color.getAlpha() != 255) {
paintAlpha(paintInfo);
return;
}
RectanglePaintingInfo rectanglePaintInfo = (RectanglePaintingInfo)paintInfo;
int pageWidth = dataStream.getCurrentPage().getWidth();
int pageHeight = dataStream.getCurrentPage().getHeight();
int yNew;
AFPUnitConverter unitConv = paintingState.getUnitConverter();
float width = unitConv.pt2units(rectanglePaintInfo.getWidth());
float height = unitConv.pt2units(rectanglePaintInfo.getHeight());
float x = unitConv.pt2units(rectanglePaintInfo.getX());
float y = unitConv.pt2units(rectanglePaintInfo.getY());
AffineTransform at = paintingState.getData().getTransform();
AFPLineDataInfo lineDataInfo = new AFPLineDataInfo();
lineDataInfo.setColor(paintingState.getColor());
lineDataInfo.setRotation(paintingState.getRotation());
lineDataInfo.setThickness(Math.round(height));
switch (lineDataInfo.getRotation()) {
case 90:
lineDataInfo.setX1(Math.round((float)at.getTranslateY() + x));
yNew = pageWidth - Math.round((float)at.getTranslateX()) + Math.round(y);
lineDataInfo.setY1(yNew);
lineDataInfo.setY2(yNew);
lineDataInfo.setX2(Math.round(width + (float)at.getTranslateY() + x));
break;
case 180:
lineDataInfo.setX1(pageWidth - Math.round((float)at.getTranslateX() - x));
yNew = pageHeight - Math.round((float)at.getTranslateY() - y);
lineDataInfo.setY1(yNew);
lineDataInfo.setY2(yNew);
lineDataInfo.setX2(pageWidth - Math.round((float)at.getTranslateX() - x - width));
break;
case 270:
lineDataInfo.setX1(pageHeight - Math.round((float)at.getTranslateY() - x));
yNew = Math.round((float)at.getTranslateX() + y);
lineDataInfo.setY1(yNew);
lineDataInfo.setY2(yNew);
lineDataInfo.setX2(pageHeight - Math.round((float)at.getTranslateY() - x - width));
break;
case 0:
default:
lineDataInfo.setX1(Math.round((float)at.getTranslateX() + x));
yNew = Math.round((float)at.getTranslateY() + y);
lineDataInfo.setY1(yNew);
lineDataInfo.setY2(yNew);
lineDataInfo.setX2(Math.round((float)at.getTranslateX() + x + width));
break;
}
dataStream.createLine(lineDataInfo);
}
private void paintAlpha(PaintingInfo paintInfo) throws IOException {
RectanglePaintingInfo rectanglePaintInfo = (RectanglePaintingInfo)paintInfo;
if (rectanglePaintInfo.getWidth() <= 0 || rectanglePaintInfo.getHeight() <= 0) {
return;
}
Dimension size = new Dimension((int)rectanglePaintInfo.getWidth(), (int)rectanglePaintInfo.getHeight());
AFPImageObjectInfo imageObjectInfo = new AFPImageObjectInfo();
imageObjectInfo.setMimeType(MimeConstants.MIME_AFP_IOCA_FS45);
imageObjectInfo.getResourceInfo().setLevel(new AFPResourceLevel(AFPResourceLevel.ResourceType.INLINE));
imageObjectInfo.getResourceInfo().setImageDimension(size);
imageObjectInfo.setColor(true);
int width = size.width;
int height = size.height;
int resolution = paintingState.getResolution();
ImageSize bitmapSize = new ImageSize(width, height, resolution);
imageObjectInfo.setDataHeightRes((int)Math.round(bitmapSize.getDpiHorizontal() * 10));
imageObjectInfo.setDataWidthRes((int)Math.round(bitmapSize.getDpiVertical() * 10));
imageObjectInfo.setDataWidth(width);
imageObjectInfo.setDataHeight(height);
Color color = paintingState.getColor();
byte[] image = buildImage(color, width, height);
imageObjectInfo.setData(image);
if (color instanceof ColorWithAlternatives) {
imageObjectInfo.setBitsPerPixel(32);
} else {
imageObjectInfo.setBitsPerPixel(24);
}
image = buildMaskImage(color, width, height);
imageObjectInfo.setTransparencyMask(image);
int rotation = paintingState.getRotation();
AffineTransform at = paintingState.getData().getTransform();
Point2D origin = at.transform(new Point2D.Float(
rectanglePaintInfo.getX() * 1000,
rectanglePaintInfo.getY() * 1000), null);
AFPUnitConverter unitConv = paintingState.getUnitConverter();
float widthf = unitConv.pt2units(rectanglePaintInfo.getWidth());
float heightf = unitConv.pt2units(rectanglePaintInfo.getHeight());
AFPObjectAreaInfo objectAreaInfo = new AFPObjectAreaInfo(
(int) Math.round(origin.getX()),
(int) Math.round(origin.getY()),
Math.round(widthf), Math.round(heightf), resolution, rotation);
imageObjectInfo.setObjectAreaInfo(objectAreaInfo);
resourceManager.createObject(imageObjectInfo);
}
private byte[] buildImage(Color color, int width, int height) {
float[] components;
if (color instanceof ColorWithAlternatives) {
components = ((ColorWithAlternatives)color).getAlternativeColors()[0].getColorComponents(null);
} else {
components = color.getColorComponents(null);
}
ByteArrayOutputStream bos = new ByteArrayOutputStream();
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
for (float component : components) {
component *= 255;
bos.write((byte)component);
}
}
}
return bos.toByteArray();
}
private byte[] buildMaskImage(Color color, int width, int height) {
BufferedImage bufferedImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
Graphics graphics = bufferedImage.getGraphics();
Color alpha = new Color(color.getAlpha(), color.getAlpha(), color.getAlpha());
graphics.setColor(alpha);
graphics.fillRect(0, 0, width, height);
graphics.dispose();
RenderedImage renderedImage =
BitmapImageUtil.convertToMonochrome(bufferedImage, new Dimension(width, height), 1);
DataBufferByte bufferByte = (DataBufferByte) renderedImage.getData().getDataBuffer();
return bufferByte.getData();
}
}
@@ -0,0 +1,177 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.afp;
import java.awt.Dimension;
import org.apache.fop.afp.AFPResourceLevel.ResourceType;
/**
* The level at which a resource is to reside in the AFP output
*/
public class AFPResourceInfo {
/** the general default resource level */
public static final AFPResourceLevel DEFAULT_LEVEL
= new AFPResourceLevel(ResourceType.PRINT_FILE);
/** the URI of this resource */
private String uri;
/**
* the image dimension in page coordinates (non-null only when page segments are
* generated because the cannot be scaled for painting).
*/
private Dimension imageDimension;
/** the reference name of this resource */
private String name;
/** the resource level of this resource */
private AFPResourceLevel level = DEFAULT_LEVEL;
/** true when the resource level was changed */
private boolean levelChanged;
/**
* Sets the data object URI.
*
* @param uri the data object URI
*/
public void setUri(String uri) {
this.uri = uri;
}
/**
* Returns the URI of this data object.
*
* @return the URI of this data object
*/
public String getUri() {
return uri;
}
/**
* Sets an optional image dimension (in page coordinates). This is only used if
* a page segment is created for this resource as page segments cannot be rescaled
* for painting.
* @param dim the image dimension (in page coordinates)
*/
public void setImageDimension(Dimension dim) {
this.imageDimension = dim;
}
/**
* Returns an optional image dimension (in page coordinates). This is only used if
* a page segment is created for this resource as page segments cannot be rescaled
* for painting.
* @return the image dimension (or null if not applicable)
*/
public Dimension getImageDimension() {
return this.imageDimension;
}
/**
* Sets the resource reference name
*
* @param resourceName the resource reference name
*/
public void setName(String resourceName) {
this.name = resourceName;
}
/**
* Returns the resource reference name
*
* @return the resource reference name
*/
public String getName() {
return this.name;
}
/**
* Returns the resource level
*
* @return the resource level
*/
public AFPResourceLevel getLevel() {
if (level == null) {
return DEFAULT_LEVEL;
}
return this.level;
}
/**
* Sets the resource level
*
* @param resourceLevel the resource level
*/
public void setLevel(AFPResourceLevel resourceLevel) {
this.level = resourceLevel;
levelChanged = true;
}
/**
* Returns true when the resource level was set
*
* @return true when the resource level was set
*/
public boolean levelChanged() {
return levelChanged;
}
/** {@inheritDoc} */
public String toString() {
return "AFPResourceInfo{uri=" + uri
+ (imageDimension != null
? ", " + imageDimension.width + "x" + imageDimension.height : "")
+ (name != null ? ", name=" + name : "")
+ (level != null ? ", level=" + level : "")
+ "}";
}
/** {@inheritDoc} */
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if ((obj == null) || !(obj instanceof AFPResourceInfo)) {
return false;
}
AFPResourceInfo ri = (AFPResourceInfo)obj;
return (uri == ri.uri || uri != null && uri.equals(ri.uri))
&& (imageDimension == ri.imageDimension
|| imageDimension != null && imageDimension.equals(ri.imageDimension))
&& (name == ri.name || name != null && name.equals(ri.name))
&& (level == ri.level || level != null && level.equals(ri.level));
}
/** {@inheritDoc} */
public int hashCode() {
int hash = 7;
hash = 31 * hash + (null == uri ? 0 : uri.hashCode());
hash = 31 * hash + (null == imageDimension ? 0 : imageDimension.hashCode());
hash = 31 * hash + (null == name ? 0 : name.hashCode());
hash = 31 * hash + (null == level ? 0 : level.hashCode());
return hash;
}
}
@@ -0,0 +1,191 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.afp;
import java.net.URI;
import static org.apache.fop.afp.AFPResourceLevel.ResourceType.DOCUMENT;
import static org.apache.fop.afp.AFPResourceLevel.ResourceType.EXTERNAL;
import static org.apache.fop.afp.AFPResourceLevel.ResourceType.INLINE;
import static org.apache.fop.afp.AFPResourceLevel.ResourceType.PAGE;
import static org.apache.fop.afp.AFPResourceLevel.ResourceType.PAGE_GROUP;
import static org.apache.fop.afp.AFPResourceLevel.ResourceType.PRINT_FILE;
/**
* A resource level
*/
public class AFPResourceLevel {
public enum ResourceType {
/** directly in page **/
INLINE("inline"),
/** page level **/
PAGE("page"),
/** page group level **/
PAGE_GROUP("page-group"),
/** document level **/
DOCUMENT("document"),
/** print file level **/
PRINT_FILE("print-file"),
/** external level **/
EXTERNAL("external");
private final String name;
private ResourceType(String name) {
this.name = name;
}
public static ResourceType getValueOf(String levelString) {
for (ResourceType resType : ResourceType.values()) {
if (resType.name.equalsIgnoreCase(levelString)) {
return resType;
}
}
return null;
}
public String getName() {
return name;
}
}
private URI extUri;
private final ResourceType resourceType;
/**
* Sets the resource placement level within the AFP output
*
* @param levelString the resource level (page, page-group, document, print-file or external)
* @return true if the resource level was successfully set
*/
public static AFPResourceLevel valueOf(String levelString) {
ResourceType resType = ResourceType.getValueOf(levelString);
return resType != null ? new AFPResourceLevel(resType) : null;
}
/**
* Main constructor
*
* @param resourceType the resource type
*/
public AFPResourceLevel(ResourceType resourceType) {
this.resourceType = resourceType;
}
/**
* Returns true if this is at page level
*
* @return true if this is at page level
*/
public boolean isPage() {
return resourceType == PAGE;
}
/**
* Returns true if this is at page group level
*
* @return true if this is at page group level
*/
public boolean isPageGroup() {
return resourceType == PAGE_GROUP;
}
/**
* Returns true if this is at document level
*
* @return true if this is at document level
*/
public boolean isDocument() {
return resourceType == DOCUMENT;
}
/**
* Returns true if this is at external level
*
* @return true if this is at external level
*/
public boolean isExternal() {
return resourceType == EXTERNAL;
}
/**
* Returns true if this is at print-file level
*
* @return true if this is at print-file level
*/
public boolean isPrintFile() {
return resourceType == PRINT_FILE;
}
/**
* Returns true if this resource level is inline
*
* @return true if this resource level is inline
*/
public boolean isInline() {
return resourceType == INLINE;
}
/**
* Returns the URI of the external resource group.
*
* @return the destination URI of the external resource group
*/
public URI getExternalURI() {
return this.extUri;
}
/**
* Sets the URI of the external resource group.
*
* @param uri the URI of the external resource group
*/
public void setExternalUri(URI uri) {
this.extUri = uri;
}
/** {@inheritDoc} */
public String toString() {
return resourceType + (isExternal() ? ", uri=" + extUri : "");
}
/** {@inheritDoc} */
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if ((obj == null) || !(obj instanceof AFPResourceLevel)) {
return false;
}
AFPResourceLevel rl = (AFPResourceLevel)obj;
return (resourceType == rl.resourceType)
&& (extUri == rl.extUri
|| extUri != null && extUri.equals(rl.extUri));
}
/** {@inheritDoc} */
public int hashCode() {
int hash = 7;
hash = 31 * hash + resourceType.hashCode();
hash = 31 * hash + (null == extUri ? 0 : extUri.hashCode());
return hash;
}
}
@@ -0,0 +1,112 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.afp;
import java.util.Map;
import org.apache.fop.afp.AFPResourceLevel.ResourceType;
import org.apache.fop.afp.modca.ResourceObject;
/**
* This class holds resource levels defaults for the various resource types.
*/
public class AFPResourceLevelDefaults {
private static final Map RESOURCE_TYPE_NAMES = new java.util.HashMap();
public static final byte TYPE_SVG = Byte.MAX_VALUE;
static {
//Map to be extended as need arises:
registerResourceTypeName("goca", ResourceObject.TYPE_GRAPHIC);
registerResourceTypeName("bitmap", ResourceObject.TYPE_IMAGE);
registerResourceTypeName("svg", TYPE_SVG);
}
private static void registerResourceTypeName(String name, byte type) {
RESOURCE_TYPE_NAMES.put(name.toLowerCase(), type);
}
private static byte getResourceType(String resourceTypeName) {
Byte result = (Byte)RESOURCE_TYPE_NAMES.get(resourceTypeName.toLowerCase());
if (result == null) {
throw new IllegalArgumentException("Unknown resource type name: " + resourceTypeName);
}
return result;
}
private Map defaultResourceLevels = new java.util.HashMap();
/**
* Creates a new instance with default values.
*/
public AFPResourceLevelDefaults() {
// level not explicitly set/changed so default to inline for GOCA graphic objects
// (due to a bug in the IBM AFP Workbench Viewer (2.04.01.07), hard copy works just fine)
setDefaultResourceLevel(ResourceObject.TYPE_GRAPHIC,
new AFPResourceLevel(ResourceType.INLINE));
setDefaultResourceLevel(TYPE_SVG, new AFPResourceLevel(ResourceType.INLINE));
}
/**
* Sets the default resource level for a particular resource type.
* @param type the resource type name
* @param level the resource level
*/
public void setDefaultResourceLevel(String type, AFPResourceLevel level) {
setDefaultResourceLevel(getResourceType(type), level);
}
/**
* Sets the default resource level for a particular resource type.
* @param type the resource type ({@link ResourceObject}.TYPE_*)
* @param level the resource level
*/
public void setDefaultResourceLevel(byte type, AFPResourceLevel level) {
this.defaultResourceLevels.put(type, level);
}
/**
* Returns the default resource level for a particular resource type.
* @param type the resource type ({@link ResourceObject}.TYPE_*)
* @return the default resource level
*/
public AFPResourceLevel getDefaultResourceLevel(byte type) {
AFPResourceLevel result = (AFPResourceLevel)this.defaultResourceLevels.get(type);
if (result == null) {
result = AFPResourceInfo.DEFAULT_LEVEL;
}
return result;
}
/**
* Allows to merge the values from one instance into another. Values from the instance passed
* in as a parameter override values of this instance.
* @param other the other instance to get the defaults from
*/
public void mergeFrom(AFPResourceLevelDefaults other) {
for (Object o : other.defaultResourceLevels.entrySet()) {
Map.Entry entry = (Map.Entry) o;
Byte type = (Byte) entry.getKey();
AFPResourceLevel level = (AFPResourceLevel) entry.getValue();
this.defaultResourceLevels.put(type, level);
}
}
}
@@ -0,0 +1,516 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.afp;
import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.io.IOUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.fop.afp.AFPResourceLevel.ResourceType;
import org.apache.fop.afp.fonts.AFPFont;
import org.apache.fop.afp.fonts.CharacterSet;
import org.apache.fop.afp.modca.AbstractNamedAFPObject;
import org.apache.fop.afp.modca.AbstractPageObject;
import org.apache.fop.afp.modca.IncludeObject;
import org.apache.fop.afp.modca.IncludedResourceObject;
import org.apache.fop.afp.modca.PageSegment;
import org.apache.fop.afp.modca.Registry;
import org.apache.fop.afp.modca.ResourceGroup;
import org.apache.fop.afp.modca.ResourceObject;
import org.apache.fop.afp.util.AFPResourceAccessor;
import org.apache.fop.afp.util.AFPResourceUtil;
import org.apache.fop.apps.io.InternalResourceResolver;
import org.apache.fop.fonts.CMapSegment;
import org.apache.fop.fonts.FontType;
import org.apache.fop.render.afp.AFPFontConfig;
/**
* Manages the creation and storage of document resources
*/
public class AFPResourceManager {
/** logging instance */
private static Log log = LogFactory.getLog(AFPResourceManager.class);
/** The AFP datastream (document tree) */
private DataStream dataStream;
/** Resource creation factory */
private final Factory factory;
private final AFPStreamer streamer;
private final AFPDataObjectFactory dataObjectFactory;
/** Maintain a reference count of instream objects for referencing purposes */
private int instreamObjectCount;
/** Mapping of resourceInfo to AbstractCachedObject */
private final Map<AFPResourceInfo, List<AbstractCachedObject>> includeObjectCache =
new HashMap<AFPResourceInfo, List<AbstractCachedObject>>();
private AFPResourceLevelDefaults resourceLevelDefaults = new AFPResourceLevelDefaults();
protected boolean includeCached = true;
private Map<AFPResourceInfo, AFPTrailerFont> trailerFonts = new HashMap<>();
/**
* Main constructor
*
* @param resourceResolver the associated {@link InternalResourceResolver} instance
*/
public AFPResourceManager(InternalResourceResolver resourceResolver) {
this.factory = new Factory();
this.streamer = new AFPStreamer(factory, resourceResolver);
this.dataObjectFactory = new AFPDataObjectFactory(factory);
}
/**
* Sets the outputstream
*
* @param paintingState the AFP painting state
* @param outputStream the outputstream
* @return a new AFP DataStream
* @throws IOException thrown if an I/O exception of some sort has occurred
*/
public DataStream createDataStream(AFPPaintingState paintingState, OutputStream outputStream)
throws IOException {
this.dataStream = streamer.createDataStream(paintingState);
streamer.setOutputStream(outputStream);
return this.dataStream;
}
/**
* Returns the AFP DataStream
*
* @return the AFP DataStream
*/
public DataStream getDataStream() {
return this.dataStream;
}
/**
* Tells the streamer to write
*
* @throws IOException thrown if an I/O exception of some sort has occurred.
*/
public void writeToStream() throws IOException {
for (AFPTrailerFont font : trailerFonts.values()) {
font.build();
}
streamer.close();
}
/**
* Sets the default resource group URI.
*
* @param uri the default resource group URI
*/
public void setDefaultResourceGroupUri(URI uri) {
streamer.setDefaultResourceGroupUri(uri);
}
/**
* Tries to create an include of a data object that has been previously added to the
* AFP data stream. If no such object was available, the method returns false which serves
* as a signal that the object has to be created.
* @param dataObjectInfo the data object info
* @return true if the inclusion succeeded, false if the object was not available
* @throws IOException thrown if an I/O exception of some sort has occurred.
*/
public boolean tryIncludeObject(AFPDataObjectInfo dataObjectInfo) throws IOException {
AFPResourceInfo resourceInfo = dataObjectInfo.getResourceInfo();
updateResourceInfoUri(resourceInfo);
return includeCachedObject(resourceInfo, dataObjectInfo.getObjectAreaInfo());
}
/**
* Creates a new data object in the AFP datastream
*
* @param dataObjectInfo the data object info
*
* @throws IOException thrown if an I/O exception of some sort has occurred.
*/
public void createObject(AFPDataObjectInfo dataObjectInfo) throws IOException {
if (tryIncludeObject(dataObjectInfo)) {
//Object has already been produced and is available by inclusion, so return early.
return;
}
AbstractNamedAFPObject namedObj = null;
AFPResourceInfo resourceInfo = dataObjectInfo.getResourceInfo();
boolean useInclude = true;
Registry.ObjectType objectType = null;
// new resource so create
if (dataObjectInfo.isUseIocaImages() && dataObjectInfo instanceof AFPImageObjectInfo) {
AFPImageObjectInfo imageObjectInfo = (AFPImageObjectInfo)dataObjectInfo;
namedObj = dataObjectFactory.createImage(imageObjectInfo);
} else if (dataObjectInfo instanceof AFPGraphicsObjectInfo) {
AFPGraphicsObjectInfo graphicsObjectInfo = (AFPGraphicsObjectInfo)dataObjectInfo;
namedObj = dataObjectFactory.createGraphic(graphicsObjectInfo);
} else {
// natively embedded data object
namedObj = dataObjectFactory.createObjectContainer(dataObjectInfo);
objectType = dataObjectInfo.getObjectType();
useInclude = objectType != null && objectType.isIncludable();
}
AFPResourceLevel resourceLevel = resourceInfo.getLevel();
ResourceGroup resourceGroup = streamer.getResourceGroup(resourceLevel);
useInclude &= resourceGroup != null;
if (useInclude) {
final boolean usePageSegment = dataObjectInfo.isCreatePageSegment();
// if it is to reside within a resource group at print-file or external level
if (resourceLevel.isPrintFile() || resourceLevel.isExternal()) {
if (usePageSegment) {
String pageSegmentName = "S10" + namedObj.getName().substring(3);
namedObj.setName(pageSegmentName);
PageSegment seg = new PageSegment(pageSegmentName);
seg.addObject(namedObj);
namedObj = seg;
}
// wrap newly created data object in a resource object
namedObj = dataObjectFactory.createResource(namedObj, resourceInfo, objectType, dataObjectInfo);
}
// add data object into its resource group destination
resourceGroup.addObject(namedObj);
includeObject(namedObj, dataObjectInfo);
} else {
// not to be included so inline data object directly into the current page
dataStream.getCurrentPage().addObject(namedObj);
}
}
private abstract class AbstractCachedObject {
protected String objectName;
protected AFPDataObjectInfo dataObjectInfo;
public AbstractCachedObject(String objectName, AFPDataObjectInfo dataObjectInfo) {
this.objectName = objectName;
this.dataObjectInfo = dataObjectInfo;
}
protected abstract void includeObject();
}
private class CachedPageSegment extends AbstractCachedObject {
public CachedPageSegment(String objectName, AFPDataObjectInfo dataObjectInfo) {
super(objectName, dataObjectInfo);
}
protected void includeObject() {
includePageSegment(dataObjectInfo, objectName);
}
}
private class CachedObject extends AbstractCachedObject {
public CachedObject(String objectName, AFPDataObjectInfo dataObjectInfo) {
super(objectName, dataObjectInfo);
}
protected void includeObject() {
AFPResourceManager.this.includeObject(dataObjectInfo, objectName);
}
}
private void includeObject(AbstractNamedAFPObject namedObj, AFPDataObjectInfo dataObjectInfo) {
// create the include object
String objectName = namedObj.getName();
AbstractCachedObject cachedObject;
if (dataObjectInfo.isCreatePageSegment()) {
cachedObject = new CachedPageSegment(objectName, dataObjectInfo);
} else {
cachedObject = new CachedObject(objectName, dataObjectInfo);
}
cachedObject.includeObject();
addToCache(dataObjectInfo.getResourceInfo(), cachedObject);
//The data field of dataObjectInfo is not further required
// therefore we are safe to null the reference, saving memory
dataObjectInfo.setData(null);
}
private void addToCache(AFPResourceInfo resourceInfo, AbstractCachedObject cachedObject) {
List<AbstractCachedObject> objs = includeObjectCache.get(resourceInfo);
if (objs == null) {
objs = new ArrayList<AbstractCachedObject>();
includeObjectCache.put(resourceInfo, objs);
}
objs.add(cachedObject);
}
/**
* Returns {@code true} if the passed {@link AFPResourceInfo} instance is already cached.
*
* @param resourceInfo the resource info to check
* @return {@code true} if the object is cached
*/
public boolean isObjectCached(AFPResourceInfo resourceInfo) {
return includeObjectCache.containsKey(resourceInfo);
}
/**
*
* @param resourceInfo the resource info to check
* @param areaInfo the area info to check
* @return {@code true} if ...
*/
public boolean includeCachedObject(AFPResourceInfo resourceInfo, AFPObjectAreaInfo areaInfo) {
List<AbstractCachedObject> cachedObjectList = includeObjectCache.get(resourceInfo);
if (cachedObjectList != null && includeCached) {
for (AbstractCachedObject cachedObject : cachedObjectList) {
if (areaInfo != null && cachedObjectList.size() == 1) {
cachedObject.dataObjectInfo.setObjectAreaInfo(areaInfo);
}
cachedObject.includeObject();
}
return true;
} else {
return false;
}
}
private void updateResourceInfoUri(AFPResourceInfo resourceInfo) {
String uri = resourceInfo.getUri();
if (uri == null) {
uri = "/";
}
// if this is an instream data object adjust the uri to ensure that its unique
if (uri.endsWith("/")) {
uri += "#" + (++instreamObjectCount);
resourceInfo.setUri(uri);
}
}
private void includeObject(AFPDataObjectInfo dataObjectInfo,
String objectName) {
IncludeObject includeObject = dataObjectFactory.createInclude(objectName, dataObjectInfo);
dataStream.getCurrentPage().addObject(includeObject);
}
/**
* Handles font embedding. If a font is embeddable and has not already been embedded it will be.
* @param afpFont the AFP font to be checked for embedding
* @param charSet the associated character set
* @throws IOException if there's a problem while embedding the external resources
*/
public void embedFont(AFPFont afpFont, CharacterSet charSet)
throws IOException {
if (afpFont.isEmbeddable()) {
//Embed fonts (char sets and code pages)
if (charSet.getResourceAccessor() != null) {
AFPResourceAccessor accessor = charSet.getResourceAccessor();
if (afpFont.getFontType() == FontType.TRUETYPE) {
AFPFontConfig.AFPTrueTypeFont ttf = (AFPFontConfig.AFPTrueTypeFont) afpFont;
CMapSegment[] cmap = ttf.hasPrivateUseSubstitutions() ? ttf.getCMap() : null;
createIncludedResource(afpFont.getFontName(),
ttf.getUri(), accessor,
ResourceObject.TYPE_OBJECT_CONTAINER, true,
ttf.getTTC(), cmap);
} else {
createIncludedResource(
charSet.getName(), accessor,
ResourceObject.TYPE_FONT_CHARACTER_SET);
createIncludedResource(
charSet.getCodePage(), accessor,
ResourceObject.TYPE_CODE_PAGE);
}
}
}
}
private void includePageSegment(AFPDataObjectInfo dataObjectInfo,
String pageSegmentName) {
int x = dataObjectInfo.getObjectAreaInfo().getX();
int y = dataObjectInfo.getObjectAreaInfo().getY();
AbstractPageObject currentPage = dataStream.getCurrentPage();
boolean createHardPageSegments = true;
currentPage.createIncludePageSegment(pageSegmentName, x, y, createHardPageSegments);
}
/**
* Creates an included resource object by loading the contained object from a file.
* @param resourceName the name of the resource
* @param accessor resource accessor to access the resource with
* @param resourceObjectType the resource object type ({@link ResourceObject}.*)
* @throws IOException if an I/O error occurs while loading the resource
*/
public void createIncludedResource(String resourceName, AFPResourceAccessor accessor,
byte resourceObjectType) throws IOException {
URI uri;
try {
uri = new URI(resourceName.trim());
} catch (URISyntaxException e) {
throw new IOException("Could not create URI from resource name: " + resourceName
+ " (" + e.getMessage() + ")");
}
createIncludedResource(resourceName, uri, accessor, resourceObjectType, false, null, null);
}
/**
* Creates an included resource object by loading the contained object from a file.
* @param resourceName the name of the resource
* @param uri the URI for the resource
* @param accessor resource accessor to access the resource with
* @param resourceObjectType the resource object type ({@link ResourceObject}.*)
* @throws IOException if an I/O error occurs while loading the resource
*/
public void createIncludedResource(String resourceName, URI uri, AFPResourceAccessor accessor,
byte resourceObjectType, boolean truetype, String ttc,
CMapSegment[] cmap) throws IOException {
AFPResourceLevel resourceLevel = new AFPResourceLevel(ResourceType.PRINT_FILE);
AFPResourceInfo resourceInfo = new AFPResourceInfo();
resourceInfo.setLevel(resourceLevel);
resourceInfo.setName(resourceName);
resourceInfo.setUri(uri.toASCIIString());
List<AbstractCachedObject> cachedObject = includeObjectCache.get(resourceInfo);
if (cachedObject == null) {
if (log.isDebugEnabled()) {
log.debug("Adding included resource: " + resourceName);
}
ResourceGroup resourceGroup = streamer.getResourceGroup(resourceLevel);
if (truetype) {
trailerFonts.put(resourceInfo,
new AFPTrailerFont(accessor, uri, ttc, cmap, resourceName, resourceGroup, factory));
} else {
ResourceObject resourceObject = factory.createResource(resourceName);
IncludedResourceObject resourceContent = new IncludedResourceObject(
resourceName, accessor, uri);
resourceObject.setDataObject(resourceContent);
resourceObject.setType(resourceObjectType);
resourceGroup.addObject(resourceObject);
}
//TODO what is the data object?
CachedObject newcachedObject = new CachedObject(resourceName, null);
// record mapping of resource info to data object resource name
addToCache(resourceInfo, newcachedObject);
} else if (truetype) {
trailerFonts.get(resourceInfo).cmap = cmap;
}
}
/**
* Creates an included resource extracting the named resource from an external source.
* @param resourceName the name of the resource
* @param uri the URI for the resource
* @param accessor resource accessor to access the resource with
* @throws IOException if an I/O error occurs while loading the resource
*/
public void createIncludedResourceFromExternal(final String resourceName,
final URI uri, final AFPResourceAccessor accessor) throws IOException {
AFPResourceLevel resourceLevel = new AFPResourceLevel(ResourceType.PRINT_FILE);
AFPResourceInfo resourceInfo = new AFPResourceInfo();
resourceInfo.setLevel(resourceLevel);
resourceInfo.setName(resourceName);
resourceInfo.setUri(uri.toASCIIString());
List<AbstractCachedObject> resource = includeObjectCache.get(resourceInfo);
if (resource == null) {
ResourceGroup resourceGroup = streamer.getResourceGroup(resourceLevel);
//resourceObject delegates write commands to copyNamedResource()
//The included resource may already be wrapped in a resource object
AbstractNamedAFPObject resourceObject = new AbstractNamedAFPObject(null) {
@Override
protected void writeContent(OutputStream os) throws IOException {
InputStream inputStream = null;
try {
inputStream = accessor.createInputStream(uri);
BufferedInputStream bin = new BufferedInputStream(inputStream);
AFPResourceUtil.copyNamedResource(resourceName, bin, os);
} finally {
IOUtils.closeQuietly(inputStream);
}
}
//bypass super.writeStart
@Override
protected void writeStart(OutputStream os) throws IOException { }
//bypass super.writeEnd
@Override
protected void writeEnd(OutputStream os) throws IOException { }
};
resourceGroup.addObject(resourceObject);
CachedObject newresource = new CachedObject(resourceName, null);
addToCache(resourceInfo, newresource);
}
}
/**
* Sets resource level defaults. The existing defaults over merged with the ones passed in
* as parameter.
* @param defaults the new defaults
*/
public void setResourceLevelDefaults(AFPResourceLevelDefaults defaults) {
this.resourceLevelDefaults.mergeFrom(defaults);
}
/**
* Returns the resource level defaults in use with this resource manager.
* @return the resource level defaults
*/
public AFPResourceLevelDefaults getResourceLevelDefaults() {
return this.resourceLevelDefaults;
}
}
@@ -0,0 +1,194 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.afp;
import java.io.BufferedOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URI;
import java.util.HashMap;
import java.util.Map;
import org.apache.commons.io.IOUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.xmlgraphics.io.TempResourceURIGenerator;
import org.apache.fop.afp.modca.ResourceGroup;
import org.apache.fop.afp.modca.StreamedResourceGroup;
import org.apache.fop.apps.io.InternalResourceResolver;
/**
* Manages the streaming of the AFP output
*/
public class AFPStreamer implements Streamable {
/** Static logging instance */
private static final Log LOG = LogFactory.getLog(AFPStreamer.class);
private static final String DEFAULT_EXTERNAL_RESOURCE_FILENAME = "resources.afp";
private static final TempResourceURIGenerator TEMP_URI_GENERATOR
= new TempResourceURIGenerator("AFPDataStream_");
private final Factory factory;
private final InternalResourceResolver resourceResolver;
/** A mapping of external resource destinations to resource groups */
private final Map<URI, ResourceGroup> pathResourceGroupMap = new HashMap<URI, ResourceGroup>();
private StreamedResourceGroup printFileResourceGroup;
/** Sets the default resource group file path */
private URI defaultResourceGroupUri;
private final URI tempUri;
/** temporary document outputstream */
private OutputStream tempOutputStream;
/** the final outputstream */
private OutputStream outputStream;
private DataStream dataStream;
/**
* Main constructor
*
* @param factory a factory
* @param resourceResolver resource resolver
*/
public AFPStreamer(Factory factory, InternalResourceResolver resourceResolver) {
this.factory = factory;
this.resourceResolver = resourceResolver;
this.tempUri = TEMP_URI_GENERATOR.generate();
defaultResourceGroupUri = URI.create(DEFAULT_EXTERNAL_RESOURCE_FILENAME);
}
/**
* Creates a new DataStream
*
* @param paintingState the AFP painting state
* @return a new {@link DataStream}
* @throws IOException thrown if an I/O exception of some sort has occurred
*/
public DataStream createDataStream(AFPPaintingState paintingState) throws IOException {
this.tempOutputStream = new BufferedOutputStream(resourceResolver.getOutputStream(tempUri));
this.dataStream = factory.createDataStream(paintingState, tempOutputStream);
return dataStream;
}
/**
* Sets the default resource group URI.
*
* @param uri the default resource group URI
*/
public void setDefaultResourceGroupUri(URI uri) {
this.defaultResourceGroupUri = uri;
}
/**
* Returns the resource group for a given resource info
*
* @param level a resource level
* @return a resource group for the given resource info
*/
public ResourceGroup getResourceGroup(AFPResourceLevel level) {
ResourceGroup resourceGroup = null;
if (level.isInline()) { // no resource group for inline level
return null;
}
if (level.isExternal()) {
URI uri = level.getExternalURI();
if (uri == null) {
LOG.warn("No file path provided for external resource, using default.");
uri = defaultResourceGroupUri;
}
resourceGroup = pathResourceGroupMap.get(uri);
if (resourceGroup == null) {
OutputStream os = null;
try {
os = new BufferedOutputStream(resourceResolver.getOutputStream(uri));
} catch (IOException ioe) {
LOG.error("Failed to create/open external resource group for uri '"
+ uri + "'");
} finally {
if (os != null) {
resourceGroup = factory.createStreamedResourceGroup(os);
pathResourceGroupMap.put(uri, resourceGroup);
}
}
}
} else if (level.isPrintFile()) {
if (printFileResourceGroup == null) {
// use final outputstream for print-file resource group
printFileResourceGroup = factory.createStreamedResourceGroup(outputStream);
}
resourceGroup = printFileResourceGroup;
} else {
// resource group in afp document datastream
resourceGroup = dataStream.getResourceGroup(level);
}
return resourceGroup;
}
/**
* Closes off the AFP stream writing the document stream
*
* @throws IOException if an an I/O exception of some sort has occurred
*/
// write out any external resource groups
public void close() throws IOException {
for (ResourceGroup resourceGroup : pathResourceGroupMap.values()) {
// TODO - Why not a Map<URI, StreamedResourceGroup>, if all the elements are expected to be of that type?
assert (resourceGroup instanceof StreamedResourceGroup);
((StreamedResourceGroup) resourceGroup).close();
}
// close any open print-file resource group
if (printFileResourceGroup != null) {
printFileResourceGroup.close();
}
// write out document
writeToStream(outputStream);
outputStream.close();
}
/**
* Sets the final outputstream
*
* @param outputStream an outputstream
*/
public void setOutputStream(OutputStream outputStream) {
this.outputStream = outputStream;
}
/** {@inheritDoc} */
public void writeToStream(OutputStream os) throws IOException {
tempOutputStream.close();
InputStream tempInputStream = resourceResolver.getResource(tempUri);
IOUtils.copy(tempInputStream, os);
//TODO this should notify the stream provider that it is safe to delete the temp data
tempInputStream.close();
os.flush();
}
}
@@ -0,0 +1,232 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.afp;
import java.awt.Color;
/**
* Text data information
*/
public class AFPTextDataInfo {
/** the text font reference */
private int fontReference;
/** the text x coordinate position */
private int x;
/** the text y coordinate position */
private int y;
/** the text color */
private Color color;
/** the text variable space adjustment */
private int variableSpaceCharacterIncrement;
/** the text inter character adjustment */
private int interCharacterAdjustment;
/** the text orientation */
private int rotation;
/** the text encoding */
private String textEncoding;
/** the text string */
private String textString;
/**
* Returns the font reference
*
* @return the font reference
*/
public int getFontReference() {
return fontReference;
}
/**
* Sets the font reference
*
* @param fontReference the font reference
*/
public void setFontReference(int fontReference) {
this.fontReference = fontReference;
}
/**
* Returns the x coordinate
*
* @return the x coordinate
*/
public int getX() {
return x;
}
/**
* Sets the X coordinate
*
* @param x the X coordinate
*/
public void setX(int x) {
this.x = x;
}
/**
* Returns the y coordinate
*
* @return the y coordinate
*/
public int getY() {
return y;
}
/**
* Sets the Y coordinate
*
* @param y the Y coordinate
*/
public void setY(int y) {
this.y = y;
}
/**
* Returns the color
*
* @return the color
*/
public Color getColor() {
return color;
}
/**
* Sets the color
*
* @param color the color
*/
public void setColor(Color color) {
this.color = color;
}
/**
* Return the variable space character increment
*
* @return the variable space character increment
*/
public int getVariableSpaceCharacterIncrement() {
return variableSpaceCharacterIncrement;
}
/**
* Sets the variable space character increment
*
* @param variableSpaceCharacterIncrement the variable space character increment
*/
public void setVariableSpaceCharacterIncrement(
int variableSpaceCharacterIncrement) {
this.variableSpaceCharacterIncrement = variableSpaceCharacterIncrement;
}
/**
* Return the inter character adjustment
*
* @return the inter character adjustment
*/
public int getInterCharacterAdjustment() {
return interCharacterAdjustment;
}
/**
* Sets the inter character adjustment
*
* @param interCharacterAdjustment the inter character adjustment
*/
public void setInterCharacterAdjustment(int interCharacterAdjustment) {
this.interCharacterAdjustment = interCharacterAdjustment;
}
/**
* Sets the text orientation
*
* @param rotation the text rotation
*/
public void setRotation(int rotation) {
this.rotation = rotation;
}
/**
* Returns the text rotation
*
* @return the text rotation
*/
public int getRotation() {
return this.rotation;
}
/**
* Sets the text encoding
*
* @param textEncoding the text encoding
*/
public void setEncoding(String textEncoding) {
this.textEncoding = textEncoding;
}
/**
* Returns the text encoding
*
* @return the text encoding
*/
public String getEncoding() {
return this.textEncoding;
}
/**
* Sets the text string
*
* @param textString the text string
*/
public void setString(String textString) {
this.textString = textString;
}
/**
* Returns the text string
*
* @return the text string
*/
public String getString() {
return this.textString;
}
/** {@inheritDoc} */
public String toString() {
return "TextDataInfo{fontReference=" + fontReference
+ ", x=" + x
+ ", y=" + y
+ ", color=" + color
+ ", vsci=" + variableSpaceCharacterIncrement
+ ", ica=" + interCharacterAdjustment
+ ", orientation=" + rotation
+ ", textString=" + textString
+ ", textEncoding=" + textEncoding
+ "}";
}
}
@@ -0,0 +1,149 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.afp;
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import org.apache.commons.io.IOUtils;
import org.apache.fontbox.ttf.TTFTable;
import org.apache.fontbox.ttf.TrueTypeCollection;
import org.apache.fontbox.ttf.TrueTypeFont;
import org.apache.fop.afp.modca.ActiveEnvironmentGroup;
import org.apache.fop.afp.modca.ObjectContainer;
import org.apache.fop.afp.modca.ResourceGroup;
import org.apache.fop.afp.modca.ResourceObject;
import org.apache.fop.afp.modca.triplets.EncodingTriplet;
import org.apache.fop.afp.modca.triplets.FullyQualifiedNameTriplet;
import org.apache.fop.afp.util.AFPResourceAccessor;
import org.apache.fop.fonts.CMapSegment;
import org.apache.fop.fonts.truetype.CmapWriter;
/**
* Builds an AFP object container resource holding an embedded TrueType font, written to the
* document trailer's resource group. The full font is read from the given URI (extracted from a
* TrueType Collection when a {@code ttc} name is supplied), optionally has a cmap appended, and is
* wrapped in the MO:DCA structures required to reference it as a TrueType font resource.
*/
public class AFPTrailerFont {
private AFPResourceAccessor accessor;
private URI uri;
private String ttc;
private String resourceName;
private ResourceGroup resourceGroup;
private Factory factory;
protected CMapSegment[] cmap;
AFPTrailerFont(AFPResourceAccessor accessor, URI uri, String ttc, CMapSegment[] cmap, String resourceName,
ResourceGroup resourceGroup, Factory factory) {
this.accessor = accessor;
this.uri = uri;
this.ttc = ttc;
this.cmap = cmap;
this.resourceName = resourceName;
this.resourceGroup = resourceGroup;
this.factory = factory;
}
public void build() throws IOException {
ResourceObject res = factory.createResource();
res.setType(ResourceObject.TYPE_OBJECT_CONTAINER);
ActiveEnvironmentGroup.setupTruetypeMDR(res, false);
ObjectContainer objectContainer = factory.createObjectContainer();
InputStream is = accessor.createInputStream(uri);
byte[] fontData;
if (ttc != null) {
fontData = extractTTC(ttc, is);
} else {
fontData = IOUtils.toByteArray(is);
}
if (cmap != null) {
fontData = CmapWriter.appendCmap(fontData, cmap);
}
objectContainer.setData(fontData);
ActiveEnvironmentGroup.setupTruetypeMDR(objectContainer, true);
res.addTriplet(new EncodingTriplet(1200));
res.setFullyQualifiedName(FullyQualifiedNameTriplet.TYPE_REPLACE_FIRST_GID_NAME,
FullyQualifiedNameTriplet.FORMAT_CHARSTR, resourceName, true);
res.setDataObject(objectContainer);
resourceGroup.addObject(res);
}
private byte[] extractTTC(String ttc, InputStream is) throws IOException {
TrueTypeCollection trueTypeCollection = new TrueTypeCollection(is);
TrueTypeFont ttf = trueTypeCollection.getFontByName(ttc);
return extractFullFont(ttf);
}
protected static byte[] extractFullFont(TrueTypeFont ttf) throws IOException {
byte[] source = IOUtils.toByteArray(ttf.getOriginalData());
List<TTFTable> tables = new ArrayList<>(ttf.getTables());
Collections.sort(tables, new Comparator<TTFTable>() {
public int compare(TTFTable table1, TTFTable table2) {
return table1.getTag().compareTo(table2.getTag());
}
});
int numTables = tables.size();
ByteArrayOutputStream bos = new ByteArrayOutputStream();
DataOutputStream out = new DataOutputStream(bos);
out.writeInt(0x00010000); // sfnt version (TrueType outlines)
out.writeShort(numTables);
int entrySelector = 0;
while ((1 << (entrySelector + 1)) <= numTables) {
entrySelector++;
}
int searchRange = (1 << entrySelector) * 16;
out.writeShort(searchRange);
out.writeShort(entrySelector);
out.writeShort(numTables * 16 - searchRange);
int offset = 12 + numTables * 16;
for (TTFTable table : tables) {
out.writeBytes(table.getTag());
out.writeInt((int) table.getCheckSum());
out.writeInt(offset);
out.writeInt((int) table.getLength());
offset += (int) ((table.getLength() + 3) & ~3L);
}
for (TTFTable table : tables) {
int length = (int) table.getLength();
out.write(source, (int) table.getOffset(), length);
while (length % 4 != 0) {
out.write(0);
length++;
}
}
out.flush();
return bos.toByteArray();
}
}
@@ -0,0 +1,121 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.afp;
import java.awt.geom.AffineTransform;
/**
* AFP Unit converter
*/
public class AFPUnitConverter {
/** the AFP state */
private final AFPPaintingState paintingState;
/**
* Unit converter
*
* @param paintingState the AFP painting state
*/
public AFPUnitConverter(AFPPaintingState paintingState) {
this.paintingState = paintingState;
}
/**
* Converts millipoints to units
*
* @param srcPts source points
* @param dstPts destination points
* @return transformed points
*/
public int[] mpts2units(float[] srcPts, float[] dstPts) {
return transformPoints(srcPts, dstPts, true);
}
/**
* Converts points to units
*
* @param srcPts source points
* @param dstPts destination points
* @return transformed points
*/
public int[] pts2units(float[] srcPts, float[] dstPts) {
return transformPoints(srcPts, dstPts, false);
}
/**
* Converts millipoints to units
*
* @param srcPts source points
* @return transformed points
*/
public int[] mpts2units(float[] srcPts) {
return transformPoints(srcPts, null, true);
}
/**
* Converts points to units
*
* @param srcPts source points
* @return transformed points
*/
public int[] pts2units(float[] srcPts) {
return transformPoints(srcPts, null, false);
}
/**
* Converts point to unit
*
* @param pt point
* @return transformed point
*/
public float pt2units(float pt) {
return pt / ((float)AFPConstants.DPI_72 / paintingState.getResolution());
}
/**
* Converts millipoint to unit
*
* @param mpt millipoint
* @return transformed point
*/
public float mpt2units(float mpt) {
return mpt / ((float)AFPConstants.DPI_72_MPTS / paintingState.getResolution());
}
private int[] transformPoints(float[] srcPts, float[] dstPts, boolean milli) {
if (dstPts == null) {
dstPts = new float[srcPts.length];
}
AffineTransform at = paintingState.getData().getTransform();
at.transform(srcPts, 0, dstPts, 0, srcPts.length / 2);
int[] coords = new int[srcPts.length];
for (int i = 0; i < srcPts.length; i++) {
if (!milli) {
dstPts[i] *= 1000;
}
coords[i] = Math.round(dstPts[i]);
}
return coords;
}
}
@@ -0,0 +1,58 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.afp;
import java.io.IOException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* A base AFP painter
*/
public abstract class AbstractAFPPainter {
/** Static logging instance */
protected static final Log log = LogFactory.getLog("org.apache.xmlgraphics.afp");
/** data stream */
protected final DataStream dataStream;
/** painting state */
protected final AFPPaintingState paintingState;
/**
* Main constructor
*
* @param paintingState the AFP painting state
* @param dataStream the AFP Datastream
*/
public AbstractAFPPainter(AFPPaintingState paintingState, DataStream dataStream) {
this.paintingState = paintingState;
this.dataStream = dataStream;
}
/**
* Paints the painting item
*
* @param paintInfo the painting information
* @throws IOException if an I/O error occurs
*/
public abstract void paint(PaintingInfo paintInfo) throws IOException;
}
@@ -0,0 +1,123 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.afp;
import java.awt.Color;
import org.apache.fop.traits.BorderStyle;
/**
* Border painting information
*/
public class BorderPaintingInfo implements PaintingInfo {
private final float x1;
private final float y1;
private final float x2;
private final float y2;
private final boolean isHorizontal;
private final BorderStyle style;
private final Color color;
/**
* Main constructor
*
* @param x1 the x1 coordinate
* @param y1 the y1 coordinate
* @param x2 the x2 coordinate
* @param y2 the y2 coordinate
* @param isHorizontal true when the border line is horizontal
* @param style the border style
* @param color the border color
*/
public BorderPaintingInfo(float x1, float y1, float x2, float y2,
boolean isHorizontal, BorderStyle style, Color color) {
this.x1 = x1;
this.y1 = y1;
this.x2 = x2;
this.y2 = y2;
this.isHorizontal = isHorizontal;
this.style = style;
this.color = color;
}
/**
* Returns the x1 coordinate
*
* @return the x1 coordinate
*/
public float getX1() {
return x1;
}
/**
* Returns the y1 coordinate
*
* @return the y1 coordinate
*/
public float getY1() {
return y1;
}
/**
* Returns the x2 coordinate
*
* @return the x2 coordinate
*/
public float getX2() {
return x2;
}
/**
* Returns the y2 coordinate
*
* @return the y2 coordinate
*/
public float getY2() {
return y2;
}
/**
* Returns true when this is a horizontal line
*
* @return true when this is a horizontal line
*/
public boolean isHorizontal() {
return isHorizontal;
}
/**
* Returns the style
*
* @return the style
*/
public BorderStyle getStyle() {
return style;
}
/**
* Returns the color
*
* @return the color
*/
public Color getColor() {
return color;
}
}
@@ -0,0 +1,40 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.afp;
/**
* Set and expose the internal completeness of an object.
*/
public interface Completable {
/**
* Sets whether or not this object is complete or not
*
* @param complete true if this object is complete
*/
void setComplete(boolean complete);
/**
* Returns true if this object is complete
*
* @return true if this object is complete
*/
boolean isComplete();
}
@@ -0,0 +1,691 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.afp;
import java.awt.Color;
import java.awt.Point;
import java.io.IOException;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.fop.afp.fonts.AFPFont;
import org.apache.fop.afp.fonts.AFPFontAttributes;
import org.apache.fop.afp.fonts.CharacterSet;
import org.apache.fop.afp.modca.AbstractPageObject;
import org.apache.fop.afp.modca.Document;
import org.apache.fop.afp.modca.InterchangeSet;
import org.apache.fop.afp.modca.Overlay;
import org.apache.fop.afp.modca.PageGroup;
import org.apache.fop.afp.modca.PageObject;
import org.apache.fop.afp.modca.ResourceGroup;
import org.apache.fop.afp.modca.TagLogicalElement;
import org.apache.fop.afp.modca.triplets.FullyQualifiedNameTriplet;
import org.apache.fop.afp.ptoca.PtocaBuilder;
import org.apache.fop.afp.ptoca.PtocaProducer;
import org.apache.fop.fonts.Font;
import org.apache.fop.util.CharUtilities;
/**
* A data stream is a continuous ordered stream of data elements and objects
* conforming to a given format. Application programs can generate data streams
* destined for a presentation service, archive library, presentation device or
* another application program. The strategic presentation data stream
* architectures used is Mixed Object Document Content Architecture (MO:DCA).
*
* The MO:DCA architecture defines the data stream used by applications to
* describe documents and object envelopes for interchange with other
* applications and application services. Documents defined in the MO:DCA format
* may be archived in a database, then later retrieved, viewed, annotated and
* printed in local or distributed systems environments. Presentation fidelity
* is accommodated by including resource objects in the documents that reference
* them.
*/
public class DataStream {
/** Static logging instance */
protected static final Log LOG = LogFactory.getLog("org.apache.xmlgraphics.afp");
/** Boolean completion indicator */
private boolean complete;
/** The AFP document object */
private Document document;
/** The current page group object */
private PageGroup currentPageGroup;
/** The current page object */
private PageObject currentPageObject;
/** The current overlay object */
private Overlay currentOverlay;
/** The current page */
private AbstractPageObject currentPage;
/** The MO:DCA interchange set in use (default to MO:DCA-P IS/2 set) */
private InterchangeSet interchangeSet
= InterchangeSet.valueOf(InterchangeSet.MODCA_PRESENTATION_INTERCHANGE_SET_2);
private final Factory factory;
private OutputStream outputStream;
/** the afp painting state */
private final AFPPaintingState paintingState;
/**
* Default constructor for the AFPDocumentStream.
*
* @param factory the resource factory
* @param paintingState the AFP painting state
* @param outputStream the outputstream to write to
*/
public DataStream(Factory factory, AFPPaintingState paintingState, OutputStream outputStream) {
this.paintingState = paintingState;
this.factory = factory;
this.outputStream = outputStream;
}
/**
* Returns the outputstream
*
* @return the outputstream
*/
public OutputStream getOutputStream() {
return this.outputStream;
}
/**
* Returns the document object
*
* @return the document object
*/
private Document getDocument() {
return this.document;
}
/**
* Returns the current page
*
* @return the current page
*/
public AbstractPageObject getCurrentPage() {
return this.currentPage;
}
/**
* The document is started by invoking this method which creates an instance
* of the AFP Document object.
*
* @param name
* the name of this document.
*/
public void setDocumentName(String name) {
if (name != null) {
getDocument().setFullyQualifiedName(
FullyQualifiedNameTriplet.TYPE_BEGIN_DOCUMENT_REF,
FullyQualifiedNameTriplet.FORMAT_CHARSTR, name);
}
}
/**
* Helper method to mark the end of the current document.
*
* @throws IOException thrown if an I/O exception of some sort has occurred
*/
public void endDocument() throws IOException {
if (complete) {
String msg = "Invalid state - document already ended.";
LOG.warn("endDocument():: " + msg);
throw new IllegalStateException(msg);
}
if (currentPageObject != null) {
// End the current page if necessary
endPage();
}
if (currentPageGroup != null) {
// End the current page group if necessary
endPageGroup(true);
}
// Write out document
if (document != null) {
document.endDocument();
document.writeToStream(this.outputStream);
}
this.outputStream.flush();
this.complete = true;
this.document = null;
this.outputStream = null;
}
/**
* Start a new page. When processing has finished on the current page, the
* {@link #endPage()}method must be invoked to mark the page ending.
*
* @param pageWidth
* the width of the page
* @param pageHeight
* the height of the page
* @param pageRotation
* the rotation of the page
* @param pageWidthRes
* the width resolution of the page
* @param pageHeightRes
* the height resolution of the page
*/
public void startPage(int pageWidth, int pageHeight, int pageRotation,
int pageWidthRes, int pageHeightRes) {
currentPageObject = factory.createPage(pageWidth, pageHeight,
pageRotation, pageWidthRes, pageHeightRes);
currentPage = currentPageObject;
currentOverlay = null;
}
/**
* Start a new overlay. When processing has finished on the current overlay,
* the {@link #endOverlay()}method must be invoked to mark the overlay
* ending.
*
* @param x
* the x position of the overlay on the page
* @param y
* the y position of the overlay on the page
* @param width
* the width of the overlay
* @param height
* the height of the overlay
* @param widthRes
* the width resolution of the overlay
* @param heightRes
* the height resolution of the overlay
* @param overlayRotation
* the rotation of the overlay
*/
public void startOverlay(int x, int y, int width, int height, int widthRes,
int heightRes, int overlayRotation) {
this.currentOverlay = factory.createOverlay(
width, height, widthRes, heightRes, overlayRotation);
String overlayName = currentOverlay.getName();
currentPageObject.createIncludePageOverlay(overlayName, x, y, 0);
currentPage = currentOverlay;
}
/**
* Helper method to mark the end of the current overlay.
*
* @throws IOException thrown if an I/O exception of some sort has occurred
*/
public void endOverlay() throws IOException {
if (currentOverlay != null) {
currentOverlay.endPage();
currentOverlay = null;
currentPage = currentPageObject;
}
}
/**
* Helper method to save the current page.
*
* @return current page object that was saved
*/
public PageObject savePage() {
PageObject pageObject = currentPageObject;
if (currentPageGroup != null) {
currentPageGroup.addPage(currentPageObject);
} else {
document.addPage(currentPageObject);
}
currentPageObject = null;
currentPage = null;
return pageObject;
}
/**
* Helper method to restore the current page.
*
* @param pageObject
* page object
*/
public void restorePage(PageObject pageObject) {
currentPageObject = pageObject;
currentPage = pageObject;
}
/**
* Helper method to mark the end of the current page.
*
* @throws IOException thrown if an I/O exception of some sort has occurred
*/
public void endPage() throws IOException {
if (currentPageObject != null) {
currentPageObject.endPage();
if (currentPageGroup != null) {
currentPageGroup.addPage(currentPageObject);
currentPageGroup.writeToStream(this.outputStream);
} else {
document.addPage(currentPageObject);
document.writeToStream(this.outputStream);
}
currentPageObject = null;
currentPage = null;
}
}
/**
* Creates the given page fonts in the current page
*
* @param pageFonts
* a collection of AFP font attributes
*/
public void addFontsToCurrentPage(Map pageFonts) {
for (Object o : pageFonts.values()) {
AFPFontAttributes afpFontAttributes = (AFPFontAttributes) o;
createFont(afpFontAttributes.getFontReference(), afpFontAttributes
.getFont(), afpFontAttributes.getPointSize());
}
}
/**
* Helper method to create a map coded font object on the current page, this
* method delegates the construction of the map coded font object to the
* active environment group on the current page.
*
* @param fontReference
* the font number used as the resource identifier
* @param font
* the font
* @param size
* the point size of the font
*/
public void createFont(int fontReference, AFPFont font, int size) {
currentPage.createFont(fontReference, font, size);
}
/**
* Returns a point on the current page
*
* @param x the X-coordinate
* @param y the Y-coordinate
* @return a point on the current page
*/
private Point getPoint(int x, int y) {
return paintingState.getPoint(x, y);
}
/**
* Helper method to create text on the current page, this method delegates
* to the current presentation text object in order to construct the text.
*
* @param textDataInfo the afp text data
* @param letterSpacing letter spacing to draw text with
* @param wordSpacing word Spacing to draw text with
* @param font is the font to draw text with
* @param charSet is the AFP Character Set to use with the text
* @throws UnsupportedEncodingException thrown if character encoding is not supported
*/
public void createText(final AFPTextDataInfo textDataInfo, final int letterSpacing,
final int wordSpacing, final Font font, final CharacterSet charSet)
throws UnsupportedEncodingException {
int rotation = paintingState.getRotation();
if (rotation != 0) {
textDataInfo.setRotation(rotation);
Point p = getPoint(textDataInfo.getX(), textDataInfo.getY());
textDataInfo.setX(p.x);
textDataInfo.setY(p.y);
}
// use PtocaProducer to create PTX records
PtocaProducer producer = new PtocaProducer() {
public void produce(PtocaBuilder builder) throws IOException {
builder.setTextOrientation(textDataInfo.getRotation());
builder.absoluteMoveBaseline(textDataInfo.getY());
builder.absoluteMoveInline(textDataInfo.getX());
builder.setExtendedTextColor(textDataInfo.getColor());
builder.setCodedFont((byte)textDataInfo.getFontReference());
int l = textDataInfo.getString().length();
StringBuffer sb = new StringBuffer();
int interCharacterAdjustment = 0;
AFPUnitConverter unitConv = paintingState.getUnitConverter();
if (letterSpacing != 0) {
interCharacterAdjustment = Math.round(unitConv.mpt2units(letterSpacing));
}
builder.setInterCharacterAdjustment(interCharacterAdjustment);
int spaceWidth = font.getCharWidth(CharUtilities.SPACE);
int spacing = spaceWidth + letterSpacing;
int fixedSpaceCharacterIncrement = Math.round(unitConv.mpt2units(spacing));
int varSpaceCharacterIncrement = fixedSpaceCharacterIncrement;
if (wordSpacing != 0) {
varSpaceCharacterIncrement = Math.round(unitConv.mpt2units(
spaceWidth + wordSpacing + letterSpacing));
}
builder.setVariableSpaceCharacterIncrement(varSpaceCharacterIncrement);
boolean fixedSpaceMode = false;
for (int i = 0; i < l; i++) {
char orgChar = textDataInfo.getString().charAt(i);
float glyphAdjust = 0;
if (CharUtilities.isFixedWidthSpace(orgChar)) {
flushText(builder, sb, charSet);
builder.setVariableSpaceCharacterIncrement(
fixedSpaceCharacterIncrement);
fixedSpaceMode = true;
sb.append(CharUtilities.SPACE);
int charWidth = font.getCharWidth(orgChar);
glyphAdjust += (charWidth - spaceWidth);
} else {
if (fixedSpaceMode) {
flushText(builder, sb, charSet);
builder.setVariableSpaceCharacterIncrement(
varSpaceCharacterIncrement);
fixedSpaceMode = false;
}
char ch;
if (orgChar == CharUtilities.NBSPACE) {
ch = ' '; //converted to normal space to allow word spacing
} else {
ch = orgChar;
}
sb.append(ch);
}
if (glyphAdjust != 0) {
flushText(builder, sb, charSet);
int increment = Math.round(unitConv.mpt2units(glyphAdjust));
builder.relativeMoveInline(increment);
}
}
flushText(builder, sb, charSet);
}
private void flushText(PtocaBuilder builder, StringBuffer sb,
final CharacterSet charSet) throws IOException {
if (sb.length() > 0) {
builder.addTransparentData(charSet.encodeChars(sb));
sb.setLength(0);
}
}
};
currentPage.createText(producer);
}
/**
* Method to create a line on the current page.
*
* @param lineDataInfo the line data information.
*/
public void createLine(AFPLineDataInfo lineDataInfo) {
currentPage.createLine(lineDataInfo);
}
/**
* This method will create shading on the page using the specified
* coordinates (the shading contrast is controlled via the red, green, blue
* parameters, by converting this to grey scale).
*
* @param x
* the x coordinate of the shading
* @param y
* the y coordinate of the shading
* @param w
* the width of the shaded area
* @param h
* the height of the shaded area
* @param col
* the shading color
*/
public void createShading(int x, int y, int w, int h, Color col) {
currentPageObject.createShading(x, y, w, h, col.getRed(), col.getGreen(), col.getBlue());
}
/**
* Helper method which allows creation of the MPO object, via the AEG. And
* the IPO via the Page. (See actual object for descriptions.)
*
* @param name
* the name of the static overlay
* @param x x-coordinate
* @param y y-coordinate
*/
public void createIncludePageOverlay(String name, int x, int y) {
currentPageObject.createIncludePageOverlay(name, x, y, paintingState.getRotation());
}
/**
* Helper method which allows creation of the IMM object.
*
* @param name
* the name of the medium map
*/
public void createInvokeMediumMap(String name) {
if (currentPageGroup != null) {
currentPageGroup.createInvokeMediumMap(name);
} else if (currentPage != null) {
currentPage.createInvokeMediumMap(name);
} else {
document.createInvokeMediumMap(name);
}
}
/**
* Creates an IncludePageSegment on the current page.
*
* @param name
* the name of the include page segment
* @param x
* the x coordinate for the overlay
* @param y
* the y coordinate for the overlay
* @param width
* the width of the image
* @param height
* the height of the image
*/
public void createIncludePageSegment(String name, int x, int y, int width, int height) {
int xOrigin;
int yOrigin;
int orientation = paintingState.getRotation();
switch (orientation) {
case 90:
xOrigin = x - height;
yOrigin = y;
break;
case 180:
xOrigin = x - width;
yOrigin = y - height;
break;
case 270:
xOrigin = x;
yOrigin = y - width;
break;
default:
xOrigin = x;
yOrigin = y;
break;
}
boolean createHardPageSegments = true;
currentPage.createIncludePageSegment(name, xOrigin, yOrigin, createHardPageSegments);
}
/**
* Creates a TagLogicalElement on the current page.
*
* @param attributes
* the array of key value pairs.
*/
public void createPageTagLogicalElement(TagLogicalElement.State[] attributes) {
for (TagLogicalElement.State attribute : attributes) {
currentPage.createTagLogicalElement(attribute);
}
}
/**
* Creates a TagLogicalElement on the current page group.
*
* @param attributes
* the array of key value pairs.
*/
public void createPageGroupTagLogicalElement(TagLogicalElement.State[] attributes) {
for (TagLogicalElement.State attribute : attributes) {
currentPageGroup.createTagLogicalElement(attribute);
}
}
/**
* Creates a TagLogicalElement on the current page or page group
*
* @param name
* The tag name
* @param value
* The tag value
* @param encoding The CCSID character set encoding
*/
public void createTagLogicalElement(String name, String value, int encoding) {
TagLogicalElement.State tleState = new TagLogicalElement.State(name, value, encoding);
if (currentPage != null) {
currentPage.createTagLogicalElement(tleState);
} else if (currentPageGroup != null) {
currentPageGroup.createTagLogicalElement(tleState);
}
}
/**
* Creates a NoOperation item
*
* @param content
* byte data
*/
public void createNoOperation(String content) {
if (currentPage != null) {
currentPage.createNoOperation(content);
} else if (currentPageGroup != null) {
currentPageGroup.createNoOperation(content);
} else {
document.createNoOperation(content);
}
}
/**
* Returns the current page group
*
* @return the current page group
*/
public PageGroup getCurrentPageGroup() {
return this.currentPageGroup;
}
/**
* Start a new document.
*
* @throws IOException thrown if an I/O exception of some sort has occurred
*/
public void startDocument() throws IOException {
this.document = factory.createDocument();
document.writeToStream(this.outputStream);
}
/**
* Start a new page group. When processing has finished on the current page
* group the endPageGroup method must be invoked to mark the page
* group ending.
*
* @throws IOException thrown if an I/O exception of some sort has occurred
*/
public void startPageGroup(boolean endPageGroup) throws IOException {
endPageGroup(endPageGroup);
if (currentPageGroup == null) {
currentPageGroup = factory.createPageGroup();
}
}
/**
* Helper method to mark the end of the page group.
*
* @throws IOException thrown if an I/O exception of some sort has occurred
*/
public void endPageGroup(boolean endPageGroup) throws IOException {
if (currentPageGroup != null && endPageGroup) {
currentPageGroup.endPageGroup();
document.addPageGroup(currentPageGroup);
currentPageGroup = null;
}
document.writeToStream(outputStream); //Flush objects
}
/**
* Sets the MO:DCA interchange set to use
*
* @param interchangeSet the MO:DCA interchange set
*/
public void setInterchangeSet(InterchangeSet interchangeSet) {
this.interchangeSet = interchangeSet;
}
/**
* Returns the MO:DCA interchange set in use
*
* @return the MO:DCA interchange set in use
*/
public InterchangeSet getInterchangeSet() {
return this.interchangeSet;
}
/**
* Returns the resource group for a given resource info
*
* @param level a resource level
* @return a resource group for the given resource info
*/
public ResourceGroup getResourceGroup(AFPResourceLevel level) {
ResourceGroup resourceGroup = null;
if (level.isDocument()) {
resourceGroup = document.getResourceGroup();
} else if (level.isPageGroup()) {
resourceGroup = currentPageGroup.getResourceGroup();
} else if (level.isPage()) {
resourceGroup = currentPageObject.getResourceGroup();
}
return resourceGroup;
}
}
@@ -0,0 +1,655 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.afp;
import java.io.OutputStream;
import org.apache.fop.afp.goca.GraphicsData;
import org.apache.fop.afp.ioca.BandImage;
import org.apache.fop.afp.ioca.ImageContent;
import org.apache.fop.afp.ioca.ImageRasterData;
import org.apache.fop.afp.ioca.ImageSegment;
import org.apache.fop.afp.ioca.ImageSizeParameter;
import org.apache.fop.afp.ioca.Tile;
import org.apache.fop.afp.ioca.TilePosition;
import org.apache.fop.afp.ioca.TileSize;
import org.apache.fop.afp.ioca.TileTOC;
import org.apache.fop.afp.modca.ActiveEnvironmentGroup;
import org.apache.fop.afp.modca.ContainerDataDescriptor;
import org.apache.fop.afp.modca.Document;
import org.apache.fop.afp.modca.GraphicsDataDescriptor;
import org.apache.fop.afp.modca.GraphicsObject;
import org.apache.fop.afp.modca.IMImageObject;
import org.apache.fop.afp.modca.ImageDataDescriptor;
import org.apache.fop.afp.modca.ImageObject;
import org.apache.fop.afp.modca.IncludeObject;
import org.apache.fop.afp.modca.IncludePageSegment;
import org.apache.fop.afp.modca.InvokeMediumMap;
import org.apache.fop.afp.modca.MapCodedFont;
import org.apache.fop.afp.modca.MapContainerData;
import org.apache.fop.afp.modca.MapDataResource;
import org.apache.fop.afp.modca.ObjectAreaDescriptor;
import org.apache.fop.afp.modca.ObjectAreaPosition;
import org.apache.fop.afp.modca.ObjectContainer;
import org.apache.fop.afp.modca.ObjectEnvironmentGroup;
import org.apache.fop.afp.modca.Overlay;
import org.apache.fop.afp.modca.PageDescriptor;
import org.apache.fop.afp.modca.PageGroup;
import org.apache.fop.afp.modca.PageObject;
import org.apache.fop.afp.modca.PresentationEnvironmentControl;
import org.apache.fop.afp.modca.PresentationTextDescriptor;
import org.apache.fop.afp.modca.PresentationTextObject;
import org.apache.fop.afp.modca.ResourceEnvironmentGroup;
import org.apache.fop.afp.modca.ResourceGroup;
import org.apache.fop.afp.modca.ResourceObject;
import org.apache.fop.afp.modca.StreamedResourceGroup;
import org.apache.fop.afp.modca.TagLogicalElement;
import org.apache.fop.afp.util.StringUtils;
/**
* Creator of MO:DCA structured field objects
*/
public class Factory {
private static final String OBJECT_ENVIRONMENT_GROUP_NAME_PREFIX = "OEG";
private static final String ACTIVE_ENVIRONMENT_GROUP_NAME_PREFIX = "AEG";
private static final String IMAGE_NAME_PREFIX = "IMG";
private static final String GRAPHIC_NAME_PREFIX = "GRA";
private static final String BARCODE_NAME_PREFIX = "BAR";
// private static final String OTHER_NAME_PREFIX = "OTH";
private static final String OBJECT_CONTAINER_NAME_PREFIX = "OC";
private static final String RESOURCE_NAME_PREFIX = "RES";
private static final String RESOURCE_GROUP_NAME_PREFIX = "RG";
private static final String PAGE_GROUP_NAME_PREFIX = "PGP";
private static final String PAGE_NAME_PREFIX = "PGN";
private static final String OVERLAY_NAME_PREFIX = "OVL";
private static final String PRESENTATION_TEXT_NAME_PREFIX = "PT";
private static final String DOCUMENT_NAME_PREFIX = "DOC";
private static final String IM_IMAGE_NAME_PREFIX = "IMIMG";
private static final String IMAGE_SEGMENT_NAME_PREFIX = "IS";
/** the page group count */
private int pageGroupCount;
/** the page count */
private int pageCount;
/** the image count */
private int imageCount;
/** the im image count */
private int imImageCount;
/** the image segment count */
private int imageSegmentCount;
/** the graphic count */
private int graphicCount;
/** the object container count */
private int objectContainerCount;
/** the resource count */
private int resourceCount;
/** the resource group count */
private int resourceGroupCount;
/** the overlay count */
private int overlayCount;
/** the presentation text object count */
private int textObjectCount;
/** the active environment group count */
private int activeEnvironmentGroupCount;
/** the document count */
private int documentCount;
/** the object environment group count */
private int objectEnvironmentGroupCount;
/**
* Main constructor
*/
public Factory() {
}
/**
* Creates a new IOCA {@link ImageObject}
*
* @return a new {@link ImageObject}
*/
public ImageObject createImageObject() {
String name = IMAGE_NAME_PREFIX
+ StringUtils.lpad(String.valueOf(++imageCount), '0', 5);
ImageObject imageObject = new ImageObject(this, name);
return imageObject;
}
/**
* Creates an IOCA {@link IMImageObject}
*
* @return a new {@link IMImageObject}
*/
public IMImageObject createIMImageObject() {
String name = IM_IMAGE_NAME_PREFIX
+ StringUtils.lpad(String.valueOf(++imImageCount), '0', 3);
IMImageObject imImageObject = new IMImageObject(name);
return imImageObject;
}
/**
* Creates a new GOCA {@link GraphicsObject}
*
* @return a new {@link GraphicsObject}
*/
public GraphicsObject createGraphicsObject() {
String name = GRAPHIC_NAME_PREFIX
+ StringUtils.lpad(String.valueOf(++graphicCount), '0', 5);
GraphicsObject graphicsObj = new GraphicsObject(this, name);
return graphicsObj;
}
/**
* Creates a new MO:DCA {@link ObjectContainer}
*
* @return a new {@link ObjectContainer}
*/
public ObjectContainer createObjectContainer() {
String name = OBJECT_CONTAINER_NAME_PREFIX
+ StringUtils.lpad(String.valueOf(++objectContainerCount), '0', 6);
return new ObjectContainer(this, name);
}
/**
* Creates a new MO:DCA {@link ResourceObject}
*
* @param resourceName the resource object name
* @return a new {@link ResourceObject}
*/
public ResourceObject createResource(String resourceName) {
return new ResourceObject(resourceName);
}
/**
* Creates a new MO:DCA {@link ResourceObject}
*
* @return a new {@link ResourceObject}
*/
public ResourceObject createResource() {
String name = RESOURCE_NAME_PREFIX
+ StringUtils.lpad(String.valueOf(++resourceCount), '0', 5);
return createResource(name);
}
/**
* Creates a new MO:DCA {@link PageGroup}
* @return a new {@link PageGroup}
*/
public PageGroup createPageGroup() {
String name = PAGE_GROUP_NAME_PREFIX
+ StringUtils.lpad(String.valueOf(++pageGroupCount), '0', 5);
return new PageGroup(this, name);
}
/**
* Creates a new MO:DCA {@link ActiveEnvironmentGroup}
*
* @param width the page width
* @param height the page height
* @param widthRes the page width resolution
* @param heightRes the page height resolution
* @return a new {@link ActiveEnvironmentGroup}
*/
public ActiveEnvironmentGroup createActiveEnvironmentGroup(
int width, int height, int widthRes, int heightRes) {
String name = ACTIVE_ENVIRONMENT_GROUP_NAME_PREFIX
+ StringUtils.lpad(String.valueOf(++activeEnvironmentGroupCount), '0', 5);
return new ActiveEnvironmentGroup(this, name, width, height, widthRes, heightRes);
}
/**
* Creates a new MO:DCA {@link ResourceGroup}
*
* @return a new {@link ResourceGroup}
*/
public ResourceGroup createResourceGroup() {
String name = RESOURCE_GROUP_NAME_PREFIX
+ StringUtils.lpad(String.valueOf(++resourceGroupCount), '0', 6);
return new ResourceGroup(name);
}
/**
* Creates a new MO:DCA {@link StreamedResourceGroup}
*
* @param os the outputstream of the streamed resource group
* @return a new {@link StreamedResourceGroup}
*/
public StreamedResourceGroup createStreamedResourceGroup(OutputStream os) {
String name = RESOURCE_GROUP_NAME_PREFIX
+ StringUtils.lpad(String.valueOf(++resourceGroupCount), '0', 6);
return new StreamedResourceGroup(name, os);
}
/**
* Creates a new MO:DCA {@link PageObject}.
*
* @param pageWidth
* the width of the page
* @param pageHeight
* the height of the page
* @param pageRotation
* the rotation of the page
* @param pageWidthRes
* the width resolution of the page
* @param pageHeightRes
* the height resolution of the page
*
* @return a new {@link PageObject}
*/
public PageObject createPage(int pageWidth, int pageHeight, int pageRotation,
int pageWidthRes, int pageHeightRes) {
String pageName = PAGE_NAME_PREFIX
+ StringUtils.lpad(String.valueOf(++pageCount), '0', 5);
return new PageObject(this, pageName, pageWidth, pageHeight,
pageRotation, pageWidthRes, pageHeightRes);
}
/**
* Creates a new MO:DCA {@link PresentationTextObject}.
*
* @return a new {@link PresentationTextObject}
*/
public PresentationTextObject createPresentationTextObject() {
String textObjectName = PRESENTATION_TEXT_NAME_PREFIX
+ StringUtils.lpad(String.valueOf(++textObjectCount), '0', 6);
return new PresentationTextObject(textObjectName);
}
/**
* Creates a new MO:DCA {@link Overlay}.
*
* @param width
* the width of the overlay
* @param height
* the height of the overlay
* @param widthRes
* the width resolution of the overlay
* @param heightRes
* the height resolution of the overlay
* @param overlayRotation
* the rotation of the overlay
*
* @return a new {@link Overlay}.
*/
public Overlay createOverlay(int width, int height,
int widthRes, int heightRes, int overlayRotation) {
String overlayName = OVERLAY_NAME_PREFIX
+ StringUtils.lpad(String.valueOf(++overlayCount), '0', 5);
Overlay overlay = new Overlay(this, overlayName, width, height,
overlayRotation, widthRes, heightRes);
return overlay;
}
/**
* Creates a MO:DCA {@link Document}
*
* @return a new {@link Document}
*/
public Document createDocument() {
String documentName = DOCUMENT_NAME_PREFIX
+ StringUtils.lpad(String.valueOf(++documentCount), '0', 5);
Document document = new Document(this, documentName);
return document;
}
/**
* Creates a MO:DCA {@link MapCodedFont}
*
* @return a new {@link MapCodedFont}
*/
public MapCodedFont createMapCodedFont() {
MapCodedFont mapCodedFont = new MapCodedFont();
return mapCodedFont;
}
/**
* Creates a MO:DCA {@link IncludePageSegment}
*
* @param name the page segment name
* @param x the x coordinate
* @param y the y coordinate
*
* @return a new {@link IncludePageSegment}
*/
public IncludePageSegment createIncludePageSegment(String name, int x, int y) {
IncludePageSegment includePageSegment = new IncludePageSegment(name, x, y);
return includePageSegment;
}
/**
* Creates a MO:DCA {@link IncludeObject}
*
* @param name the name of this include object
* @return a new {@link IncludeObject}
*/
public IncludeObject createInclude(String name) {
IncludeObject includeObject = new IncludeObject(name);
return includeObject;
}
/**
* Creates a MO:DCA {@link TagLogicalElement}
*
* @param state the attribute state for the TLE
* @return a new {@link TagLogicalElement}
*/
public TagLogicalElement createTagLogicalElement(TagLogicalElement.State state) {
TagLogicalElement tle = new TagLogicalElement(state);
return tle;
}
/**
* Creates a new {@link DataStream}
*
* @param paintingState the AFP painting state
* @param outputStream an outputstream to write to
* @return a new {@link DataStream}
*/
public DataStream createDataStream(AFPPaintingState paintingState, OutputStream outputStream) {
DataStream dataStream = new DataStream(this, paintingState, outputStream);
return dataStream;
}
/**
* Creates a new MO:DCA {@link PageDescriptor}
*
* @param width the page width.
* @param height the page height.
* @param widthRes the page width resolution.
* @param heightRes the page height resolution.
* @return a new {@link PageDescriptor}
*/
public PageDescriptor createPageDescriptor(int width, int height, int widthRes, int heightRes) {
PageDescriptor pageDescriptor = new PageDescriptor(width, height, widthRes, heightRes);
return pageDescriptor;
}
/**
* Returns a new MO:DCA {@link ObjectEnvironmentGroup}
*
* @return a new {@link ObjectEnvironmentGroup}
*/
public ObjectEnvironmentGroup createObjectEnvironmentGroup() {
String oegName = OBJECT_ENVIRONMENT_GROUP_NAME_PREFIX
+ StringUtils.lpad(String.valueOf(++objectEnvironmentGroupCount), '0', 5);
ObjectEnvironmentGroup objectEnvironmentGroup = new ObjectEnvironmentGroup(oegName);
return objectEnvironmentGroup;
}
/**
* Creates a new GOCA {@link GraphicsData}
*
* @return a new {@link GraphicsData}
*/
public GraphicsData createGraphicsData() {
GraphicsData graphicsData = new GraphicsData();
return graphicsData;
}
/**
* Creates a new {@link ObjectAreaDescriptor}
*
* @param width the object width.
* @param height the object height.
* @param widthRes the object width resolution.
* @param heightRes the object height resolution.
* @return a new {@link ObjectAreaDescriptor}
*/
public ObjectAreaDescriptor createObjectAreaDescriptor(
int width, int height, int widthRes, int heightRes) {
ObjectAreaDescriptor objectAreaDescriptor
= new ObjectAreaDescriptor(width, height, widthRes, heightRes);
return objectAreaDescriptor;
}
/**
* Creates a new {@link ObjectAreaPosition}
*
* @param x the x coordinate.
* @param y the y coordinate.
* @param rotation the coordinate system rotation (must be 0, 90, 180, 270).
* @return a new {@link ObjectAreaPosition}
*/
public ObjectAreaPosition createObjectAreaPosition(int x, int y,
int rotation) {
ObjectAreaPosition objectAreaPosition = new ObjectAreaPosition(
x, y, rotation);
return objectAreaPosition;
}
/**
* Creates a new {@link ImageDataDescriptor}
*
* @param width the image width
* @param height the image height
* @param widthRes the x resolution of the image
* @param heightRes the y resolution of the image
* @return a new {@link ImageDataDescriptor}
*/
public ImageDataDescriptor createImageDataDescriptor(
int width, int height, int widthRes, int heightRes) {
ImageDataDescriptor imageDataDescriptor = new ImageDataDescriptor(
width, height, widthRes, heightRes);
return imageDataDescriptor;
}
/**
* Creates a new GOCA {@link GraphicsDataDescriptor}
*
* @param xlwind the left edge of the graphics window
* @param xrwind the right edge of the graphics window
* @param ybwind the top edge of the graphics window
* @param ytwind the bottom edge of the graphics window
* @param widthRes the x resolution of the graphics window
* @param heightRes the y resolution of the graphics window
* @return a new {@link GraphicsDataDescriptor}
*/
public GraphicsDataDescriptor createGraphicsDataDescriptor(
int xlwind, int xrwind, int ybwind, int ytwind, int widthRes, int heightRes) {
GraphicsDataDescriptor graphicsDataDescriptor = new GraphicsDataDescriptor(
xlwind, xrwind, ybwind, ytwind, widthRes, heightRes);
return graphicsDataDescriptor;
}
/**
* Creates a new MO:DCA {@link ContainerDataDescriptor}
*
* @param dataWidth the container data width
* @param dataHeight the container data height
* @param widthRes the container data width resolution
* @param heightRes the container data height resolution
* @return a new {@link ContainerDataDescriptor}
*/
public ContainerDataDescriptor createContainerDataDescriptor(
int dataWidth, int dataHeight, int widthRes, int heightRes) {
ContainerDataDescriptor containerDataDescriptor
= new ContainerDataDescriptor(dataWidth, dataHeight, widthRes, heightRes);
return containerDataDescriptor;
}
/**
* Creates a new MO:DCA {@link MapContainerData}
*
* @param optionValue the option value
* @return a new {@link MapContainerData}
*/
public MapContainerData createMapContainerData(byte optionValue) {
MapContainerData mapContainerData = new MapContainerData(optionValue);
return mapContainerData;
}
/**
* Creates a new MO:DCA {@link MapDataResource}
*
* @return a new {@link MapDataResource}
*/
public MapDataResource createMapDataResource() {
MapDataResource mapDataResource = new MapDataResource();
return mapDataResource;
}
/**
* Creates a new PTOCA {@link PresentationTextDescriptor}
* @param width presentation width
* @param height presentation height
* @param widthRes resolution of presentation width
* @param heightRes resolution of presentation height
* @return a new {@link PresentationTextDescriptor}
*/
public PresentationTextDescriptor createPresentationTextDataDescriptor(
int width, int height, int widthRes, int heightRes) {
PresentationTextDescriptor presentationTextDescriptor
= new PresentationTextDescriptor(width, height,
widthRes, heightRes);
return presentationTextDescriptor;
}
/**
* Creates a new MO:DCA {@link PresentationEnvironmentControl}
*
* @return a new {@link PresentationEnvironmentControl}
*/
public PresentationEnvironmentControl createPresentationEnvironmentControl() {
PresentationEnvironmentControl presentationEnvironmentControl
= new PresentationEnvironmentControl();
return presentationEnvironmentControl;
}
/**
* Creates a new MO:DCA {@link InvokeMediumMap}
*
* @param name the object name
* @return a new {@link InvokeMediumMap}
*/
public InvokeMediumMap createInvokeMediumMap(String name) {
InvokeMediumMap invokeMediumMap = new InvokeMediumMap(name);
return invokeMediumMap;
}
/**
* Creates a new MO:DCA {@link ResourceEnvironmentGroup}
*
* @return a new {@link ResourceEnvironmentGroup}
*/
public ResourceEnvironmentGroup createResourceEnvironmentGroup() {
ResourceEnvironmentGroup resourceEnvironmentGroup = new ResourceEnvironmentGroup();
return resourceEnvironmentGroup;
}
/**
* Creates a new IOCA {@link ImageSegment}
*
* @return a new {@link ImageSegment}
*/
public ImageSegment createImageSegment() {
String name = IMAGE_SEGMENT_NAME_PREFIX
+ StringUtils.lpad(String.valueOf(++imageSegmentCount), '0', 2);
ImageSegment imageSegment = new ImageSegment(this, name);
return imageSegment;
}
/**
* Creates an new IOCA {@link ImageContent}
*
* @return an {@link ImageContent}
*/
public ImageContent createImageContent() {
ImageContent imageContent = new ImageContent();
return imageContent;
}
/**
* Creates a new IOCA {@link ImageRasterData}
*
* @param rasterData raster data
* @return a new {@link ImageRasterData}
*/
public ImageRasterData createImageRasterData(byte[] rasterData) {
ImageRasterData imageRasterData = new ImageRasterData(rasterData);
return imageRasterData;
}
/**
* Creates an new IOCA {@link ImageSizeParameter}.
*
* @param hsize The horizontal size of the image.
* @param vsize The vertical size of the image.
* @param hresol The horizontal resolution of the image.
* @param vresol The vertical resolution of the image.
* @return a new {@link ImageSizeParameter}
*/
public ImageSizeParameter createImageSizeParameter(int hsize, int vsize,
int hresol, int vresol) {
ImageSizeParameter imageSizeParameter
= new ImageSizeParameter(hsize, vsize, hresol, vresol);
return imageSizeParameter;
}
public TileTOC createTileTOC() {
return new TileTOC();
}
public TileSize createTileSize(int dataWidth, int dataHeight, int dataWidthRes, int dataHeightRes) {
return new TileSize(dataWidth, dataHeight, dataWidthRes, dataHeightRes);
}
public TilePosition createTilePosition() {
return new TilePosition();
}
public Tile createTile() {
return new Tile();
}
public BandImage createBandImage() {
return new BandImage();
}
}
@@ -0,0 +1,61 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.afp;
import java.awt.Color;
import org.apache.xmlgraphics.java2d.color.ColorConverter;
import org.apache.fop.util.ColorUtil;
/**
* Converts to grayscale using the standard RED=30%, GREEN=59% and BLUE=11%
* weights (see http://en.wikipedia.org/wiki/Grayscale)
*/
final class GrayScaleColorConverter implements ColorConverter {
private static final int RED_WEIGHT = 77;
private static final int GREEN_WEIGTH = 150;
private static final int BLUE_WEIGHT = 28;
private static final GrayScaleColorConverter SINGLETON = new GrayScaleColorConverter();
private GrayScaleColorConverter() { }
/**
* static factory
*
* @return singleton instance of GrayScaleColorConverter
*/
public static GrayScaleColorConverter getInstance() {
return SINGLETON;
}
/**
* The color is converted to CMYK with just the K component {@inheritDoc}
*/
public Color convert(Color color) {
float kValue = (RED_WEIGHT * color.getRed() + GREEN_WEIGTH * color.getGreen() + BLUE_WEIGHT
* color.getBlue()) / 255.0f / 255.0f;
return ColorUtil.toCMYKGrayColor(kValue);
}
}
@@ -0,0 +1,27 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.afp;
/**
* Generic painting information interface
*/
public interface PaintingInfo {
}
@@ -0,0 +1,84 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.afp;
/**
* Filled rectangle painting information
*/
public class RectanglePaintingInfo implements PaintingInfo {
private final float x;
private final float y;
private final float width;
private final float height;
/**
* Main constructor
*
* @param x the x coordinate
* @param y the y coordinate
* @param width the width
* @param height the height
*/
public RectanglePaintingInfo(float x, float y, float width, float height) {
this.x = x;
this.y = y;
this.width = width;
this.height = height;
}
/**
* Returns the x coordinate
*
* @return the x coordinate
*/
protected float getX() {
return x;
}
/**
* Returns the y coordinate
*
* @return the y coordinate
*/
protected float getY() {
return y;
}
/**
* Returns the width
*
* @return the width
*/
protected float getWidth() {
return width;
}
/**
* Returns the height
*
* @return the height
*/
protected float getHeight() {
return height;
}
}
@@ -0,0 +1,40 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.afp;
/**
* Set and expose whether an object has started or not.
*/
public interface Startable {
/**
* Sets whether or not this object has started or not
*
* @param started true if this object has started
*/
void setStarted(boolean started);
/**
* Returns true if this object has started
*
* @return true if this object has started
*/
boolean isStarted();
}
@@ -0,0 +1,38 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.afp;
import java.io.IOException;
import java.io.OutputStream;
/**
* Implementing object is able to write to an OutputStream
*/
public interface Streamable {
/**
* DataStream objects must implement the writeToStream()
* method to write its data to the given OutputStream
*
* @param os the outputsteam stream
* @throws java.io.IOException an I/O exception of some sort has occurred.
*/
void writeToStream(OutputStream os) throws IOException;
}
@@ -0,0 +1,33 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.afp;
/**
* An AFP object which is able to know its own data length prior to writeToStream()
*/
public interface StructuredData {
/**
* Returns the data length of this structured field
*
* @return the data length of this structured field
*/
int getDataLength();
}
@@ -0,0 +1,161 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.afp.apps;
import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintStream;
import org.apache.commons.io.HexDump;
import org.apache.commons.io.IOUtils;
import org.apache.commons.io.output.ByteArrayOutputStream;
import org.apache.fop.afp.parser.MODCAParser;
import org.apache.fop.afp.parser.UnparsedStructuredField;
/**
* This class represents a tool for extracting the Type 1 PFB file from an AFP outline font.
*/
public class FontPatternExtractor {
private PrintStream printStream = System.out;
/**
* Extracts the Type1 PFB file from the given AFP outline font.
* @param file the AFP file to read from
* @param targetDir the target directory where the PFB file is to be placed.
* @throws IOException if an I/O error occurs
*/
public void extract(File file, File targetDir) throws IOException {
InputStream in = new java.io.FileInputStream(file);
try {
MODCAParser parser = new MODCAParser(in);
ByteArrayOutputStream baout = new ByteArrayOutputStream();
UnparsedStructuredField strucField;
while ((strucField = parser.readNextStructuredField()) != null) {
if (strucField.getSfTypeID() == 0xD3EE89) {
byte[] sfData = strucField.getData();
println(strucField.toString());
HexDump.dump(sfData, 0, printStream, 0);
baout.write(sfData);
}
}
ByteArrayInputStream bin = new ByteArrayInputStream(baout.toByteArray());
IOUtils.closeQuietly(baout);
DataInputStream din = new DataInputStream(bin);
long len = din.readInt() & 0xFFFFFFFFL;
println("Length: " + len);
if (din.skip(4) != 4) { //checksum
throw new IOException("premature EOF when skipping checksum");
}
int tidLen = din.readUnsignedShort() - 2;
byte[] tid = new byte[tidLen];
din.readFully(tid);
String filename = new String(tid, "ISO-8859-1");
int asciiCount1 = countUSAsciiCharacters(filename);
String filenameEBCDIC = new String(tid, "Cp1146");
int asciiCount2 = countUSAsciiCharacters(filenameEBCDIC);
println("TID: " + filename + " " + filenameEBCDIC);
if (asciiCount2 > asciiCount1) {
//Haven't found an indicator if the name is encoded in EBCDIC or not
//so we use a trick.
filename = filenameEBCDIC;
}
if (!filename.toLowerCase().endsWith(".pfb")) {
filename = filename + ".pfb";
}
println("Output filename: " + filename);
File out = new File(targetDir, filename);
OutputStream fout = new java.io.FileOutputStream(out);
try {
IOUtils.copyLarge(din, fout);
} finally {
IOUtils.closeQuietly(fout);
}
} finally {
IOUtils.closeQuietly(in);
}
}
private void println(String s) {
printStream.println(s);
}
private void println() {
printStream.println();
}
private int countUSAsciiCharacters(String filename) {
int count = 0;
for (int i = 0, c = filename.length(); i < c; i++) {
if (filename.charAt(i) < 128) {
count++;
}
}
return count;
}
/**
* Main method
* @param args the command-line arguments
*/
public static void main(String[] args) {
try {
FontPatternExtractor app = new FontPatternExtractor();
app.println("Font Pattern Extractor");
app.println();
if (args.length > 0) {
String filename = args[0];
File file = new File(filename);
File targetDir = file.getParentFile();
if (args.length > 1) {
targetDir = new File(args[1]);
targetDir.mkdirs();
}
app.extract(file, targetDir);
} else {
app.println("This tool tries to extract the PFB file from an AFP outline font.");
app.println();
app.println("Usage: Java -cp ... " + FontPatternExtractor.class.getName()
+ " <afp-font-file> [<target-dir>]");
System.exit(-1);
}
} catch (Exception e) {
e.printStackTrace();
System.exit(-1);
}
}
}
@@ -0,0 +1,172 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.afp.fonts;
import org.apache.fop.afp.AFPEventProducer;
import org.apache.fop.fonts.Base14Font;
import org.apache.fop.fonts.Font;
import org.apache.fop.fonts.FontCollection;
import org.apache.fop.fonts.FontInfo;
import org.apache.fop.fonts.base14.Courier;
import org.apache.fop.fonts.base14.CourierBold;
import org.apache.fop.fonts.base14.CourierBoldOblique;
import org.apache.fop.fonts.base14.CourierOblique;
import org.apache.fop.fonts.base14.Helvetica;
import org.apache.fop.fonts.base14.HelveticaBold;
import org.apache.fop.fonts.base14.HelveticaOblique;
import org.apache.fop.fonts.base14.TimesBold;
import org.apache.fop.fonts.base14.TimesBoldItalic;
import org.apache.fop.fonts.base14.TimesItalic;
import org.apache.fop.fonts.base14.TimesRoman;
/**
* Sets up a typical Base 12 font configuration for AFP
*/
public class AFPBase12FontCollection implements FontCollection {
private final AFPEventProducer eventProducer;
/**
* @param eventProducer the AFP-specific event producer
*/
public AFPBase12FontCollection(AFPEventProducer eventProducer) {
this.eventProducer = eventProducer;
}
/** standard raster font sizes */
private static final int[] RASTER_SIZES = {6, 7, 8, 9, 10, 11, 12, 14, 16, 18, 20, 24, 30, 36};
/** standard raster font charset references */
private static final String[] CHARSET_REF = {
"60", "70", "80", "90", "00", "A0", "B0", "D0", "F0", "H0", "J0", "N0", "T0", "Z0"};
private void addCharacterSet(RasterFont font, String charsetName, Base14Font base14) {
for (int i = 0; i < RASTER_SIZES.length; i++) {
int size = RASTER_SIZES[i] * 1000;
FopCharacterSet characterSet = new FopCharacterSet(
CharacterSet.DEFAULT_CODEPAGE, CharacterSet.DEFAULT_ENCODING,
charsetName + CHARSET_REF[i], base14, eventProducer);
font.addCharacterSet(size, characterSet);
}
}
private int addFontProperties(FontInfo fontInfo, AFPFont font,
String[] names, String style, int weight, int num) {
String internalFontKey = "F" + num;
fontInfo.addMetrics(internalFontKey, font);
fontInfo.addFontProperties(internalFontKey, names, style, weight);
num++;
return num;
}
/** {@inheritDoc} */
public int setup(int start, FontInfo fontInfo) {
/**
* Add the base 12 fonts (Helvetica, Times and Courier)
*
* Note: this default font configuration may not be available
* on your AFP environment.
*/
int num = start;
RasterFont font = null;
/** standard font family reference names for Helvetica font */
final String[] helveticaNames = {"Helvetica", "Arial", "sans-serif"};
font = createReferencedRasterFont("Helvetica");
addCharacterSet(font, "C0H200", new Helvetica());
num = addFontProperties(fontInfo, font, helveticaNames,
Font.STYLE_NORMAL, Font.WEIGHT_NORMAL, num);
font = createReferencedRasterFont("Helvetica Italic");
addCharacterSet(font, "C0H300", new HelveticaOblique());
num = addFontProperties(fontInfo, font, helveticaNames,
Font.STYLE_ITALIC, Font.WEIGHT_NORMAL, num);
font = createReferencedRasterFont("Helvetica (Semi) Bold");
addCharacterSet(font, "C0H400", new HelveticaBold());
num = addFontProperties(fontInfo, font, helveticaNames,
Font.STYLE_NORMAL, Font.WEIGHT_BOLD, num);
font = createReferencedRasterFont("Helvetica Italic (Semi) Bold");
addCharacterSet(font, "C0H500", new HelveticaOblique());
num = addFontProperties(fontInfo, font, helveticaNames,
Font.STYLE_ITALIC, Font.WEIGHT_BOLD, num);
/** standard font family reference names for Times font */
/** any is treated as serif */
final String[] timesNames = {"Times", "TimesRoman", "Times Roman", "Times-Roman",
"Times New Roman", "TimesNewRoman", "serif", "any"};
font = createReferencedRasterFont("Times Roman");
addCharacterSet(font, "C0N200", new TimesRoman());
num = addFontProperties(fontInfo, font, timesNames,
Font.STYLE_NORMAL, Font.WEIGHT_NORMAL, num);
font = createReferencedRasterFont("Times Roman Italic");
addCharacterSet(font, "C0N300", new TimesItalic());
num = addFontProperties(fontInfo, font, timesNames,
Font.STYLE_ITALIC, Font.WEIGHT_NORMAL, num);
font = createReferencedRasterFont("Times Roman Bold");
addCharacterSet(font, "C0N400", new TimesBold());
num = addFontProperties(fontInfo, font, timesNames,
Font.STYLE_NORMAL, Font.WEIGHT_BOLD, num);
font = createReferencedRasterFont("Times Roman Italic Bold");
addCharacterSet(font, "C0N500", new TimesBoldItalic());
num = addFontProperties(fontInfo, font, timesNames,
Font.STYLE_ITALIC, Font.WEIGHT_BOLD, num);
/** standard font family reference names for Courier font */
final String[] courierNames = {"Courier", "monospace"};
font = createReferencedRasterFont("Courier");
addCharacterSet(font, "C04200", new Courier());
num = addFontProperties(fontInfo, font, courierNames,
Font.STYLE_NORMAL, Font.WEIGHT_NORMAL, num);
font = createReferencedRasterFont("Courier Italic");
addCharacterSet(font, "C04300", new CourierOblique());
num = addFontProperties(fontInfo, font, courierNames,
Font.STYLE_ITALIC, Font.WEIGHT_NORMAL, num);
font = createReferencedRasterFont("Courier Bold");
addCharacterSet(font, "C04400", new CourierBold());
num = addFontProperties(fontInfo, font, courierNames,
Font.STYLE_NORMAL, Font.WEIGHT_BOLD, num);
font = createReferencedRasterFont("Courier Italic Bold");
addCharacterSet(font, "C04500", new CourierBoldOblique());
num = addFontProperties(fontInfo, font, courierNames,
Font.STYLE_ITALIC, Font.WEIGHT_BOLD, num);
return num;
}
private RasterFont createReferencedRasterFont(String fontFamily) {
boolean embeddable = false; //Font is assumed to be available on the target platform
return new RasterFont(fontFamily, embeddable);
}
}
@@ -0,0 +1,161 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.afp.fonts;
import java.awt.Rectangle;
import java.net.URI;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import org.apache.fop.fonts.FontType;
import org.apache.fop.fonts.Typeface;
/**
* All implementations of AFP fonts should extend this base class,
* the object implements the FontMetrics information.
*/
public abstract class AFPFont extends Typeface {
private static final double STRIKEOUT_POSITION_FACTOR = 0.45;
/** The font name */
protected final String name;
private final boolean embeddable;
/**
* Constructor for the base font requires the name.
* @param name the name of the font
* @param embeddable whether this font is to be embedded
*/
public AFPFont(String name, boolean embeddable) {
this.name = name;
this.embeddable = embeddable;
}
/** {@inheritDoc} */
public URI getFontURI() {
return null;
}
/** {@inheritDoc} */
public String getFontName() {
return this.name;
}
/** {@inheritDoc} */
public String getEmbedFontName() {
return this.name;
}
/** {@inheritDoc} */
public String getFullName() {
return getFontName();
}
/** {@inheritDoc} */
public Set<String> getFamilyNames() {
Set<String> s = new HashSet<String>();
s.add(this.name);
return s;
}
/**
* Returns the type of the font.
* @return the font type
*/
public FontType getFontType() {
return FontType.OTHER;
}
/**
* Indicates if the font has kerning information.
* @return True, if kerning is available.
*/
public boolean hasKerningInfo() {
return false;
}
/**
* Returns the kerning map for the font.
* @return the kerning map
*/
public Map<Integer, Map<Integer, Integer>> getKerningInfo() {
return null;
}
/**
* Returns the character set for a given size
* @param size the font size
* @return the character set object
*/
public abstract CharacterSet getCharacterSet(int size);
/**
* Indicates if this font may be embedded.
* @return True, if embedding is possible/permitted
*/
public boolean isEmbeddable() {
return this.embeddable;
}
/**
* Maps mapped code points to Unicode code points.
* @param character the mapped code point
* @return the corresponding Unicode code point
*/
protected static final char toUnicodeCodepoint(int character) {
//AFP fonts use Unicode directly as their mapped code points, so we can simply cast to char
return (char) character;
}
/** {@inheritDoc} */
public int getUnderlineThickness(int size) {
// This is the FOCA recommendation in the absence of the Underline Thickness parameter
return getBoundingBox('-', size).height;
}
/** {@inheritDoc} */
public int getStrikeoutPosition(int size) {
//TODO This conflicts with the FOCA recommendation of 0 in the absence of the Throughscore Position
// parameter
return (int) (STRIKEOUT_POSITION_FACTOR * getCapHeight(size));
}
/** {@inheritDoc} */
public int getStrikeoutThickness(int size) {
// This is the FOCA recommendation in the absence of the Throughscore Thickness parameter
return getBoundingBox('-', size).height;
}
/** {@inheritDoc} */
public abstract Rectangle getBoundingBox(int glyphIndex, int size);
/** {@inheritDoc} */
public int[] getWidths() {
throw new UnsupportedOperationException();
}
/** {@inheritDoc} */
public String toString() {
return "name=" + name;
}
}
@@ -0,0 +1,106 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.afp.fonts;
/**
* This class encapsulates the font attributes that need to be included
* in the AFP data stream. This class does not assist in converting the
* font attributes to AFP code pages and character set values.
*/
public class AFPFontAttributes {
/** the font reference */
private int fontReference;
/** the font key */
private final String fontKey;
/** the font */
private final AFPFont font;
/** the point size */
private final int pointSize;
/**
* Constructor for the AFPFontAttributes
*
* @param fontKey the font key
* @param font the font
* @param pointSize the point size
*/
public AFPFontAttributes(String fontKey, AFPFont font, int pointSize) {
this.fontKey = fontKey;
this.font = font;
this.pointSize = pointSize;
}
/**
* Return the font
*
* @return the font
*/
public AFPFont getFont() {
return font;
}
/**
* Return the FontKey attribute
*
* @return the FontKey attribute
*/
public String getFontKey() {
return fontKey + pointSize;
}
/**
* Return the point size attribute
*
* @return the point size attribute
*/
public int getPointSize() {
return pointSize;
}
/**
* Return the FontReference attribute
*
* @return the FontReference attribute
*/
public int getFontReference() {
return fontReference;
}
/**
* Sets the FontReference attribute
*
* @param fontReference the FontReference to set
*/
public void setFontReference(int fontReference) {
this.fontReference = fontReference;
}
/** {@inheritDoc} */
public String toString() {
return "fontReference=" + fontReference
+ ", fontKey=" + fontKey
+ ", font=" + font
+ ", pointSize=" + pointSize;
}
}
@@ -0,0 +1,85 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.afp.fonts;
import java.util.List;
import org.apache.fop.afp.AFPEventProducer;
import org.apache.fop.events.EventBroadcaster;
import org.apache.fop.fonts.Font;
import org.apache.fop.fonts.FontCollection;
import org.apache.fop.fonts.FontInfo;
import org.apache.fop.fonts.FontTriplet;
/**
* A base collection of AFP fonts
*/
public class AFPFontCollection implements FontCollection {
private final AFPEventProducer eventProducer;
private final List<AFPFontInfo> fontInfoList;
/**
* Main constructor
*
* @param eventBroadcaster the event broadcaster
* @param fontInfoList the font info list
*/
public AFPFontCollection(EventBroadcaster eventBroadcaster, List<AFPFontInfo> fontInfoList) {
this.eventProducer = AFPEventProducer.Provider.get(eventBroadcaster);
this.fontInfoList = fontInfoList;
}
/** {@inheritDoc} */
public int setup(int start, FontInfo fontInfo) {
int num = 1;
if (fontInfoList != null && fontInfoList.size() > 0) {
for (AFPFontInfo afpFontInfo : fontInfoList) {
AFPFont afpFont = afpFontInfo.getAFPFont();
List<FontTriplet> tripletList = afpFontInfo.getFontTriplets();
for (FontTriplet triplet : tripletList) {
fontInfo.addMetrics("F" + num, afpFont);
fontInfo.addFontProperties("F" + num,
triplet.getName(), triplet.getStyle(), triplet.getWeight());
num++;
}
}
checkDefaultFontAvailable(fontInfo, Font.STYLE_NORMAL, Font.WEIGHT_NORMAL);
checkDefaultFontAvailable(fontInfo, Font.STYLE_ITALIC, Font.WEIGHT_NORMAL);
checkDefaultFontAvailable(fontInfo, Font.STYLE_NORMAL, Font.WEIGHT_BOLD);
checkDefaultFontAvailable(fontInfo, Font.STYLE_ITALIC, Font.WEIGHT_BOLD);
} else {
eventProducer.warnDefaultFontSetup(this);
// Go with a default base 12 configuration for AFP environments
FontCollection base12FontCollection = new AFPBase12FontCollection(eventProducer);
num = base12FontCollection.setup(num, fontInfo);
}
return num;
}
private void checkDefaultFontAvailable(FontInfo fontInfo, String style, int weight) {
if (!fontInfo.hasFont("any", style, weight)) {
eventProducer.warnMissingDefaultFont(this, style, weight);
}
}
}
@@ -0,0 +1,65 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.afp.fonts;
import java.util.List;
import org.apache.fop.fonts.FontTriplet;
/**
* FontInfo contains meta information on fonts
*/
public class AFPFontInfo {
private AFPFont font;
private List<FontTriplet> tripletList;
/**
* Main constructor
*
* @param afpFont The AFP Font
* @param tripletList List of font triplets to associate with this font
*/
public AFPFontInfo(AFPFont afpFont, List<FontTriplet> tripletList) {
this.font = afpFont;
this.tripletList = tripletList;
}
/**
* Returns the afp font
*
* @return the afp font
*/
public AFPFont getAFPFont() {
return font;
}
/**
* Returns the list of font triplets associated with this font.
*
* @return List of font triplets
*/
public List<FontTriplet> getFontTriplets() {
return tripletList;
}
}
@@ -0,0 +1,64 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.afp.fonts;
/**
* Holds the current page fonts
*/
public class AFPPageFonts extends java.util.HashMap {
private static final long serialVersionUID = -4991896259427109041L;
/**
* Default constructor
*/
public AFPPageFonts() {
super();
}
/**
* Parameterized constructor
*
* @param fonts an existing set of afp page fonts
*/
public AFPPageFonts(AFPPageFonts fonts) {
super(fonts);
}
/**
* Registers a font on the current page and returns font attributes
*
* @param fontName the internal font name
* @param font the AFPFont
* @param fontSize the font point size
* @return newly registered AFPFontAttributes
*/
public AFPFontAttributes registerFont(String fontName, AFPFont font, int fontSize) {
String pageFontKey = fontName + "_" + fontSize;
AFPFontAttributes afpFontAttributes = (AFPFontAttributes)super.get(pageFontKey);
// Add to page font mapping if not already present
if (afpFontAttributes == null) {
afpFontAttributes = new AFPFontAttributes(fontName, font, fontSize);
super.put(pageFontKey, afpFontAttributes);
int fontRef = super.size();
afpFontAttributes.setFontReference(fontRef);
}
return afpFontAttributes;
}
}
@@ -0,0 +1,149 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.afp.fonts;
import org.apache.fop.afp.AFPEventProducer;
/**
* A font defined as a set of lines and curves as opposed to a bitmap font. An
* outline font can be scaled to any size and otherwise transformed more easily
* than a bitmap font, and with more attractive results.
*/
public abstract class AbstractOutlineFont extends AFPFont {
/** The character set for this font */
protected CharacterSet charSet;
private final AFPEventProducer eventProducer;
/**
* Constructor for an outline font.
*
* @param name the name of the font
* @param embeddable sets whether or not this font is to be embedded
* @param charSet the chracter set
* @param eventProducer The object to handle any events which occur from the object.
*/
public AbstractOutlineFont(String name, boolean embeddable, CharacterSet charSet,
AFPEventProducer eventProducer) {
super(name, embeddable);
this.charSet = charSet;
this.eventProducer = eventProducer;
}
AFPEventProducer getAFPEventProducer() {
return eventProducer;
}
/**
* Get the character set metrics.
*
* @return the character set
*/
public CharacterSet getCharacterSet() {
return charSet;
}
/**
* Get the character set metrics.
* @param size ignored
* @return the character set
*/
public CharacterSet getCharacterSet(int size) {
return charSet;
}
/**
* The ascender is the part of a lowercase letter that extends above the
* "x-height" (the height of the letter "x"), such as "d", "t", or "h". Also
* used to denote the part of the letter extending above the x-height.
*
* @param size the font size (in mpt)
* @return the ascender for the given size
*/
public int getAscender(int size) {
return charSet.getAscender() * size;
}
/** {@inheritDoc} */
public int getUnderlinePosition(int size) {
return charSet.getUnderscorePosition() * size;
}
@Override
public int getUnderlineThickness(int size) {
int underscoreWidth = charSet.getUnderscoreWidth();
return underscoreWidth == 0 ? super.getUnderlineThickness(size) : underscoreWidth * size;
}
/**
* Obtains the height of capital letters for the specified point size.
*
* @param size the font size (in mpt)
* @return the cap height for the given size
*/
public int getCapHeight(int size) {
return charSet.getCapHeight() * size;
}
/**
* The descender is the part of a lowercase letter that extends below the
* base line, such as "g", "j", or "p". Also used to denote the part of the
* letter extending below the base line.
*
* @param size the font size (in mpt)
* @return the descender for the given size
*/
public int getDescender(int size) {
return charSet.getDescender() * size;
}
/**
* The "x-height" (the height of the letter "x").
*
* @param size the font size (in mpt)
* @return the x height for the given size
*/
public int getXHeight(int size) {
return charSet.getXHeight() * size;
}
/** {@inheritDoc} */
public boolean hasChar(char c) {
return charSet.hasChar(c);
}
/**
* Map a Unicode character to a code point in the font.
* @param c character to map
* @return the mapped character
*/
public char mapChar(char c) {
return charSet.mapChar(c);
}
/** {@inheritDoc} */
public String getEncodingName() {
return charSet.getEncoding();
}
}
@@ -0,0 +1,370 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.afp.fonts;
import java.awt.Rectangle;
import java.io.UnsupportedEncodingException;
import java.nio.charset.CharacterCodingException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.fop.afp.AFPConstants;
import org.apache.fop.afp.AFPEventProducer;
import org.apache.fop.afp.fonts.CharactersetEncoder.EncodedChars;
import org.apache.fop.afp.util.AFPResourceAccessor;
import org.apache.fop.afp.util.StringUtils;
/**
* The IBM Font Object Content Architecture (FOCA) supports presentation
* of character shapes by defining their characteristics, which include
* font description information for identifying the characters, font metric
* information for positioning the characters, and character shape information
* for presenting the character images.
* <br>
* Presenting a graphic character on a presentation surface requires
* information on the rotation and position of character on the physical
* or logical page.
* <br>
* This class proivdes font metric information for a particular font
* as identified by the character set name. This information is obtained
* directly from the AFP font files which must be installed in the path
* specified in the afp-fonts xml definition file.
* <br>
*/
public class CharacterSet {
/** Static logging instance */
protected static final Log LOG = LogFactory.getLog(CharacterSet.class.getName());
/** default codepage */
public static final String DEFAULT_CODEPAGE = "T1V10500";
/** default encoding */
public static final String DEFAULT_ENCODING = "Cp500";
private static final int MAX_NAME_LEN = 8;
/** The current orientation (currently only 0 is supported by FOP) */
public static final int SUPPORTED_ORIENTATION = 0;
/** The code page to which the character set relates */
protected final String codePage;
/** The encoding used for the code page */
protected final String encoding;
/** The characterset encoder corresponding to this encoding */
private final CharactersetEncoder encoder;
/** The character set relating to the font */
protected final String name;
/** The path to the installed fonts */
private final AFPResourceAccessor accessor;
/** The collection of objects for each orientation */
private CharacterSetOrientation characterSetOrientation;
/** The nominal vertical size (in millipoints) for bitmap fonts. 0 for outline fonts. */
private int nominalVerticalSize;
/**
* Constructor for the CharacterSetMetric object, the character set is used to load the font
* information from the actual AFP font.
*
* @param codePage the code page identifier
* @param encoding the encoding of the font
* @param charsetType the type of the characterset
* @param name the character set name
* @param accessor the resource accessor to load resource with
* @param eventProducer for handling AFP related events
*/
CharacterSet(String codePage, String encoding, CharacterSetType charsetType, String name,
AFPResourceAccessor accessor, AFPEventProducer eventProducer) {
if (name.length() > MAX_NAME_LEN) {
String msg = "Character set name '" + name + "' must be a maximum of "
+ MAX_NAME_LEN + " characters";
eventProducer.characterSetNameInvalid(this, msg);
throw new IllegalArgumentException(msg);
}
// the character set name must be 8 chars long
this.name = padName(name);
if (codePage == null) {
this.codePage = null;
} else {
// the code page name must be 8 chars long
this.codePage = padName(codePage);
}
this.encoding = encoding;
this.encoder = charsetType.getEncoder(encoding);
this.accessor = accessor;
}
// right pad short names with space
private String padName(String name) {
return name.length() < MAX_NAME_LEN ? StringUtils.rpad(name, ' ', MAX_NAME_LEN) : name;
}
/**
* Add character set metric information for the different orientations
*
* @param cso the metrics for the orientation
*/
public void addCharacterSetOrientation(CharacterSetOrientation cso) {
if (cso.getOrientation() == SUPPORTED_ORIENTATION) {
characterSetOrientation = cso;
}
}
/**
* Sets the nominal vertical size of the font in the case of bitmap fonts.
* @param nominalVerticalSize the nominal vertical size (in millipoints)
*/
public void setNominalVerticalSize(int nominalVerticalSize) {
this.nominalVerticalSize = nominalVerticalSize;
}
/**
* Returns the nominal vertical size of the font in the case of bitmap fonts. For outline fonts,
* zero is returned, because these are scalable fonts.
* @return the nominal vertical size (in millipoints) for bitmap fonts, or 0 for outline fonts.
*/
public int getNominalVerticalSize() {
return this.nominalVerticalSize;
}
/**
* Ascender height is the distance from the character baseline to the
* top of the character box. A negative ascender height signifies that
* all of the graphic character is below the character baseline. For
* a character rotation other than 0, ascender height loses its
* meaning when the character is lying on its side or is upside down
* with respect to normal viewing orientation. For the general case,
* Ascender Height is the characters most positive y-axis value.
* For bounded character boxes, for a given character having an
* ascender, ascender height and baseline offset are equal.
*
* @return the ascender value in millipoints
*/
public int getAscender() {
return getCharacterSetOrientation().getAscender();
}
/**
* Return the width to use for an underscore (_) character.
*
* @return the width of an underscore character
*/
public int getUnderscoreWidth() {
return getCharacterSetOrientation().getUnderscoreWidth();
}
/**
* Return the position for an underscore (_) character.
*
* @return the position of an underscore character
*/
public int getUnderscorePosition() {
return getCharacterSetOrientation().getUnderscorePosition();
}
/**
* Cap height is the average height of the uppercase characters in
* a font. This value is specified by the designer of a font and is
* usually the height of the uppercase M.
*
* @return the cap height value in millipoints
*/
public int getCapHeight() {
return getCharacterSetOrientation().getCapHeight();
}
/**
* Descender depth is the distance from the character baseline to
* the bottom of a character box. A negative descender depth signifies
* that all of the graphic character is above the character baseline.
*
* @return the descender value in millipoints
*/
public int getDescender() {
return getCharacterSetOrientation().getDescender();
}
/**
* Returns the resource accessor to load the font resources with.
* @return the resource accessor to load the font resources with
*/
public AFPResourceAccessor getResourceAccessor() {
return this.accessor;
}
/**
* XHeight refers to the height of the lower case letters above the baseline.
*
* @return the typical height of characters
*/
public int getXHeight() {
return getCharacterSetOrientation().getXHeight();
}
/**
* Get the width (in 1/1000ths of a point size) of the character
* identified by the parameter passed.
*
* @param character the Unicode character from which the width will be calculated
* @param size the font size
* @return the width of the character
*/
public int getWidth(char character, int size) {
return getCharacterSetOrientation().getWidth(character, size);
}
public Rectangle getCharacterBox(char character, int size) {
return getCharacterSetOrientation().getCharacterBox(character, size);
}
/**
* Returns the AFP character set identifier
*
* @return the AFP character set identifier
*/
public String getName() {
return name;
}
/**
* Returns the AFP character set identifier as a byte array
*
* @return the AFP character set identifier as a byte array
*/
public byte[] getNameBytes() {
byte[] nameBytes = null;
try {
nameBytes = name.getBytes(AFPConstants.EBCIDIC_ENCODING);
} catch (UnsupportedEncodingException usee) {
// @SuppressFBWarnings("DM_DEFAULT_ENCODING")
nameBytes = name.getBytes();
LOG.warn(
"UnsupportedEncodingException translating the name " + name);
}
return nameBytes;
}
/**
* Returns the AFP code page identifier
*
* @return the AFP code page identifier
*/
public String getCodePage() {
return codePage;
}
/**
* Returns the AFP code page encoding
*
* @return the AFP code page encoding
*/
public String getEncoding() {
return encoding;
}
/**
* Helper method to return the current CharacterSetOrientation, note
* that FOP does not yet implement the "reference-orientation"
* attribute therefore we always use the orientation zero degrees,
* Other orientation information is captured for use by a future
* implementation (whenever FOP implement the mechanism). This is also
* the case for landscape prints which use an orientation of 270 degrees,
* in 99.9% of cases the font metrics will be the same as the 0 degrees
* therefore the implementation currently will always use 0 degrees.
*
* @return characterSetOrentation The current orientation metrics.
*/
private CharacterSetOrientation getCharacterSetOrientation() {
return characterSetOrientation;
}
/**
* Indicates whether the given char in the character set.
* @param c the character to check
* @return true if the character is in the character set
*/
public boolean hasChar(char c) {
if (encoder != null) {
return encoder.canEncode(c);
} else {
//Sun Java 1.4.2 compatibility
return true;
}
}
/**
* Encodes a character sequence to a byte array.
* @param chars the characters
* @return the encoded characters
* @throws CharacterCodingException if the encoding operation fails
*/
public EncodedChars encodeChars(CharSequence chars) throws CharacterCodingException {
return encoder.encode(chars);
}
/**
* Map a Unicode character to a code point in the font.
* The code tables are already converted to Unicode therefore
* we can use the identity mapping.
*
* @param c the Unicode character to map
* @return the mapped character
*/
public char mapChar(char c) {
//TODO This is not strictly correct but we'll let it be for the moment
return c;
}
/**
* Returns the increment for an space.
* @return the space increment
*/
public int getSpaceIncrement() {
return getCharacterSetOrientation().getSpaceIncrement();
}
/**
* Returns the increment for an em space.
* @return the em space increment
*/
public int getEmSpaceIncrement() {
return getCharacterSetOrientation().getEmSpaceIncrement();
}
/**
* Returns the nominal character increment.
* @return the nominal character increment
*/
public int getNominalCharIncrement() {
return getCharacterSetOrientation().getNominalCharIncrement();
}
}
@@ -0,0 +1,739 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.afp.fonts;
import java.awt.Rectangle;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.WeakHashMap;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.xmlgraphics.image.loader.util.SoftMapCache;
import org.apache.fop.afp.AFPConstants;
import org.apache.fop.afp.AFPEventProducer;
import org.apache.fop.afp.util.AFPResourceAccessor;
import org.apache.fop.afp.util.StructuredFieldReader;
import org.apache.fop.apps.io.InternalResourceResolver;
import org.apache.fop.fonts.Typeface;
/**
* The CharacterSetBuilder is responsible building the a CharacterSet instance that holds
* the font metric data. The data is either read from disk and passed to a CharacterSet (*)
* or a FopCharacterSet is instantiated that is composed of a Typeface instance configured
* with this data.<br>
* -*- For referenced fonts CharacterSetBuilder is responsible for reading the font attributes
* from binary code page files and the character set metric files. In IBM font structure, a
* code page maps each character of text to the characters in a character set.
* Each character is translated into a code point. When the character is
* printed, each code point is matched to a character ID on the code page
* specified. The character ID is then matched to the image (raster pattern or
* outline pattern) of the character in the character set specified. The image
* in the character set is the image that is printed in the document. To be a
* valid code page for a particular character set, all character IDs in the code
* page must be included in that character set.<br>
* This class will read the font information from the binary code page files and character
* set metric files in order to determine the correct metrics to use when rendering the
* formatted object.
*/
public abstract class CharacterSetBuilder {
/**
* Static logging instance
*/
protected static final Log LOG = LogFactory.getLog(CharacterSetBuilder.class);
/**
* Template used to convert lists to arrays.
*/
private static final CharacterSetOrientation[] EMPTY_CSO_ARRAY = new CharacterSetOrientation[0];
/** Codepage MO:DCA structured field. */
private static final byte[] CODEPAGE_SF = new byte[] {
(byte) 0xD3, (byte) 0xA8, (byte) 0x87};
/** Character table MO:DCA structured field. */
private static final byte[] CHARACTER_TABLE_SF = new byte[] {
(byte) 0xD3, (byte) 0x8C, (byte) 0x87};
/** Font descriptor MO:DCA structured field. */
private static final byte[] FONT_DESCRIPTOR_SF = new byte[] {
(byte) 0xD3, (byte) 0xA6, (byte) 0x89 };
/** Font control MO:DCA structured field. */
private static final byte[] FONT_CONTROL_SF = new byte[] {
(byte) 0xD3, (byte) 0xA7, (byte) 0x89 };
/** Font orientation MO:DCA structured field. */
private static final byte[] FONT_ORIENTATION_SF = new byte[] {
(byte) 0xD3, (byte) 0xAE, (byte) 0x89 };
/** Font position MO:DCA structured field. */
private static final byte[] FONT_POSITION_SF = new byte[] {
(byte) 0xD3, (byte) 0xAC, (byte) 0x89 };
/** Font index MO:DCA structured field. */
private static final byte[] FONT_INDEX_SF = new byte[] {
(byte) 0xD3, (byte) 0x8C, (byte) 0x89 };
/**
* The collection of code pages
*/
private final Map<String, Map<String, String>> codePagesCache
= Collections.synchronizedMap(new WeakHashMap<String, Map<String, String>>());
/**
* Cache of charactersets
*/
private final SoftMapCache characterSetsCache = new SoftMapCache(true);
/** Default constructor. */
private CharacterSetBuilder() {
}
/**
* Returns an InputStream to a given file path and filename
*
* @param accessor the resource accessor
* @param uriStr the URI
* @param eventProducer for handling AFP related events
* @return an inputStream
* @throws IOException in the event that an I/O exception of some sort has occurred
*/
private InputStream openInputStream(AFPResourceAccessor accessor, String uriStr,
AFPEventProducer eventProducer)
throws IOException {
URI uri;
try {
uri = InternalResourceResolver.cleanURI(uriStr.trim());
} catch (URISyntaxException e) {
throw new MalformedURLException("Invalid uri: " + uriStr + " (" + e.getMessage() + ")");
}
if (LOG.isDebugEnabled()) {
LOG.debug("Opening " + uri);
}
return accessor.createInputStream(uri);
}
/**
* Closes the inputstream
*
* @param inputStream the inputstream to close
*/
private void closeInputStream(InputStream inputStream) {
try {
if (inputStream != null) {
inputStream.close();
}
} catch (Exception ex) {
// Lets log at least!
LOG.error(ex.getMessage());
}
}
/**
* Load the font details and metrics into the CharacterSetMetric object, this will use the
* actual afp code page and character set files to load the object with the necessary metrics.
*
* @param characterSetName name of the characterset
* @param codePageName name of the code page file
* @param encoding encoding name
* @param accessor used to load codepage and characterset
* @param eventProducer for handling AFP related events
* @return CharacterSet object
* @throws IOException if an I/O error occurs
*/
public CharacterSet buildSBCS(String characterSetName, String codePageName, String encoding,
AFPResourceAccessor accessor, AFPEventProducer eventProducer) throws IOException {
return processFont(characterSetName, codePageName, encoding, CharacterSetType.SINGLE_BYTE,
accessor, eventProducer);
}
/**
* Load the font details and metrics into the CharacterSetMetric object, this will use the
* actual afp code page and character set files to load the object with the necessary metrics.
* This method is to be used for double byte character sets (DBCS).
*
* @param characterSetName name of the characterset
* @param codePageName name of the code page file
* @param encoding encoding name
* @param charsetType the characterset type
* @param accessor used to load codepage and characterset
* @param eventProducer for handling AFP related events
* @return CharacterSet object
* @throws IOException if an I/O error occurs
*/
public CharacterSet buildDBCS(String characterSetName, String codePageName, String encoding,
CharacterSetType charsetType, AFPResourceAccessor accessor, AFPEventProducer eventProducer)
throws IOException {
return processFont(characterSetName, codePageName, encoding, charsetType, accessor,
eventProducer);
}
/**
* Load the font details and metrics into the CharacterSetMetric object, this will use the
* actual afp code page and character set files to load the object with the necessary metrics.
*
* @param characterSetName the CharacterSetMetric object to populate
* @param codePageName the name of the code page to use
* @param encoding name of the encoding in use
* @param typeface base14 font name
* @param eventProducer for handling AFP related events
* @return CharacterSet object
* @throws IOException if an I/O error occurs
*/
public CharacterSet build(String characterSetName, String codePageName, String encoding,
Typeface typeface, AFPEventProducer eventProducer) throws IOException {
return new FopCharacterSet(codePageName, encoding, characterSetName, typeface,
eventProducer);
}
public CharacterSet build(String characterSetName, String codePageName, String encoding,
Typeface typeface, AFPResourceAccessor accessor, AFPEventProducer eventProducer)
throws IOException {
return new FopCharacterSet(codePageName, encoding, characterSetName, typeface, accessor, eventProducer);
}
private CharacterSet processFont(String characterSetName, String codePageName, String encoding,
CharacterSetType charsetType, AFPResourceAccessor accessor, AFPEventProducer eventProducer)
throws IOException {
// check for cached version of the characterset
URI charSetURI = accessor.resolveURI(characterSetName);
String cacheKey = charSetURI.toASCIIString() + "_" + characterSetName + "_" + codePageName;
CharacterSet characterSet = (CharacterSet) characterSetsCache.get(cacheKey);
if (characterSet != null) {
return characterSet;
}
// characterset not in the cache, so recreating
characterSet = new CharacterSet(codePageName, encoding, charsetType, characterSetName,
accessor, eventProducer);
InputStream inputStream = null;
try {
/**
* Get the code page which contains the character mapping
* information to map the unicode character id to the graphic
* chracter global identifier.
*/
Map<String, String> codePage;
// TODO: This could have performance implications if several threads want to use the
// codePagesCache to retrieve different codepages.
synchronized (codePagesCache) {
codePage = codePagesCache.get(codePageName);
if (codePage == null) {
codePage = loadCodePage(codePageName, encoding, accessor, eventProducer);
codePagesCache.put(codePageName, codePage);
}
}
inputStream = openInputStream(accessor, characterSetName, eventProducer);
StructuredFieldReader structuredFieldReader = new StructuredFieldReader(inputStream);
// Process D3A689 Font Descriptor
FontDescriptor fontDescriptor = processFontDescriptor(structuredFieldReader);
characterSet.setNominalVerticalSize(fontDescriptor.getNominalFontSizeInMillipoints());
// Process D3A789 Font Control
FontControl fontControl = processFontControl(structuredFieldReader);
if (fontControl != null) {
//process D3AE89 Font Orientation
CharacterSetOrientation[] characterSetOrientations
= processFontOrientation(structuredFieldReader);
double metricNormalizationFactor;
if (fontControl.isRelative()) {
metricNormalizationFactor = 1;
} else {
int dpi = fontControl.getDpi();
metricNormalizationFactor = 1000.0d * 72000.0d
/ fontDescriptor.getNominalFontSizeInMillipoints() / dpi;
}
ValueNormalizer normalizer = new ValueNormalizer(metricNormalizationFactor);
//process D3AC89 Font Position
processFontPosition(structuredFieldReader, characterSetOrientations, normalizer);
//process D38C89 Font Index (per orientation)
for (CharacterSetOrientation characterSetOrientation : characterSetOrientations) {
processFontIndex(structuredFieldReader, characterSetOrientation, codePage, normalizer);
characterSet.addCharacterSetOrientation(characterSetOrientation);
}
} else {
throw new IOException("Missing D3AE89 Font Control structured field.");
}
} finally {
closeInputStream(inputStream);
}
characterSetsCache.put(cacheKey, characterSet);
return characterSet;
}
private static class ValueNormalizer {
private final double factor;
public ValueNormalizer(double factor) {
this.factor = factor;
}
public int normalize(int value) {
return (int) Math.round(value * factor);
}
}
/**
* Load the code page information from the appropriate file. The file name
* to load is determined by the code page name and the file extension 'CDP'.
*
* @param codePage
* the code page identifier
* @param encoding
* the encoding to use for the character decoding
* @param accessor the resource accessor
* @param eventProducer for handling AFP related events
* @return a code page mapping (key: GCGID, value: Unicode character)
* @throws IOException if an I/O exception of some sort has occurred.
*/
protected Map<String, String> loadCodePage(String codePage, String encoding,
AFPResourceAccessor accessor, AFPEventProducer eventProducer) throws IOException {
// Create the HashMap to store code page information
Map<String, String> codePages = new HashMap<String, String>();
InputStream inputStream = null;
try {
inputStream = openInputStream(accessor, codePage.trim(), eventProducer);
} catch (IOException e) {
eventProducer.codePageNotFound(this, e);
throw e;
}
try {
StructuredFieldReader structuredFieldReader = new StructuredFieldReader(inputStream);
byte[] data = structuredFieldReader.getNext(CHARACTER_TABLE_SF);
int position = 0;
byte[] gcgiBytes = new byte[8];
byte[] charBytes = new byte[1];
// Read data, ignoring bytes 0 - 2
for (int index = 3; index < data.length; index++) {
if (position < 8) {
// Build the graphic character global identifier key
gcgiBytes[position] = data[index];
position++;
} else if (position == 9) {
position = 0;
// Set the character
charBytes[0] = data[index];
String gcgiString = new String(gcgiBytes,
AFPConstants.EBCIDIC_ENCODING);
//Use the 8-bit char index to find the Unicode character using the Java encoding
//given in the configuration. If the code page and the Java encoding don't
//match, a wrong Unicode character will be associated with the AFP GCGID.
//Idea: we could use IBM's GCGID to Unicode map and build code pages ourselves.
String charString = new String(charBytes, encoding);
codePages.put(gcgiString, charString);
} else {
position++;
}
}
} finally {
closeInputStream(inputStream);
}
return codePages;
}
/**
* Process the font descriptor details using the structured field reader.
*
* @param structuredFieldReader the structured field reader
* @return a class representing the font descriptor
* @throws IOException if an I/O exception of some sort has occurred.
*/
private static FontDescriptor processFontDescriptor(
StructuredFieldReader structuredFieldReader) throws IOException {
byte[] fndData = structuredFieldReader.getNext(FONT_DESCRIPTOR_SF);
return new FontDescriptor(fndData);
}
/**
* Process the font control details using the structured field reader.
*
* @param structuredFieldReader
* the structured field reader
* @return the FontControl
* @throws IOException if an I/O exception of some sort has occurred.
*/
private FontControl processFontControl(StructuredFieldReader structuredFieldReader)
throws IOException {
byte[] fncData = structuredFieldReader.getNext(FONT_CONTROL_SF);
FontControl fontControl = null;
if (fncData != null) {
fontControl = new FontControl();
if (fncData[7] == (byte) 0x02) {
fontControl.setRelative(true);
}
int metricResolution = getUBIN(fncData, 9);
if (metricResolution == 1000) {
//Special case: 1000 units per em (rather than dpi)
fontControl.setUnitsPerEm(1000);
} else {
fontControl.setDpi(metricResolution / 10);
}
}
return fontControl;
}
/**
* Process the font orientation details from using the structured field
* reader.
*
* @param structuredFieldReader
* the structured field reader
* @return CharacterSetOrientation array
* @throws IOException if an I/O exception of some sort has occurred.
*/
private CharacterSetOrientation[] processFontOrientation(
StructuredFieldReader structuredFieldReader) throws IOException {
byte[] data = structuredFieldReader.getNext(FONT_ORIENTATION_SF);
int position = 0;
byte[] fnoData = new byte[26];
List<CharacterSetOrientation> orientations = new ArrayList<CharacterSetOrientation>();
// Read data, ignoring bytes 0 - 2
for (int index = 3; index < data.length; index++) {
// Build the font orientation record
fnoData[position] = data[index];
position++;
if (position == 26) {
position = 0;
int orientation = determineOrientation(fnoData[2]);
int spaceIncrement = getUBIN(fnoData, 8);
int emIncrement = getUBIN(fnoData, 14);
int nominalCharacterIncrement = getUBIN(fnoData, 20);
orientations.add(new CharacterSetOrientation(orientation, spaceIncrement,
emIncrement, nominalCharacterIncrement));
}
}
return orientations.toArray(EMPTY_CSO_ARRAY);
}
/**
* Populate the CharacterSetOrientation object in the suplied array with the
* font position details using the supplied structured field reader.
*
* @param structuredFieldReader
* the structured field reader
* @param characterSetOrientations
* the array of CharacterSetOrientation objects
* @param metricNormalizationFactor factor to apply to the metrics to get normalized
* font metric values
* @throws IOException if an I/O exception of some sort has occurred.
*/
private void processFontPosition(StructuredFieldReader structuredFieldReader,
CharacterSetOrientation[] characterSetOrientations, ValueNormalizer normalizer)
throws IOException {
byte[] data = structuredFieldReader.getNext(FONT_POSITION_SF);
int position = 0;
byte[] fpData = new byte[26];
int characterSetOrientationIndex = 0;
// Read data, ignoring bytes 0 - 2
for (int index = 3; index < data.length; index++) {
if (position < 22) {
// Build the font orientation record
fpData[position] = data[index];
if (position == 9) {
CharacterSetOrientation characterSetOrientation
= characterSetOrientations[characterSetOrientationIndex];
int xHeight = getSBIN(fpData, 2);
int capHeight = getSBIN(fpData, 4);
int ascHeight = getSBIN(fpData, 6);
int dscHeight = getSBIN(fpData, 8);
dscHeight = dscHeight * -1;
int underscoreWidth = getUBIN(fpData, 17);
int underscorePosition = getSBIN(fpData, 20);
characterSetOrientation.setXHeight(normalizer.normalize(xHeight));
characterSetOrientation.setCapHeight(normalizer.normalize(capHeight));
characterSetOrientation.setAscender(normalizer.normalize(ascHeight));
characterSetOrientation.setDescender(normalizer.normalize(dscHeight));
characterSetOrientation.setUnderscoreWidth(normalizer.normalize(underscoreWidth));
characterSetOrientation.setUnderscorePosition(normalizer.normalize(underscorePosition));
}
} else if (position == 22) {
position = 0;
characterSetOrientationIndex++;
fpData[position] = data[index];
}
position++;
}
}
private void processFontIndex(StructuredFieldReader structuredFieldReader, CharacterSetOrientation cso,
Map<String, String> codepage, ValueNormalizer normalizer)
throws IOException {
byte[] data = structuredFieldReader.getNext(FONT_INDEX_SF);
int position = 0;
byte[] gcgid = new byte[8];
byte[] fiData = new byte[20];
String firstABCMismatch = null;
// Read data, ignoring bytes 0 - 2
for (int index = 3; index < data.length; index++) {
if (position < 8) {
gcgid[position] = data[index];
position++;
} else if (position < 27) {
fiData[position - 8] = data[index];
position++;
} else if (position == 27) {
fiData[position - 8] = data[index];
position = 0;
String gcgiString = new String(gcgid, AFPConstants.EBCIDIC_ENCODING);
String idx = codepage.get(gcgiString);
if (idx != null) {
char cidx = idx.charAt(0);
int width = getUBIN(fiData, 0);
int ascendHt = getSBIN(fiData, 2);
int descendDp = getSBIN(fiData, 4);
int a = getSBIN(fiData, 10);
int b = getUBIN(fiData, 12);
int c = getSBIN(fiData, 14);
int abc = a + b + c;
int diff = Math.abs(abc - width);
if (diff != 0 && width != 0) {
double diffPercent = 100 * diff / (double) width;
if (diffPercent > 2) {
if (LOG.isTraceEnabled()) {
LOG.trace(gcgiString + ": "
+ a + " + " + b + " + " + c + " = " + (a + b + c)
+ " but found: " + width);
}
if (firstABCMismatch == null) {
firstABCMismatch = gcgiString;
}
}
}
int normalizedWidth = normalizer.normalize(width);
int x0 = normalizer.normalize(a);
int y0 = normalizer.normalize(-descendDp);
int dx = normalizer.normalize(b);
int dy = normalizer.normalize(ascendHt + descendDp);
cso.setCharacterMetrics(cidx, normalizedWidth, new Rectangle(x0, y0, dx, dy));
}
}
}
if (LOG.isDebugEnabled() && firstABCMismatch != null) {
//Debug level because it usually is no problem.
LOG.debug("Font has metrics inconsitencies where A+B+C doesn't equal the"
+ " character increment. The first such character found: "
+ firstABCMismatch);
}
}
private static int getUBIN(byte[] data, int start) {
return ((data[start] & 0xFF) << 8) + (data[start + 1] & 0xFF);
}
private static int getSBIN(byte[] data, int start) {
int ubin = ((data[start] & 0xFF) << 8) + (data[start + 1] & 0xFF);
if ((ubin & 0x8000) != 0) {
//extend sign
return ubin | 0xFFFF0000;
} else {
return ubin;
}
}
private static class FontControl {
private int dpi;
private int unitsPerEm;
private boolean isRelative;
public int getDpi() {
return dpi;
}
public void setDpi(int i) {
dpi = i;
}
public int getUnitsPerEm() {
return this.unitsPerEm;
}
public void setUnitsPerEm(int value) {
this.unitsPerEm = value;
}
public boolean isRelative() {
return isRelative;
}
public void setRelative(boolean b) {
isRelative = b;
}
}
private static class FontDescriptor {
private byte[] data;
public FontDescriptor(byte[] data) {
this.data = data;
}
public int getNominalFontSizeInMillipoints() {
int nominalFontSize = 100 * getUBIN(data, 39);
return nominalFontSize;
}
}
public static final class SingleByteLoader extends CharacterSetBuilder {
public SingleByteLoader() {
super();
}
}
/**
* Double-byte (CID Keyed font (Type 0)) implementation of AFPFontReader.
*/
public static final class DoubleByteLoader extends CharacterSetBuilder {
public DoubleByteLoader() {
}
@Override
protected Map<String, String> loadCodePage(String codePage, String encoding,
AFPResourceAccessor accessor, AFPEventProducer eventProducer) throws IOException {
// Create the HashMap to store code page information
Map<String, String> codePages = new HashMap<String, String>();
InputStream inputStream = null;
try {
inputStream = super.openInputStream(accessor, codePage.trim(), eventProducer);
} catch (IOException e) {
eventProducer.codePageNotFound(this, e);
throw e;
}
try {
StructuredFieldReader structuredFieldReader = new StructuredFieldReader(inputStream);
byte[] data;
while ((data = structuredFieldReader.getNext(CHARACTER_TABLE_SF)) != null) {
int position = 0;
byte[] gcgiBytes = new byte[8];
byte[] charBytes = new byte[2];
// Read data, ignoring bytes 0 - 2
for (int index = 3; index < data.length; index++) {
if (position < 8) {
// Build the graphic character global identifier key
gcgiBytes[position] = data[index];
position++;
} else if (position == 9) {
// Set the character
charBytes[0] = data[index];
position++;
} else if (position == 10) {
position = 0;
// Set the character
charBytes[1] = data[index];
String gcgiString = new String(gcgiBytes,
AFPConstants.EBCIDIC_ENCODING);
String charString = new String(charBytes, encoding);
codePages.put(gcgiString, charString);
} else {
position++;
}
}
}
} finally {
super.closeInputStream(inputStream);
}
return codePages;
}
}
private static int determineOrientation(byte orientation) {
int degrees = 0;
switch (orientation) {
case 0x00:
degrees = 0;
break;
case 0x2D:
degrees = 90;
break;
case 0x5A:
degrees = 180;
break;
case (byte) 0x87:
degrees = 270;
break;
default:
throw new IllegalStateException("Invalid orientation: " + orientation);
}
return degrees;
}
}
@@ -0,0 +1,318 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.afp.fonts;
import java.awt.Rectangle;
/**
* The IBM Font Object Content Architecture (FOCA) supports presentation
* of character shapes by defining their characteristics, which include
* Font-Description information for identifying the characters, Font-Metric
* information for positioning the characters, and Character-Shape
* information for presenting the character images.<br>
*
* Presenting a graphic character on a presentation surface requires
* that you communicate this information clearly to rotate and position
* characters correctly on the physical or logical page.<br>
*
* This class provides font metric information for a particular font
* as by the orientation.<br>
*
* This information is obtained directly from the AFP font files which must
* be installed in the classpath under in the location specified by the path
* attribute in the afp-font.xml file.
*/
public class CharacterSetOrientation {
/**
* The ascender height for the character set
*/
private int ascender;
/**
* The descender depth for the character set
*/
private int descender;
/**
* The height of capital letters
*/
private int capHeight;
/**
* The character widths in the character set (indexed using Unicode codepoints)
*/
private IntegerKeyStore<CharacterMetrics> characterMetrics;
/**
* The height of lowercase letters
*/
private int xHeight;
/** The character set orientation */
private final int orientation;
/** space increment */
private final int spaceIncrement;
/** em space increment */
private final int emSpaceIncrement;
/** Nominal Character Increment */
private final int nomCharIncrement;
private int underscoreWidth;
private int underscorePosition;
/**
* Constructor for the CharacterSetOrientation, the orientation is
* expressed as the degrees rotation (i.e 0, 90, 180, 270)
*
* @param orientation the character set orientation
* @param spaceIncrement the space increment
* @param emSpaceIncrement the em space increment
* @param nomCharIncrement the nominal character increment
*/
public CharacterSetOrientation(int orientation, int spaceIncrement, int emSpaceIncrement,
int nomCharIncrement) {
this.orientation = orientation;
this.spaceIncrement = spaceIncrement;
this.emSpaceIncrement = emSpaceIncrement;
this.nomCharIncrement = nomCharIncrement;
this.characterMetrics = new IntegerKeyStore<CharacterMetrics>();
}
/**
* Ascender height is the distance from the character baseline to the
* top of the character box. A negative ascender height signifies that
* all of the graphic character is below the character baseline. For
* a character rotation other than 0, ascender height loses its
* meaning when the character is lying on its side or is upside down
* with respect to normal viewing orientation. For the general case,
* Ascender Height is the character's most positive y-axis value.
* For bounded character boxes, for a given character having an
* ascender, ascender height and baseline offset are equal.
* @return the ascender value in millipoints
*/
public int getAscender() {
return ascender;
}
/**
* Cap height is the average height of the uppercase characters in
* a font. This value is specified by the designer of a font and is
* usually the height of the uppercase M.
* @return the cap height value in millipoints
*/
public int getCapHeight() {
return capHeight;
}
/**
* Descender depth is the distance from the character baseline to
* the bottom of a character box. A negative descender depth signifies
* that all of the graphic character is above the character baseline.
* @return the descender value in millipoints
*/
public int getDescender() {
return descender;
}
/**
*
* @return the underscore width
*/
public int getUnderscoreWidth() {
return underscoreWidth;
}
/**
*
* @return the underscore position
*/
public int getUnderscorePosition() {
return underscorePosition;
}
/**
* The orientation for these metrics in the character set
* @return the orientation
*/
public int getOrientation() {
return orientation;
}
/**
* XHeight refers to the height of the lower case letters above
* the baseline.
* @return heightX the typical height of characters
*/
public int getXHeight() {
return xHeight;
}
/**
* Get the width (in 1/1000ths of a point size) of the character
* identified by the parameter passed.
* @param character the Unicode character to evaluate
* @param size the font size
* @return the widths of the character
*/
public int getWidth(char character, int size) {
CharacterMetrics cm = getCharacterMetrics(character);
return cm == null ? -1 : size * cm.width;
}
private CharacterMetrics getCharacterMetrics(char character) {
return characterMetrics.get((int) character);
}
/**
* Get the character box (rectangle with dimensions in 1/1000ths of a point size) of the character
* identified by the parameter passed.
* @param character the Unicode character to evaluate
* @param size the font size
* @return the character box
*/
public Rectangle getCharacterBox(char character, int size) {
CharacterMetrics cm = getCharacterMetrics(character);
return scale(cm == null ? getFallbackCharacterBox() : cm.characterBox, size);
}
private static Rectangle scale(Rectangle rectangle, int size) {
if (rectangle == null) {
return null;
} else {
return new Rectangle((int) (size * rectangle.getX()), (int) (size * rectangle.getY()),
(int) (size * rectangle.getWidth()), (int) (size * rectangle.getHeight()));
}
}
private Rectangle getFallbackCharacterBox() {
// TODO replace with something sensible
return new Rectangle(0, 0, 0, 0);
}
/**
* Ascender height is the distance from the character baseline to the
* top of the character box. A negative ascender height signifies that
* all of the graphic character is below the character baseline. For
* a character rotation other than 0, ascender height loses its
* meaning when the character is lying on its side or is upside down
* with respect to normal viewing orientation. For the general case,
* Ascender Height is the character's most positive y-axis value.
* For bounded character boxes, for a given character having an
* ascender, ascender height and baseline offset are equal.
* @param ascender the ascender to set
*/
public void setAscender(int ascender) {
this.ascender = ascender;
}
/**
* Cap height is the average height of the uppercase characters in
* a font. This value is specified by the designer of a font and is
* usually the height of the uppercase M.
* @param capHeight the cap height to set
*/
public void setCapHeight(int capHeight) {
this.capHeight = capHeight;
}
/**
* Descender depth is the distance from the character baseline to
* the bottom of a character box. A negative descender depth signifies
* that all of the graphic character is above the character baseline.
* @param descender the descender value in millipoints
*/
public void setDescender(int descender) {
this.descender = descender;
}
/**
* TODO
* @param underscoreWidth the underscore width value in millipoints
*/
public void setUnderscoreWidth(int underscoreWidth) {
this.underscoreWidth = underscoreWidth;
}
/**
* TODO
* @param underscorePosition the underscore position value in millipoints
*/
public void setUnderscorePosition(int underscorePosition) {
this.underscorePosition = underscorePosition;
}
/**
* Set the width (in 1/1000ths of a point size) of the character
* identified by the parameter passed.
* @param character the Unicode character for which the width is being set
* @param width the widths of the character
* @param characterBox the character box
*/
public void setCharacterMetrics(char character, int width, Rectangle characterBox) {
characterMetrics.put((int) character, new CharacterMetrics(width, characterBox));
}
/**
* XHeight refers to the height of the lower case letters above
* the baseline.
* @param xHeight the typical height of characters
*/
public void setXHeight(int xHeight) {
this.xHeight = xHeight;
}
/**
* Returns the space increment.
* @return the space increment
*/
public int getSpaceIncrement() {
return this.spaceIncrement;
}
/**
* Returns the em space increment.
* @return the em space increment
*/
public int getEmSpaceIncrement() {
return this.emSpaceIncrement;
}
/**
* Returns the nominal character increment.
* @return the nominal character increment
*/
public int getNominalCharIncrement() {
return this.nomCharIncrement;
}
private static class CharacterMetrics {
public final int width;
public final Rectangle characterBox;
public CharacterMetrics(int width, Rectangle characterBox) {
this.width = width;
this.characterBox = characterBox;
}
}
}
@@ -0,0 +1,57 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.afp.fonts;
import org.apache.fop.afp.fonts.CharactersetEncoder.DefaultEncoder;
import org.apache.fop.afp.fonts.CharactersetEncoder.EbcdicDoubleByteLineDataEncoder;
/**
* An enumeration of AFP characterset types.
*/
public enum CharacterSetType {
/** Double byte character sets; these do NOT have the shift-in;shift-out operators */
DOUBLE_BYTE {
@Override
CharactersetEncoder getEncoder(String encoding) {
return new DefaultEncoder(encoding, true);
}
},
/** Double byte character sets; these can have the shift-in;shift-out operators */
DOUBLE_BYTE_LINE_DATA {
@Override
CharactersetEncoder getEncoder(String encoding) {
return new EbcdicDoubleByteLineDataEncoder(encoding);
}
},
SINGLE_BYTE {
@Override
CharactersetEncoder getEncoder(String encoding) {
return new DefaultEncoder(encoding, false);
}
};
/**
* Returns the character-set encoder
*
* @param encoding
* @return
*/
abstract CharactersetEncoder getEncoder(String encoding);
}
@@ -0,0 +1,202 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.afp.fonts;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.charset.CharacterCodingException;
import java.nio.charset.Charset;
import java.nio.charset.CharsetEncoder;
import java.nio.charset.CodingErrorAction;
/**
* An abstraction that wraps the encoding mechanism for encoding a Unicode character sequence into a
* specified format.
*/
public abstract class CharactersetEncoder {
private final CharsetEncoder encoder;
private CharactersetEncoder(String encoding) {
this.encoder = Charset.forName(encoding).newEncoder();
this.encoder.onUnmappableCharacter(CodingErrorAction.REPLACE);
}
/**
* Tells whether or not this encoder can encode the given character.
*
* @param c the character
* @return true if, and only if, this encoder can encode the given character
* @throws IllegalStateException - If an encoding operation is already in progress
*/
final boolean canEncode(char c) {
return encoder.canEncode(c);
}
/**
* Encodes a character sequence to a byte array.
*
* @param chars the character sequence
* @return the encoded character sequence
* @throws CharacterCodingException if the encoding operation fails
*/
final EncodedChars encode(CharSequence chars) throws CharacterCodingException {
ByteBuffer bb;
// encode method is not thread safe
synchronized (encoder) {
bb = encoder.encode(CharBuffer.wrap(chars));
}
if (bb.hasArray()) {
return getEncodedChars(bb.array(), bb.limit());
} else {
bb.rewind();
byte[] bytes = new byte[bb.remaining()];
bb.get(bytes);
return getEncodedChars(bytes, bytes.length);
}
}
abstract EncodedChars getEncodedChars(byte[] byteArray, int length);
/**
* Encodes <code>chars</code> into a format specified by <code>encoding</code>.
*
* @param chars the character sequence
* @param encoding the encoding type
* @return encoded data
* @throws CharacterCodingException if encoding fails
*/
public static EncodedChars encodeSBCS(CharSequence chars, String encoding)
throws CharacterCodingException {
CharactersetEncoder encoder = CharacterSetType.SINGLE_BYTE.getEncoder(encoding);
return encoder.encode(chars);
}
/**
* The EBCDIC double byte encoder is used for encoding IBM format DBCS (double byte character
* sets) with an EBCDIC code-page. Given a double byte EBCDIC code page and a Unicode character
* sequence it will return its EBCDIC code-point, however, the "Shift In - Shift Out" operators
* are removed from the sequence of bytes. These are only used in Line Data.
*/
static final class EbcdicDoubleByteLineDataEncoder extends CharactersetEncoder {
EbcdicDoubleByteLineDataEncoder(String encoding) {
super(encoding);
}
@Override
EncodedChars getEncodedChars(byte[] byteArray, int length) {
if (byteArray[0] == 0x0E && byteArray[length - 1] == 0x0F) {
return new EncodedChars(byteArray, 1, length - 2, true);
}
return new EncodedChars(byteArray, true);
}
}
/**
* The default encoder is used for encoding IBM format SBCS (single byte character sets), this
* the primary format for most Latin character sets. This can also be used for Unicode double-
* byte character sets (DBCS).
*/
static final class DefaultEncoder extends CharactersetEncoder {
private final boolean isDBCS;
DefaultEncoder(String encoding, boolean isDBCS) {
super(encoding);
this.isDBCS = isDBCS;
}
@Override
EncodedChars getEncodedChars(byte[] byteArray, int length) {
return new EncodedChars(byteArray, isDBCS);
}
}
/**
* A container for encoded character bytes
*/
// CSOFF: FinalClass - disabling "final" modifier so that this class can be mocked
public static class EncodedChars {
private final byte[] bytes;
private final int offset;
private final int length;
private final boolean isDBCS;
private EncodedChars(byte[] bytes, int offset, int length, boolean isDBCS) {
if (offset < 0 || length < 0 || offset + length > bytes.length) {
throw new IllegalArgumentException();
}
this.bytes = bytes;
this.offset = offset;
this.length = length;
this.isDBCS = isDBCS;
}
private EncodedChars(byte[] bytes, boolean isDBCS) {
this(bytes, 0, bytes.length, isDBCS);
}
/**
* write <code>length</code> bytes from <code>offset</code> to the output stream
*
* @param out output to write the bytes to
* @param offset the offset where to write
* @param length the length to write
* @throws IOException if an I/O error occurs
*/
public void writeTo(OutputStream out, int offset, int length) throws IOException {
if (offset < 0 || length < 0 || offset + length > bytes.length) {
throw new IllegalArgumentException();
}
out.write(bytes, this.offset + offset, length);
}
/**
* The number of containing bytes.
*
* @return the length
*/
public int getLength() {
return length;
}
/**
* Indicates whether or not the EncodedChars object wraps double byte characters.
*
* @return true if the wrapped characters are double byte (DBCSs)
*/
public boolean isDBCS() {
return isDBCS;
}
/**
* The bytes
*
* @return the bytes
*/
public byte[] getBytes() {
// return copy just in case
byte[] copy = new byte[bytes.length];
System.arraycopy(bytes, 0, copy, 0, bytes.length);
return copy;
}
}
}
@@ -0,0 +1,145 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.afp.fonts;
import java.awt.Rectangle;
import java.lang.Character.UnicodeBlock;
import java.util.HashSet;
import java.util.Set;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.fop.afp.AFPEventProducer;
/**
* Implementation of {@link AbstractOutlineFont} that supports double-byte fonts (CID Keyed font (Type 0)).
* The width of characters that are not prescribed a width metrics in the font resource use
* a fallback width. The default width is 1 em. A character can be supplied and queried for the
* fallback width of all non-ideograph characters.
*/
public class DoubleByteFont extends AbstractOutlineFont {
private static final Log log = LogFactory.getLog(DoubleByteFont.class);
private final Set<Integer> charsProcessed;
//See also http://unicode.org/reports/tr11/ which we've not closely looked at, yet
//TODO the Unicode block listed here is probably not complete (ex. Hiragana, Katakana etc.)
private static final Set<UnicodeBlock> IDEOGRAPHIC = new HashSet<UnicodeBlock>();
static {
IDEOGRAPHIC.add(Character.UnicodeBlock.CJK_COMPATIBILITY_IDEOGRAPHS);
//IDEOGRAPHIC.add(Character.UnicodeBlock.CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT);//Java 1.5
IDEOGRAPHIC.add(Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS);
IDEOGRAPHIC.add(Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A);
//IDEOGRAPHIC.add(Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B); //Java 1.1
}
/**
* Constructor for an double-byte outline font.
* @param name the name of the font
* @param embeddable whether or not this font is embeddable
* @param charSet the character set
* @param eventProducer Handles any AFP related events
*/
public DoubleByteFont(String name, boolean embeddable, CharacterSet charSet,
AFPEventProducer eventProducer) {
super(name, embeddable, charSet, eventProducer);
charsProcessed = new HashSet<Integer>();
}
/** {@inheritDoc} */
public int getWidth(int character, int size) {
int charWidth;
try {
charWidth = charSet.getWidth(toUnicodeCodepoint(character), size);
} catch (IllegalArgumentException e) {
if (!charsProcessed.contains(character)) {
charsProcessed.add(character);
getAFPEventProducer().charactersetMissingMetrics(this, (char)character,
charSet.getName().trim());
}
// We shall try and handle characters that have no mapped width metric in font resource
charWidth = -1;
}
if (charWidth == -1) {
charWidth = getDefaultCharacterWidth(character) * size;
}
return charWidth;
}
private int getDefaultCharacterWidth(int character) {
int nominalCharIncrement = charSet.getNominalCharIncrement();
if (nominalCharIncrement > 0) {
return nominalCharIncrement;
} else {
return inferCharWidth(character);
}
}
@Override
public Rectangle getBoundingBox(int character, int size) {
Rectangle characterBox = getBoundingBoxOrNull(character, size);
if (characterBox == null) {
characterBox = getDefaultCharacterBox(character, size);
}
return characterBox;
}
private Rectangle getBoundingBoxOrNull(int character, int size) {
Rectangle characterBox = null;
try {
characterBox = charSet.getCharacterBox(toUnicodeCodepoint(character), size);
} catch (IllegalArgumentException e) {
if (!charsProcessed.contains(character)) {
charsProcessed.add(character);
getAFPEventProducer().charactersetMissingMetrics(this, (char) character,
charSet.getName().trim());
}
}
return characterBox;
}
private Rectangle getDefaultCharacterBox(int character, int size) {
return getBoundingBoxOrNull('-', size);
}
private int inferCharWidth(int character) {
//Is this character an ideograph?
boolean isIdeographic = false;
Character.UnicodeBlock charBlock = Character.UnicodeBlock.of((char)character);
if (charBlock == null) {
isIdeographic = false;
} else if (IDEOGRAPHIC.contains(charBlock)) {
isIdeographic = true;
} else { //default
isIdeographic = false;
}
if (isIdeographic) {
return charSet.getEmSpaceIncrement();
} else {
return charSet.getSpaceIncrement();
}
}
}
@@ -0,0 +1,47 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.afp.fonts;
/**
* A runtime exception for handling fatal errors in processing fonts.
*/
public class FontRuntimeException extends RuntimeException {
private static final long serialVersionUID = -2217420523816384707L;
/**
* Constructs a FontRuntimeException with the specified message.
* @param msg the exception mesaage
*/
public FontRuntimeException(String msg) {
super(msg);
}
/**
* Constructs a FontRuntimeException with the specified message
* wrapping the underlying exception.
* @param msg the exception mesaage
* @param t the underlying exception
*/
public FontRuntimeException(String msg, Throwable t) {
super(msg, t);
}
}

Some files were not shown because too many files have changed in this diff Show More