[
https://issues.apache.org/jira/browse/FOP-2092?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Glenn Adams updated FOP-2092:
-----------------------------
Assignee: Glenn Adams (was: fop-dev)
> Fop invalid position combining mark for Thai text (CTL)
> -------------------------------------------------------
>
> Key: FOP-2092
> URL: https://issues.apache.org/jira/browse/FOP-2092
> Project: Fop
> Issue Type: Bug
> Components: fonts
> Affects Versions: all
> Environment: Operating System: All
> Platform: PC
> Reporter: Nattapong Sirilappanich
> Assignee: Glenn Adams
> Attachments: data.xslt, fop.log, fopThai5.pdf, test.fo.xml, test.pdf,
> thaidata.xml, thai.fo, Untitled.jpg
>
>
> 1. In order to make Thai glyph substitution work, the language tag must be
> "dflt" instead of "th". This is because many popular Thai font use "dflt".
> 2. Using "dflt" language, both GSUB and GPOS are used. The problem is after
> it used, all glyph are placed further to the right.
> Notes:
> 1. Many Thai combining glyph have negative alignment. I suspect this is
> involved in miss alignment calculation.
> 2. The ratio of displacement seem irrational. If it shifted to the left by
> the same ratio, it is still invalid.
> Question:
> Should "dflt" being load by default ?
> XML Data for testing:
> <?xml version="1.0" encoding="UTF-8"?>
> <data>กุญญูฐฐูฏฏูฎฎูบบ่บี่ปป่ปี่กำปำถํ้า</data>
> XSLT for testing:
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xsl:template match="/">
> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
> <fo:layout-master-set>
> <fo:simple-page-master master-name="A4">
> <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 script="thai" language="dflt"
> font-size="32pt" font-family="AngsanaUPC">
> <xsl:value-of select="data" />
> </fo:block>
> </fo:flow>
> </fo:page-sequence>
> </fo:root>
> </xsl:template>
> </xsl:stylesheet>
> The fop.xconf has added font into fonts section of applicaton/pdf renderer:
> <font embed-url="file:///c:/windows/fonts/angsau.ttf" kerning="yes">
> <font-triplet name="AngsanaUPC" style="normal" weight="normal"/>
> </font>
> The Java code used to reproduce:
> FopFactory fopFac = FopFactory.newInstance(new File("fop.xconf"));
> OutputStream outputStream = new BufferedOutputStream(new
> FileOutputStream("c:\\temp\\fopThai.pdf"));
>
> Fop fop = fopFac.newFop(MimeConstants.MIME_PDF, outputStream);
>
> TransformerFactory transFac = TransformerFactory.newInstance();
> Source xslData = new StreamSource(new File("data.xslt"));
> Transformer trans = transFac.newTransformer(xslData);
> Result res = new SAXResult(fop.getDefaultHandler());
> Source xmlData = new StreamSource(new File("thaidata.xml"));
> trans.transform(xmlData, res);
>
> outputStream.close();
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira