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?


here is a n example of how I generate English/Chinese/Pinyin in a docbook text: works perfectly

<foreignphrase xml:lang="cmn-Latn-pinyin">WÇ kÇolÇ kÇolÇ.</foreignphrase>
<entry><foreignphrase xml:lang="cmn-Hani"

<entry>I'll think it over. (non-committal)</entry>
<entry><foreignphrase xml:lang="cmn-Latn-pinyin" >FÄichÃng hÇo.</foreignphrase></entry>

I use a customization part in :  xls/fo/docbook_custom.xsl

It can be another name or location (I use oXygen editor), but the principle is here


    <xsl:template match="d:foreignphrase[@xml:lang='cmn-Hani']">
        <!--<fo:inline font-family="UKIJ CJK"> -->
        <fo:inline font-family="NotoSansCJKjp-Light">
<!--<fo:inline font-family="AR PL KaitiM GB"> jolie fonte mais moins lisible--> <!--<xsl:attribute name="background-color">#FFFFFF</xsl:attribute> -->
            <xsl:attribute name="color">#FF0000</xsl:attribute>
            <xsl:attribute name="font-size">1.3em</xsl:attribute>
            <xsl:call-template name="inline.charseq"/>

    <xsl:template match="d:foreignphrase[@xml:lang='cmn-Latn-pinyin']">
            <xsl:attribute name="color">#0000FF</xsl:attribute>
<!--<xsl:attribute name="background-color">#FFFF00</xsl:attribute>-->
            <xsl:call-template name="inline.charseq"/>



link to the document I'm editing at the moment (not finished, there are 1400 pages min) :


Best regards


Le 22/12/2021 Ã 04:01, M. Downing Roberts 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"/>

    <xsl:template match="subtitle" mode="titlepage.mode">
     Â <fo:block font-family="Hiragino Mincho ProN">
     Â Â <xsl:apply-templates mode="titlepage.mode"/>
     Â </fo:block>

...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]