OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]

Subject: Re: [docbook-apps] Multiple languages in PDF?


Thanks very much for your suggestions. Using <foreignphrase> and the customization you suggested, the font is substituted. However, although I specify Times or Arial, it tries Times-Roman or ArialMT, neither of which include Japanese characters.

Is there some way I can find out the names of the fonts that FOP believes I have installed? It seems like there's some mismatch between what is shown in apps vs. what FOP thinks is actually available.

Next, I was unable to get the <subtitle> element to substitute the font. Here's the customization that I'm trying:

<xsl:template match="subtitle" mode="section.titlepage.recto.auto.mode">
 Â<xsl:when test="contains(' ja ', @xml:lang)">
   <fo:block xsl:use-attribute-sets="section.titlepage.recto.style" font-family="Times" font-weight="bold">
    <xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
   <fo:block xsl:use-attribute-sets="section.titlepage.recto.style" font-family="{$title.fontset}">
    <xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>

I must be doing something wrong, but I'm not sure what.



On Wed, Dec 22, 2021 at 3:35 PM Alemps Florimond <ntuflorimond@yahoo.com> wrote:

I would address this like that :
<para>The HÅjÅki [<foreignphrase xml:lang="ja">æäè</foreignphrase>] is an important and popular short work of the early Kamakura period.</para>

Customise font here :
<xsl:template match="d:foreignphrase">
ÂÂ <xsl:when test="contains(' ja ', @xml:lang)">
ÂÂÂÂÂ <fo:inline font-family="Hiragino Mincho ProN">
ÂÂÂÂÂÂÂ <xsl:apply-templates/>
ÂÂÂÂÂ </fo:inline>
ÂÂ </xsl:when>
ÂÂÂ <xsl:otherwise>
ÂÂÂÂÂ <xsl:call-template name="inline.italicseq"/>
ÂÂÂ </xsl:otherwise>

"contains" is useful if you can use the same font for different languages ... :
ÂÂ <xsl:when test="contains(' ja ko zh ', @xml:lang)">
ÂÂÂÂÂ <fo:inline font-family= Hiragino Mincho ProN">
ÂÂÂÂÂÂÂ <xsl:apply-templates/>
ÂÂÂÂÂ </fo:inline>
ÂÂ </xsl:when>

For titles, I would condition attribute font-family in the appropriate xsl:attribute-sets="section.titlepage.recto.style based on xml:lang as done above.

To make sure it is not a problem with the font itself :
1. replace "Hiragino Mincho ProN" with Arial or Times or even
2. set attribute font-weight="bold"

Hope this help

Le mercredi 22 dÃcembre 2021, 04:01:33 UTC+1, M. Downing Roberts <mgaq1186@g.ecc.u-tokyo.ac.jp> a Ãcrit :

I'm back with another question.

I'd like to combineÂEnglish and Japanese text in a single book. I can set the @lang attribute on various elements, but the problem is that I need to switch fonts, too. The font that I want to use for body text doesn't include Japanese characters. I'm not sure how to embed Japanese text within a <para> of English and get it to render properly. E.g.:

> <para>The HÅjÅki [æäè] is an important and popular short work of the early Kamakura period.</para>

It seems like I need something akin to <span lang="ja"> to mark the Japanese text, and then a customization in the stylesheet to detect this and specify a suitable font. However, I'm not sure how I should handle either ofÂthese issues.

I would also like to specify a different font for the <subtitle> element. I've tried this customization:

> <xsl:template match="subtitle" mode="section.titlepage.recto.auto.mode">
> <fo:block xsl:use-attribute-sets="section.titlepage.recto.style" font-family="Hiragino Mincho ProN">
> <xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
> </fo:block>
> </xsl:template>
> <xsl:template match="subtitle" mode="titlepage.mode">
> Â <fo:block font-family="Hiragino Mincho ProN">
> Â Â <xsl:apply-templates mode="titlepage.mode"/>
> Â </fo:block>
> </xsl:template>

...but it seems to have no effect. The font is not found, though it is installed on my machine.

What am I doing wrong? What's the best way to approach this?



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]