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: problems in character displaying for simpl.Chinese


Hi,

 

we provide our documentation in several languages. So far I’ve managed almost everything to display correctly for the Chinese, Japanese and Kyrillic output (for PDF and CHM), which includes using special fonts and the proper encoding.

 

But for the FO-output, there are still some issues with our style-sheet customizations. That puts me at the moment a little bit at a loss.

 

In procedures, the following occurs:

Procedure_SingleStep.jpg

According our company styles,  we need to customize single step procedures to display in-line.

That’s the code:

                <xsl:template match="procedure">

                                <xsl:variable name="id">

                                                <xsl:call-template name="object.id"/>

                                </xsl:variable>

 

                                <!--===========modification to allow single-step procedures to appear on the same line=========== ============-->                    

                               

                                <xsl:choose>

                                <xsl:when test="count(step) = 1">

                                <fo:block margin-top="10pt">

                                                <fo:table width="100%">

                                                <fo:table-column column-width="16pt"/>

                                                <fo:table-column/>

                                                <fo:table-body start-indent="0pt">

                                                                <fo:table-row>

                                                                                <fo:table-cell>

                                                                                                <fo:block text-align="left"><fo:block-container reference-orientation="90" position="absolute" top="10pt" >

                                                                                                <fo:block font-family="ZapfDingbats">&#x25BC;</fo:block>

                                                                                                </fo:block-container></fo:block>

                                                                                </fo:table-cell>

                                                                                <fo:table-cell>

                                                                                                <fo:block>

                                                                                                                <fo:wrapper text-align="left" xsl:use-attribute-sets="informal.title.properties">

                                                                                                                                <xsl:apply-templates select="title/node()"/><xsl:text>, </xsl:text>

                                                                                                                                </fo:wrapper>

                                                                                                                                <xsl:apply-templates select="step/*[1][self::para]/node()"/>

                                                                                                                                <xsl:apply-templates select="step/*[1][not(self::para)]"/>

                                                                                                                                <xsl:apply-templates select="step/*[position() != 1]"/>

                                                                                                </fo:block>

                                                                                </fo:table-cell>

                                                                </fo:table-row>

                                                </fo:table-body>

                                                </fo:table>

                                </fo:block>

                                </xsl:when>

                                <xsl:otherwise>

                               

                               

                                <xsl:variable name="param.placement"

                                                                select="substring-after(normalize-space($formal.title.placement),

                                                concat(local-name(.), ' '))"/>

 

                                <xsl:variable name="placement">

                                                <xsl:choose>

                                                                <xsl:when test="contains($param.placement, ' ')">

                                                                                <xsl:value-of select="substring-before($param.placement, ' ')"/>

                                                                </xsl:when>

                                                                <xsl:when test="$param.placement = ''">before</xsl:when>

                                                                <xsl:otherwise>

                                                                                <xsl:value-of select="$param.placement"/>

                                                                </xsl:otherwise>

                                                </xsl:choose>

                                </xsl:variable>

 

                                <!-- Preserve order of PIs and comments -->

                                <xsl:variable name="preamble"

                                                                select="*[not(self::step

                                                or self::title

                                                or self::titleabbrev)]

                                                |comment()[not(preceding-sibling::step)]

                                                |processing-instruction()[not(preceding-sibling::step)]"/>

 

                                <xsl:variable name="steps"

                                                                select="step

                                                |comment()[preceding-sibling::step]

                                                |processing-instruction()[preceding-sibling::step]"/>

 

                                <fo:block id="{$id}" xsl:use-attribute-sets="list.block.spacing">

                                                <xsl:if test="./title and $placement = 'before'">

                                                                <!-- n.b. gentext code tests for $formal.procedures and may make an "informal" -->

                                                                <!-- heading even though we called formal.object.heading. odd but true. -->

                                                                <xsl:call-template name="symboled.procedure.title"/>

                                                </xsl:if>

 

                                                <xsl:apply-templates select="$preamble"/>

 

                                                <fo:list-block xsl:use-attribute-sets="list.block.spacing"

                                                                                provisional-distance-between-starts="2em"

                                                                                provisional-label-separation="0.2em"

                                                                                margin-left="8mm">

                                                                <xsl:apply-templates select="$steps"/>

                                                </fo:list-block>

 

                                                <xsl:if test="./title and $placement != 'before'">

                                                                <!-- n.b. gentext code tests for $formal.procedures and may make an "informal" -->

                                                                <!-- heading even though we called formal.object.heading. odd but true. -->

                                                                <xsl:call-template name="symboled.procedure.title"/>

                                                </xsl:if>

                                </fo:block>

                                </xsl:otherwise>

                                </xsl:choose>

                </xsl:template>

 

That’s the code for the localization:

 

                <xsl:variable name="font-sansserif">

                                <xsl:choose>

                                                <xsl:when test="book/@lang = 'en'">Arial</xsl:when>

                                                <xsl:when test="book/@lang = 'ru'">Arial</xsl:when>

                                                <xsl:when test="book/@lang = 'ja'">MS Mincho</xsl:when>

                                                <xsl:when test="book/@lang = 'zh-CN'">SimSun</xsl:when>

                                                <xsl:otherwise>Arial</xsl:otherwise>

                                </xsl:choose>

                </xsl:variable>

 

That’s the code for the ‘informal.title.properties’:

 

                <xsl:attribute-set name="informal.title.properties" use-attribute-sets="normal.para.spacing">

                                <xsl:attribute name="font-weight">bold</xsl:attribute>

                                <xsl:attribute name="font-size">10pt</xsl:attribute>

                                <xsl:attribute name="font-family"><xsl:value-of select="$font-sansserif"/></xsl:attribute>

                </xsl:attribute-set>

 

For all other instances, where we use the ‘attribute.sets’ with the value of the variable, all works fine. But it seems that for the fo:table or the fo:wrapper it doesn’t work: the characters are just ignored.

 

 

In the glossary, the following occurs:

Glossary_Emphasis.jpg

 

That occurs whenever ‘emphasis’ role=italic is used in the glossary.

 

That’s the code for the ‘emphasis’ role=italic: (which works fine whenever it is used all over the document)

 

                <xsl:template match="emphasis[@role='italic']">

 

                                <xsl:choose>

                                                <xsl:when test="ancestor::book/@lang = 'ja'">

                                                  <fo:inline>

                                                                <xsl:apply-templates/>

                                                  </fo:inline>

                                                </xsl:when>

                                                <xsl:when test="ancestor::book/@lang = 'zh-CN'">

                                                  <fo:inline>

                                                                <xsl:apply-templates/>

                                                  </fo:inline>

                                                </xsl:when>

                                                <xsl:otherwise>     

                                                                <xsl:call-template name="inline.italicseq"/>

                                                </xsl:otherwise>

                                </xsl:choose>

                </xsl:template>

 

It seems that the glossary just ignores ‘ancestor::book’…do I have to add a ‘lang’ attribute to the glossary too?

 

It would be great if you have any idea, how I can solve the problems.

 

Cheers,

Isabel

 

Isabel Hofherr
Tech Comm Spc.
Kofax Development GmbH

Wentzinger Strasse 19
79106 Freiburg
Germany

Tel: +49 (0) 761 45269 57214
Fax: +49 (0) 761 45269 58714
Isabel.Hofherr@kofax.com



This communication is only for the use of the intended recipient. It may contain confidential or proprietary information. If you are not the intended recipient or have received this communication in error, please notify the sender via phone and destroy this communication immediately.

Kofax Deutschland AG
Sitz der Gesellschaft: Freiburg i.Brg.
Amtsgericht Freiburg: HRB 5319
Vorstand: Jörg Grundmann (Vorsitzender), Gabriele Froning
Aufsichtsratsvorsitzender: Stefan Gaiser




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