Thanks for weighing in on this. I've had a similar experience with FOP in
the past, and actually I've been talking with my employer about moving to
AH at some point. However, that's for a different project (DITA-OT) on a
longer term basis.

For the moment, I have to make this work with DocBook and FOP, as there's a
deadline.

I got a message back from Bob Stayton, and it seems there are some issues
with the current version of docbook-xsl trying to generate international
indexes. However, there's a newer snapshot on GitHub, and I'm trying to get
that to work now.

Since I'm unfamiliar with the details, I think it's best if I defer to Bob
on this, but I'll try to follow up with some notes when I can figure it out.

M.

On Mon, Jan 3, 2022 at 5:28 AM Kevin Dunn <kd...@hsc.edu> wrote:

> I'll put in a plug for AH Formatter. I love open-source tools, and use
> them when I can. But after fighting with FOP for a while, only to discover
> repeatedly that it didn't implement the
> features I needed, I downloaded the free trial versions of AH Formatter
> and RenderX XEP. Both were much more powerful and easier to configure than
> FOP. XEP is the less expensive of the two, but ultimately the AHF
> extensions won me over, and I bought it. If your time is at all valuable,
> you should spend a couple of days with the free trial versions to see what
> they can do for you.
>
> That said, I was able to get multiple indexes using the method on p 312 of
> DBTCG. It works in both AHF and FOP. I have not tried using different fonts
> in the different indexes.
>
> Kevin
> ------------------------------
> *From:* M. Downing Roberts <mgaq1...@g.ecc.u-tokyo.ac.jp>
> *Sent:* Sunday, January 2, 2022 7:33 AM
> *To:* docbook-apps@lists.oasis-open.org <docbook-apps@lists.oasis-open.org
> >
> *Subject:* Re: [docbook-apps] Multiple languages in PDF?
>
> Hi,
>
> Thanks for your suggestions. I know AH is better but alas, I am using FOP.
>
> Still stuck,
>
> M.
>
>
>
> On Sun, Jan 2, 2022 at 7:10 PM Tony Graham <tgra...@antenna.co.jp> wrote:
>
> On 02/01/2022 02:26, M. Downing Roberts wrote:
> ...
> > Another, simpler point I'm stuck on: I need to select a different font
> > for the Japanese index, i.e., I need to detect @type='ja' in the <index>
> > element and switch fonts.
>
> If you are using AH Formatter, you can map the generic font family names
> to specific fonts per script. [1]
>
> > I tried this in my customization layer:
> >
> >     <xsl:template match="indexentry">
> >        <xsl:choose>
> >         <xsl:when test="contains(' ja ', parent::type)">
>
> "contains(' ja ', parent::type)" is true only when the string ' ja '
> (including its space characters) contains the text content of the <type>
> parent element of the <indexentry>. [1]  There's several reasons why
> that won't happen.
>
> If you are generating <indexdiv> to group <indexterm>, then <indexterm>
> isn't the parent element anyway.
>
> One solution would be:
>
>     <xsl:when test="ancestor::index/@type = 'ja'">
>
> Another would be a separate template for Japanese <indexentry>, if you
> would find that clearer:
>
> <xsl:template match="indexentry[ancestor::index/@type = 'ja']">
>    <fo:wrapper font-family="'Zen Old Mincho'">
>      <xsl:apply-templates/>
>    </fo:wrapper>
> </xsl:template>
>
> (fo:wrapper [3] is mostly a way to add inherited properties without
> generating an extra area in the area tree.)
>
> If your template is in a module that imports (directly or indirectly)
> the usual template for <indexentry>, you can do: [4]
>
> <xsl:template match="indexentry[ancestor::index/@type = 'ja']">
>    <fo:wrapper font-family="'Zen Old Mincho'">
>      <xsl:apply-imports/>
>    </fo:wrapper>
> </xsl:template>
>
> Or you could set the font in your template for <index>:
>
> <xsl:template match="index[@type = 'ja']">
>    <fo:wrapper font-family="'Zen Old Mincho'">
>      <xsl:apply-imports/>
>    </fo:wrapper>
> </xsl:template>
>
>
> Regards,
>
>
> Tony Graham.
> --
> Senior Architect
> XML Division
> Antenna House, Inc.
> ----
> Skerries, Ireland
> tgra...@antenna.co.jp
>
> [1] https://www.antenna.co.jp/AHF/help/en/ahf-optset.html#script-font
> [2] https://www.w3.org/TR/1999/REC-xpath-19991116/#function-contains
> [3] https://www.w3.org/TR/xsl11/#fo_wrapper
> [4] https://www.w3.org/TR/1999/REC-xslt-19991116#apply-imports
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org
> For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org
>
>

Reply via email to