docbook-apps

  • 1.  Entity -> fo -> pdf with a Unicode font..

    Posted 09-26-2006 20:29
    Hi,

    I have a document using two types of arrows.
    Unicode characters :
    0x2192 -> 0x21db => (three lines)
    The respective entities are
    → and ⇛

    I am using the FreeSerif font that have these two characters.
    I have checked with Fontforge.
    I have picked FreeSerif as the font to be used in the xsl

    <xsl:param name="body.font.family">FreeSerif</xsl:param>
    <xsl:param name="title.font.family">FreeSerif</xsl:param>
    <xsl:param name="symbol.font.family">FreeSerif</xsl:param>

    The fo gets the following output when using saxon 8.7.3J :
    <E2><86><92> Text <E2><87><9B>
    (output from vi)
    The fo is noted with
    and for example ü works in the pdf when
    it is in fo denoted <C3><BC> that works also in pdf.

    But the arrows are displayed as hashes (#) in pdf.

    I use fop 0.92beta and including the font with a new configuration file which
    has FreeSerif included
    embed-url="/usr/share/fonts/truetype/freefont/FreeSerif.ttf">

    fop.xconf in the fop distribution was used as a starting point.
    (yes I generated the xml file myself with fop)

    Have had a look at
    http://www.sagehill.net/docbookxsl/SpecialChars.html
    but no tricks seems to get it to work.

    Do anyone have any hints ?

    I do hate fighting with the docbook tool chain ...
    well I am using the free one so I guess I have to blame myself :)

    /Fred



  • 2.  Re: [docbook-apps] Entity -> fo -> pdf with a Unicode font..

    Posted 09-26-2006 20:57
    Great, send a mail and then you find the solution.

    The font xml file generated with org.apache.fop.fonts.apps.TTFReader
    was run with -enc ansi. That "Limited to WinAnsi character set, which is
    roughly equivalent to iso-8889-1." Without this option eg. CID-keyed
    the font work and the arrows appears!

    The penalty seems to be "Search, index, and cut-and-paste operations in the
    output document will produce incorrect results." but I hope it will not be too
    bad.

    Oops copy-paste generates characters like \U00100028 etc...

    Are there any other way ?
    The comment was "(FOP currently doesn't emit the /ToUnicode table which is
    necessary for copy/paste to work.)"

    The bug being
    http://issues.apache.org/bugzilla/show_bug.cgi?id=40467
    according to
    http://issues.apache.org/bugzilla/show_bug.cgi?id=5335
    there might be a solution in trunk

    Back to bleeding edge software testing.

    /Fred

    Fredrik Svensson wrote:
    > Hi,
    >
    > I have a document using two types of arrows.
    > Unicode characters :
    > 0x2192 -> 0x21db => (three lines)
    > The respective entities are
    > → and ⇛
    >
    > I am using the FreeSerif font that have these two characters.
    > I have checked with Fontforge.
    > I have picked FreeSerif as the font to be used in the xsl
    >
    > <xsl:param name="body.font.family">FreeSerif</xsl:param>
    > <xsl:param name="title.font.family">FreeSerif</xsl:param>
    > <xsl:param name="symbol.font.family">FreeSerif</xsl:param>
    >
    > The fo gets the following output when using saxon 8.7.3J :
    > <E2><86><92> Text <E2><87><9B>
    > (output from vi)
    > The fo is noted with
    > and for example ü works in the pdf when
    > it is in fo denoted <C3><BC> that works also in pdf.
    >
    > But the arrows are displayed as hashes (#) in pdf.
    >
    > I use fop 0.92beta and including the font with a new configuration file which
    > has FreeSerif included
    > > embed-url="/usr/share/fonts/truetype/freefont/FreeSerif.ttf">
    >

    > fop.xconf in the fop distribution was used as a starting point.
    > (yes I generated the xml file myself with fop)
    >
    > Have had a look at
    > http://www.sagehill.net/docbookxsl/SpecialChars.html
    > but no tricks seems to get it to work.
    >
    > Do anyone have any hints ?
    >
    > I do hate fighting with the docbook tool chain ...
    > well I am using the free one so I guess I have to blame myself :)
    >
    > /Fred
    >
    > ---------------------------------------------------------------------
    > To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
    > For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org
    >



  • 3.  Re: [docbook-apps] Entity -> fo -> pdf with a Unicode font..

    Posted 09-26-2006 21:11
    Well, even though you found your own solution, at least now I know
    where to look when I want to change the fonts.

    Also, you now have a limited form of copy protection for your documents ;-]

    On 9/26/06, Fredrik Svensson <fred@ludd.ltu.se> wrote:
    > Great, send a mail and then you find the solution.
    >
    > The font xml file generated with org.apache.fop.fonts.apps.TTFReader
    > was run with -enc ansi. That "Limited to WinAnsi character set, which is
    > roughly equivalent to iso-8889-1." Without this option eg. CID-keyed
    > the font work and the arrows appears!
    >
    > The penalty seems to be "Search, index, and cut-and-paste operations in the
    > output document will produce incorrect results." but I hope it will not be too
    > bad.
    >
    > Oops copy-paste generates characters like \U00100028 etc...
    >
    > Are there any other way ?
    > The comment was "(FOP currently doesn't emit the /ToUnicode table which is
    > necessary for copy/paste to work.)"
    >
    > The bug being
    > http://issues.apache.org/bugzilla/show_bug.cgi?id=40467
    > according to
    > http://issues.apache.org/bugzilla/show_bug.cgi?id=5335
    > there might be a solution in trunk
    >
    > Back to bleeding edge software testing.
    >
    > /Fred
    >
    > Fredrik Svensson wrote:
    > > Hi,
    > >
    > > I have a document using two types of arrows.
    > > Unicode characters :
    > > 0x2192 -> 0x21db => (three lines)
    > > The respective entities are
    > > → and ⇛
    > >
    > > I am using the FreeSerif font that have these two characters.
    > > I have checked with Fontforge.
    > > I have picked FreeSerif as the font to be used in the xsl
    > >
    > > <xsl:param name="body.font.family">FreeSerif</xsl:param>
    > > <xsl:param name="title.font.family">FreeSerif</xsl:param>
    > > <xsl:param name="symbol.font.family">FreeSerif</xsl:param>
    > >
    > > The fo gets the following output when using saxon 8.7.3J :
    > > <E2><86><92> Text <E2><87><9B>
    > > (output from vi)
    > > The fo is noted with
    > > and for example ü works in the pdf when
    > > it is in fo denoted <C3><BC> that works also in pdf.
    > >
    > > But the arrows are displayed as hashes (#) in pdf.
    > >
    > > I use fop 0.92beta and including the font with a new configuration file which
    > > has FreeSerif included
    > > > > embed-url="/usr/share/fonts/truetype/freefont/FreeSerif.ttf">
    > >

    > > fop.xconf in the fop distribution was used as a starting point.
    > > (yes I generated the xml file myself with fop)
    > >
    > > Have had a look at
    > > http://www.sagehill.net/docbookxsl/SpecialChars.html
    > > but no tricks seems to get it to work.
    > >
    > > Do anyone have any hints ?
    > >
    > > I do hate fighting with the docbook tool chain ...
    > > well I am using the free one so I guess I have to blame myself :)
    > >
    > > /Fred
    > >
    > > ---------------------------------------------------------------------
    > > To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
    > > For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org
    > >
    >
    > ---------------------------------------------------------------------
    > To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
    > For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org
    >
    >


    --
    http://chris.chiasson.name/



  • 4.  Re: [docbook-apps] Entity -> fo -> pdf with a Unicode font..

    Posted 09-26-2006 21:41
    No problem, I have also managed to remove the special "DRM copy protection".

    Under debian sid :

    apt-get install ant sun-java5-jdk sun-java5-demo
    update-java-alternatives --set java-1.5.0-sun
    svn co http://svn.apache.org/repos/asf/xmlgraphics/fop/trunk fop
    http://issues.apache.org/bugzilla/attachment.cgi?id=17203
    mv 'attachment.cgi?id=17203' cid.patch
    cd fop/src
    patch -p0 < ../../cid.patch

    (fix the two failures in java/org/apache/fop/pdf/PDFCMap.java.rej and
    java/org/apache/fop/pdf/PDFFactory.java.rej - the patch is a bit old
    the other failures are only comments)

    ant package
    ./fop -v
    FOP Version svn-trunk
    ...
    ...

    ./fop test.fo test.pdf

    And it works!

    Easy as 1,2, 579,35 and a half..

    pasting yields now "\u2192 Text \u21db"

    /Fredrik

    Chris Chiasson wrote:
    > Well, even though you found your own solution, at least now I know
    > where to look when I want to change the fonts.
    >
    > Also, you now have a limited form of copy protection for your documents ;-]
    >
    > On 9/26/06, Fredrik Svensson <fred@ludd.ltu.se> wrote:
    >> Great, send a mail and then you find the solution.
    >>
    >> The font xml file generated with org.apache.fop.fonts.apps.TTFReader
    >> was run with -enc ansi. That "Limited to WinAnsi character set, which is
    >> roughly equivalent to iso-8889-1." Without this option eg. CID-keyed
    >> the font work and the arrows appears!
    >>
    >> The penalty seems to be "Search, index, and cut-and-paste operations
    >> in the
    >> output document will produce incorrect results." but I hope it will
    >> not be too
    >> bad.
    >>
    >> Oops copy-paste generates characters like \U00100028 etc...
    >>
    >> Are there any other way ?
    >> The comment was "(FOP currently doesn't emit the /ToUnicode table
    >> which is
    >> necessary for copy/paste to work.)"
    >>
    >> The bug being
    >> http://issues.apache.org/bugzilla/show_bug.cgi?id=40467
    >> according to
    >> http://issues.apache.org/bugzilla/show_bug.cgi?id=5335
    >> there might be a solution in trunk
    >>
    >> Back to bleeding edge software testing.
    >>
    >> /Fred
    >>
    >> Fredrik Svensson wrote:
    >> > Hi,
    >> >
    >> > I have a document using two types of arrows.
    >> > Unicode characters :
    >> > 0x2192 -> 0x21db => (three lines)
    >> > The respective entities are
    >> > → and ⇛
    >> >
    >> > I am using the FreeSerif font that have these two characters.
    >> > I have checked with Fontforge.
    >> > I have picked FreeSerif as the font to be used in the xsl
    >> >
    >> > <xsl:param name="body.font.family">FreeSerif</xsl:param>
    >> > <xsl:param name="title.font.family">FreeSerif</xsl:param>
    >> > <xsl:param name="symbol.font.family">FreeSerif</xsl:param>
    >> >
    >> > The fo gets the following output when using saxon 8.7.3J :
    >> > <E2><86><92> Text <E2><87><9B>
    >> > (output from vi)
    >> > The fo is noted with
    >> > and for example ü works in
    >> the pdf when
    >> > it is in fo denoted <C3><BC> that works also in pdf.
    >> >
    >> > But the arrows are displayed as hashes (#) in pdf.
    >> >
    >> > I use fop 0.92beta and including the font with a new configuration
    >> file which
    >> > has FreeSerif included
    >> > >> > embed-url="/usr/share/fonts/truetype/freefont/FreeSerif.ttf">
    >> >

    >> > fop.xconf in the fop distribution was used as a starting point.
    >> > (yes I generated the xml file myself with fop)
    >> >
    >> > Have had a look at
    >> > http://www.sagehill.net/docbookxsl/SpecialChars.html
    >> > but no tricks seems to get it to work.
    >> >
    >> > Do anyone have any hints ?
    >> >
    >> > I do hate fighting with the docbook tool chain ...
    >> > well I am using the free one so I guess I have to blame myself :)
    >> >
    >> > /Fred
    >> >
    >> > ---------------------------------------------------------------------
    >> > To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
    >> > For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org
    >> >
    >>
    >> ---------------------------------------------------------------------
    >> To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
    >> For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org
    >>
    >>
    >
    >



  • 5.  Re: [docbook-apps] Entity -> fo -> pdf with a Unicode font..

    Posted 09-26-2006 22:15
    Fredrik Svensson wrote:

    > The penalty seems to be "Search, index, and cut-and-paste operations in the
    > output document will produce incorrect results." but I hope it will not be too
    > bad.
    >
    > Oops copy-paste generates characters like \U00100028 etc...
    >
    > Are there any other way ?

    Commercial renderers like XEP and XSL Formatter generate PDFs with
    correct glyph -> character mapping tables.

    > The comment was "(FOP currently doesn't emit the /ToUnicode table which is
    > necessary for copy/paste to work.)"

    You can grab patches from

    http://issues.apache.org/bugzilla/show_bug.cgi?id=5335

    and recompile FOP yourself.

    --
    ------------------------------------------------------------------
    Jirka Kosek e-mail: jirka@kosek.cz http://www.kosek.cz
    ------------------------------------------------------------------
    Profesionální školení a poradenství v oblasti technologií XML.
    Podívejte se na náš nove spuštený web http://DocBook.cz
    Podrobný prehled školení http://xmlguru.cz/skoleni/
    ------------------------------------------------------------------
    Nejbližší termíny školení:
    ** XSLT 23.-26.10.2006 ** XML schémata 13.-15.11.2006 **
    ** DocBook 11.-13.12.2006 ** XSL-FO 11.-12.12.2006 **
    ------------------------------------------------------------------
    http://xmlguru.cz Blog mostly about XML for English readers
    ------------------------------------------------------------------