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] How to change the font?


On 11/9/06, Darya Said-Akbari <darya_akbari@yahoo.com> wrote:
> is there a way I can change the font in my DocBook
> XML. Sometimes I want use Unicode characters but the
> font does not cover these characters.
>
> In such cases I want to select the right font which
> handles these Unicode characters.

Hi,

We've run into this problem quite a bit. In our case, we use
Microsoft's Arial, which offers fairly large coverage of Unicode. The
markup we use is the <phrase> tag with a @role="unicode", which is
nice and semanitcally meaningless:

 <para>Regular text here <phrase role="unicode"> 松本 行弘</phrase>  more
normal stuff</para>

I match this like so:
 <xsl:template match="phrase">
    <xsl:variable name="depth">
      <xsl:call-template name="dot.count">
        <xsl:with-param name="string">
          <xsl:number level="multiple"/>
        </xsl:with-param>
      </xsl:call-template>
    </xsl:variable>
   <xsl:choose>
    <xsl:when test="@role[contains(., 'unicode')]">
        <fo:inline font-family="Arial Unicode MS"> <!-- whatever font
you like -->
          <xsl:call-template name="inline.charseq"/>
        </fo:inline>
      </xsl:when>
      <xsl:otherwise>
        <xsl:choose>
          <xsl:when test="$depth mod 2 = 1">
            <fo:inline font-style="normal">
              <xsl:apply-templates/>
            </fo:inline>
          </xsl:when>
          <xsl:otherwise>
            <xsl:call-template name="inline.italicseq"/>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>
 </xsl:template>


HTH,
Keith


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