aboutsummaryrefslogtreecommitdiffstats
path: root/fop
diff options
context:
space:
mode:
authorSimon Steiner <ssteiner@apache.org>2018-03-19 08:49:57 +0000
committerSimon Steiner <ssteiner@apache.org>2018-03-19 08:49:57 +0000
commit88751079b006c5e7ce427485dc50bf8a6217c903 (patch)
treefe441fcd6c845aa90c5a0996b58be04581b49f5b /fop
parenta3a3995f8b6f271e57bcd87e2a03f45da2f04c16 (diff)
downloadxmlgraphics-fop-88751079b006c5e7ce427485dc50bf8a6217c903.tar.gz
xmlgraphics-fop-88751079b006c5e7ce427485dc50bf8a6217c903.zip
FOP-1969: Support for unicode Surrogate pairs
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1827168 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'fop')
-rw-r--r--fop/build.xml2
-rw-r--r--fop/test/layoutengine/hyphenation-testcases/block_hyphenation_kerning_non_bmp.xml57
-rw-r--r--fop/test/resources/fonts/ttf/Aegean600.LICENSE3
-rw-r--r--fop/test/resources/fonts/ttf/Aegean600.ttfbin0 -> 2077252 bytes
-rw-r--r--fop/test/resources/fonts/ttf/AndroidEmoji.LICENSE18
-rw-r--r--fop/test/resources/fonts/ttf/AndroidEmoji.ttfbin0 -> 448680 bytes
-rw-r--r--fop/test/xml/pdf-encoding/pdf-encoding-test.xconf9
-rw-r--r--fop/test/xml/pdf-encoding/test-custom-font.fo2
-rw-r--r--fop/test/xml/pdf-encoding/test-custom-non-bmp-font.fo37
9 files changed, 123 insertions, 5 deletions
diff --git a/fop/build.xml b/fop/build.xml
index 177dbbaf3..8acb727d9 100644
--- a/fop/build.xml
+++ b/fop/build.xml
@@ -638,7 +638,7 @@ list of possible build targets.
<include name="org/apache/fop/util/*OutputStream.class"/>
<include name="org/apache/fop/util/SubInputStream.class"/>
<include name="org/apache/fop/util/Finalizable.class"/>
- <include name="org/apache/fop/util/CharUtilities.class"/>
+ <include name="org/apache/fop/util/CharUtilities*.class"/>
<include name="org/apache/fop/util/DecimalFormatCache*.class"/>
<include name="org/apache/fop/util/ImageObject.class"/>
<include name="org/apache/fop/util/HexEncoder.class"/>
diff --git a/fop/test/layoutengine/hyphenation-testcases/block_hyphenation_kerning_non_bmp.xml b/fop/test/layoutengine/hyphenation-testcases/block_hyphenation_kerning_non_bmp.xml
new file mode 100644
index 000000000..d4734600a
--- /dev/null
+++ b/fop/test/layoutengine/hyphenation-testcases/block_hyphenation_kerning_non_bmp.xml
@@ -0,0 +1,57 @@
+<?xml version="1.1" encoding="utf-8"?>
+<!--
+ 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$ -->
+<testcase>
+ <info>
+ <p>
+ Checks hyphenation in combination with kerning.
+ </p>
+ </info>
+ <cfg>
+ <base14kerning>true</base14kerning>
+ </cfg>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" language="en" hyphenate="true" font-family="Aegean600">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="simple" page-height="5in" page-width="5in">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="simple">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block font-size="20pt" line-height="1.0" text-align="justify" text-align-last="justify" background-color="lightgray" start-indent="10pt" end-indent="10pt" border="solid 1pt">
+ hyphenation&#66310;&#66311;&#66315;&#66316; regression advantage foundation&#66311;&#66312;&#66313;&#66314; &#66315;&#66316; vandavanda
+ </fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <eval expected="1" xpath="count(//pageViewport)"/>
+ <eval expected="en" xpath="/areaTree/pageSequence/@xml:lang"/>
+
+ <eval expected="47702" xpath="//flow/block[1]/lineArea[1]/text[1]/@twsadjust"/>
+ <eval expected="36968" xpath="//flow/block[1]/lineArea[2]/text[1]/@twsadjust"/>
+
+ <eval expected="advan-" xpath="//flow/block[1]/lineArea[1]/text[1]/word[3]"/>
+ <eval expected="0 0 0 -500 0 0" xpath="//flow/block[1]/lineArea[1]/text[1]/word[3]/@letter-adjust"/>
+ <eval expected="tage" xpath="//flow/block[1]/lineArea[2]/text[1]/word[1]"/>
+ <eval expected="vandavanda" xpath="//flow/block[1]/lineArea[2]/text[1]/word[4]"/>
+ <eval expected="0 -500 0 0 0 -400 -500 0 0 0" xpath="//flow/block[1]/lineArea[2]/text[1]/word[4]/@letter-adjust"/>
+ </checks>
+</testcase>
diff --git a/fop/test/resources/fonts/ttf/Aegean600.LICENSE b/fop/test/resources/fonts/ttf/Aegean600.LICENSE
new file mode 100644
index 000000000..9c4c180c3
--- /dev/null
+++ b/fop/test/resources/fonts/ttf/Aegean600.LICENSE
@@ -0,0 +1,3 @@
+http://users.teilar.gr/~g1951d/
+
+In lieu of a licence; fonts and documents in this site are free for any use;
diff --git a/fop/test/resources/fonts/ttf/Aegean600.ttf b/fop/test/resources/fonts/ttf/Aegean600.ttf
new file mode 100644
index 000000000..6f3abb059
--- /dev/null
+++ b/fop/test/resources/fonts/ttf/Aegean600.ttf
Binary files differ
diff --git a/fop/test/resources/fonts/ttf/AndroidEmoji.LICENSE b/fop/test/resources/fonts/ttf/AndroidEmoji.LICENSE
new file mode 100644
index 000000000..0a010886a
--- /dev/null
+++ b/fop/test/resources/fonts/ttf/AndroidEmoji.LICENSE
@@ -0,0 +1,18 @@
+Copyright (C) 2008 The Android Open Source Project
+
+Licensed 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.
+
+##########
+
+This directory contains the fonts for the platform. They are licensed
+under the Apache 2 license.
diff --git a/fop/test/resources/fonts/ttf/AndroidEmoji.ttf b/fop/test/resources/fonts/ttf/AndroidEmoji.ttf
new file mode 100644
index 000000000..92bf047b8
--- /dev/null
+++ b/fop/test/resources/fonts/ttf/AndroidEmoji.ttf
Binary files differ
diff --git a/fop/test/xml/pdf-encoding/pdf-encoding-test.xconf b/fop/test/xml/pdf-encoding/pdf-encoding-test.xconf
index 27f96c950..ec087359b 100644
--- a/fop/test/xml/pdf-encoding/pdf-encoding-test.xconf
+++ b/fop/test/xml/pdf-encoding/pdf-encoding-test.xconf
@@ -29,19 +29,22 @@
<renderers>
<renderer mime="application/pdf">
<!-- disable PDF text compression -->
- <filterList>
+ <filterList>
<value>null</value>
</filterList>
<filterList type="image">
<value>flate</value>
<value>ascii-85</value>
</filterList>
-
+
<!-- use a custom font to show encoding problems -->
<fonts>
- <font metrics-url="test/resources/fonts/ttf/glb12.ttf.xml" embed-url="test/resources/fonts/ttf/glb12.ttf">
+ <font metrics-url="../../resources/fonts/ttf/glb12.ttf.xml" embed-url="../../resources/fonts/ttf/glb12.ttf">
<font-triplet name="Gladiator" style="normal" weight="normal"/>
</font>
+ <font embed-url="../../resources/fonts/ttf/Aegean600.ttf" >
+ <font-triplet name="Aegean600" style="normal" weight="normal"/>
+ </font>
</fonts>
</renderer>
</renderers>
diff --git a/fop/test/xml/pdf-encoding/test-custom-font.fo b/fop/test/xml/pdf-encoding/test-custom-font.fo
index 86689f343..ee4c0406a 100644
--- a/fop/test/xml/pdf-encoding/test-custom-font.fo
+++ b/fop/test/xml/pdf-encoding/test-custom-font.fo
@@ -21,7 +21,7 @@
Minimal FO document used to test PDF encoding
-->
-<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" font-family="Gladiator">
+<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" font-family="Gladiator" font-size="10px">
<fo:layout-master-set>
<fo:simple-page-master master-name="A4" page-height="29.7cm" page-width="21cm" margin="2cm">
<fo:region-body/>
diff --git a/fop/test/xml/pdf-encoding/test-custom-non-bmp-font.fo b/fop/test/xml/pdf-encoding/test-custom-non-bmp-font.fo
new file mode 100644
index 000000000..2793d737c
--- /dev/null
+++ b/fop/test/xml/pdf-encoding/test-custom-non-bmp-font.fo
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ 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.
+-->
+
+<!--
+ Minimal FO document used to test PDF encoding
+-->
+
+<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" font-family="Helvetica, Aegean600">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="A4" page-height="29.7cm" page-width="21cm" margin="2cm">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="A4">
+ <fo:flow flow-name="xsl-region-body">
+ <!--<fo:block>Testing PDF text encoding using the user-specified AndroidEmoji font which cover non BMP codepoints</fo:block>-->
+ <fo:block>PDFE_TEST_MARK_1: Hello AndroidEmoji World!</fo:block>
+ <fo:block>PDFE_TEST_MARK_2: This is a OLD ITALIC LETTER A: XX_ &#x10300; _XX</fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+</fo:root>