xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas L Delmelle <a_l.delme...@pandora.be>
Subject Re: Bullet points in japanese
Date Wed, 16 Jan 2008 19:51:41 GMT
	From: 	  a_l.delmelle@pandora.be
	Subject: 	Re: Bullet points in japanese
	Date: 	January 16, 2008 20:19:25 GMT+01:00
	To: 	  akobayashi@valista.com

Just noticed that I originally replied to Akagi off-list, but I think  
the info might be useful to other users as well, so...

On Jan 16, 2008, at 11:23, Akagi Kobayashi wrote:

Hi Akagi


>
> Indeed your reply helps.
>
> We build in English and in Japanese.  The bullet point appears  
> correctly for
> English; in Japanese it leaves a blank, not #.
> We don't have Symbol font installed in layout/fonts; only Arial,  
> IPAGothic,
> etc.
>
> So, in English, is the bullet point using the Arial font (as  
> specified in
> the gentext en.xml file as &#8226;)?
>

Can you give a little more context?

AFAICT, I see two possible scenarios:
a) the stylesheet determines only the codepoint to use for list- 
bullets based on 'en.xml' or 'ja.xml'
    Japanese -> &#x25CF;
    English -> &#x2022;
b) the stylesheet determines both font-family and codepoint based on  
those two files

If the choice of font-family is determined in the stylesheet, then it  
becomes possible to have both languages render correctly, even with  
FOP's current limitation.


>
> If I changed Symbol to IPAGothic - like below - is there a risk of  
> skewing
> up the English output?
>

Possibly. I don't have the IPAGothic font to test with, but if it  
does not contain a glyph for both codepoints, then you risk

So, maybe what you have below needs to be supplemented with an  
xsl:choose, that creates a font-family attribute with the right  
value. I'm not sure how your stylesheet can reference the language  
property, but let's say that's represented by '@xml:lang', then:


>
>   <!-- Fallback font used for Unicode symbols such as right arrow -->
> <xsl:param name="symbol.font.family"
>          select="'IPAGothic,Symbol,ZapfDingbats,LucidaUnicode'" />
>

This will make sure that all templates that use this parameter, will  
use that font-family list.
Only, as mentioned, FOP would eventually only use the 'IPAGothic' font.
Maybe you would need something like:

<xsl:param name="symbol.font.family">
   <xsl:choose>
     <xsl:when test="starts-with(@xml:lang, 'en')">'Arial'</xsl:when>
     <xsl:when test="starts-with(@xml:lang, 'ja')">'IPAGothic'</ 
xsl:when>
     ...
   </xsl:choose>
</xsl:param>


>
> <xsl:template match="symbol[@role = 'symbolfont']">
>
>>     <fo:inline font-family="IPAGothic">
>>       <xsl:call-template name="inline.charseq" />
>>     </fo:inline>
>>   </xsl:template>
>>

This template is unrelated to the above parameter. It would force all  
<symbol role="symbolfont"> nodes in the source document to use the  
IPAGothic font, so depending on the context, it could be safer/ 
cleaner to make it use that xsl:param.

<xsl:template match="symbol[@role='symbolfont']">
   <fo:inline font-family="{$symbol.font.family}">
     <xsl:call-template name="inline.charseq" />
   </fo:inline>
</xsl:template>

!!! Be careful if the parameter is global, and the fo:inline could be  
in a different language. In that case, it may become necessary to  
redo the xsl:choose locally in the template to obtain the correct  
effect.


HTH!

Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Mime
View raw message