xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sudhir543-...@yahoo.com
Subject Re: AW: Zero width space is displayed as junk character [â€] in PDF
Date Mon, 09 Nov 2009 12:04:43 GMT
Seems that it is the problem of font.. 

I am doing this on Windows XP.

I have attached the generated xml file here for review. 

when I open this file in text editor with arial or any other font other than "Arial Unicode
MS"
I see a junk character ​​like a cube in text file at the place of zero width space.. when
I change the font to Arial Unicode MS.. the cube disappears

The lines which is creating problem is 

<fo:table-row font-family="serif,Symbol" font-size="11pt" border-width="0pt">
<fo:table-cell display-align="center" padding-right="5pt" border-color="white" background-color="lightgray"
border-width="1pt" border-style="solid">
<fo:block font-size="9pt" font-weight="bold" space-after.optimum="1pt" space-before.optimum="1pt"
text-align="right">Customer IO No.</fo:block>
</fo:table-cell>
<fo:table-cell border-style="solid" border-width="1pt" border-color="white" text-align="center"
background-color="#EEEEEE" padding-left="5pt">
<fo:block font-size="9pt" padding-left="3pt" font-weight="normal" space-after.optimum="1pt"
space-before.optimum="1pt" text-align="left">NGT-LGT-15​8-01-IWCNG​T-LGT-158-​01-IWCNGT-​LGT-158-01​-IWCNGT-LG​T-158-01-I​WCNGT-LGT-​158-01-IWC​NGT-LGT-15​</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row font-family="serif,Symbol" font-size="11pt" border-width="0pt">
<fo:table-cell display-align="center" padding-right="5pt" border-color="white" background-color="lightgray"
border-width="1pt" border-style="solid">
<fo:block font-size="9pt" font-weight="bold" space-after.optimum="1pt" space-before.optimum="1pt"
text-align="right">Customer PO No.</fo:block>
</fo:table-cell>
<fo:table-cell border-style="solid" border-width="1pt" border-color="white" text-align="center"
background-color="#EEEEEE" padding-left="5pt">
<fo:block font-size="9pt" padding-left="3pt" font-weight="normal" space-after.optimum="1pt"
space-before.optimum="1pt" text-align="left">NGT-LGT-15​8-01-IWCNG​T-LGT-158-​01-IWCNGT-​LGT-158-01​-IWCNGT-LG​T-158-01-I​WCNGT-LGT-​158-01-IWC​NGT-LGT-15​</fo:block>
</fo:table-cell>
</fo:table-row>  


I have added zero width spaces to this line NGT-LGT-15​8-01-IWCNG​T-LGT-158-​01-IWCNGT-​LGT-158-01​-IWCNGT-LG​T-158-01-I​WCNGT-LGT-​158-01-IWC​NGT-LGT-15


Please look at generated xml file and the portion of resulting PDF which has junk characters

Thanks
SN

  
  

Personally I'm always ready to learn, although I do not always like being taught
  




________________________________
From: Tobias van Treeck <tvtreeck@nepatec.de>
To: fop-users@xmlgraphics.apache.org
Sent: Mon, 9 November, 2009 4:24:45 PM
Subject: Re: AW: Zero width space is displayed as junk character [â€] in PDF

Hi,

several possibilities:

1.) try using: font-family="serif,Symbol" or font-family="Helvetica">
2.) Why do you still use that old FOP Version? Try upgrading...
3.) I tried the zero space character and for me it is working however i use FOP 0.95 and the
default font which is Helvetica (ArialMT?)
4.) Try to load the font you are using: http://xmlgraphics.apache.org/fop/0.95/fonts.html

Regards,
ToM




2009/11/9 <sudhir543-dev@yahoo.com>

Hi,
>
>
>>
><xsl:text>&#x20;</xsl:text> works for me too but not <xsl:text>&#x200B;</xsl:text>
>
>  
>I am using sans-serif fonts   <xsl:attribute name="font-family">sans-serif</xsl:attribute>
>
>Any idea...
>
>
>
>  
>
>Thanks
>SN
>
>Personally I'm always ready to learn, although I do not always like being taught
>  
>
>
>
>
>
________________________________
 >From: Tobias van Treeck <tvtreeck@nepatec.de>
>
>To: fop-users@xmlgraphics.apache.org
>Sent: Fri, 6 November, 2009 7:01:50 PM
>Subject: Re: AW: Zero width space is displayed as junk character [â€] in PDF
>
>
>Hi,
>
>>And why would I need UTF-8 to store "&#x200B;"
>you would need UTF-8 because the sign you are using is unicode....
>
>did you set the following line in your xsl file?
>>
><?xml version="1.0" encoding="UTF-8"?>
>
>I also use for instance:
><xsl:text>&#x20;</xsl:text>
>
>and it is working fine...
>Regards,
>ToM
>
>
>2009/11/6 <sudhir543-dev@yahoo.com>
>
>Files is saved with UTF-8 .. that doesnt solve problem.. a
>>>>
>>
>>
>>And why would I need UTF-8 to store "&#x200B;" other encoding would also handle
it correctly.. I have no special characters in my xsl that may need UTF-8.
>>Any way.. it does not work with UTF-8 too
>>>>
>>
>>Thanks
>>SN
>>
>> 
>>  
>>  
>>
>>Personally I'm always ready to learn, although I do not always like being taught
>>  
>>
>>
>>
>>
>>
________________________________
 >>
>>
>>From: Georg Datterl <georg.datterl@geneon.de>
>>To: fop-users@xmlgraphics.apache.org
>>Sent: Fri, 6 November, 2009 4:04:35 PM
>>Subject: AW: Zero width space is displayed as junk character [â€] in PDF
>>
>>>>
>>
>>
>>
>>Hi SN, 
>>
>>That's most likely an encoding problem. I have seen a similar effect with the latest
trunk, if I open the fo file in XMLSpy. Have a look at your application and make sure it saves
the fo file with the same encoding you use for reading. Preferably UTF-8, I guess.
>>
>>Regards,
>>
>>Georg Datterl
>>
>>------ Kontakt ------
>>
>>Georg Datterl
>>
>>Geneon media solutions gmbh
>>Gutenstetter Straße 8a
>>90449
>> Nürnberg
>>
>>HRB Nürnberg: 17193
>>Geschäftsführer: Yong-Harry Steiert 
>>
>>Tel.: 0911/36 78 88 - 26
>>Fax: 0911/36 78 88 - 20
>>
>>www.geneon.de
>>
>>Weitere Mitglieder der Willmy MediaGroup:
>>
>>IRS Integrated Realization Services GmbH:    www.irs-nbg.de 
>>Willmy PrintMedia GmbH:                            www.willmy.de
>>Willmy Consult & Content GmbH:                www.willmycc.de 
>>-----Ursprüngliche Nachricht-----
>>Von: sudhir543-dev@yahoo.com [mailto:sudhir543-dev@yahoo.com] 
>>>>
>>
>>
>>Gesendet: Freitag, 6. November 2009 11:29
>>An: fop-users@xmlgraphics.apache.org
>>Betreff: Zero width space is displayed as junk character [â€] in PDF
>>
>>I am using fop 0.20.4.. I need to wrap content inside a block so I am adding zero
width spaces (&#x200B; ) to the long string.. how ever Instead of breaking at zero width
space.. it displays &#x200B; as a special character (â€) in PDF.. 
>>
>>Here's my xsl code that adds zero width spaces as required
>>
>>
>><xsl:template name="hyphenate">
>>    <xsl:param name="data" />
>>    <xsl:param name="limit" select="'10'"/>    
>>>>
>>
>>
>>    <xsl:choose>
>>        <xsl:when test="string-length($data) &lt; $limit">
>> 
>>           <xsl:value-of  select="$data"/>
>>        </xsl:when>
>>        <xsl:otherwise>
>>            <xsl:variable name="part" select="substring($data, 1, $limit)"/>
>>>>
>>
>>
>>            <xsl:variable name="remaining" select="substring($data, $limit+1)"/>
>>            <xsl:value-of select='concat($part, "&#x200B;")'/>    
>>            <xsl:call-template name="hyphenate">
>>>>
>>
>>
>>                <xsl:with-param name="data" select="$remaining"/>
>>                <xsl:with-param name="limit" select="$limit"/>
>>            </xsl:call-template>           
>>                 
>>        </xsl:otherwise>
>>    </xsl:choose>    
>></xsl:template>  
>>  
>>
>>Any ideas why is it happening ?
>>
>>Thanks
>>SN
>>
>>
>>
>>Personally I'm always ready to learn, although I do not always like being taught
>>
>>  
>>
>>
>>________________________________
>>
>>The INTERNET now has a personality. YOURS! See your Yahoo! Homepage <http://in.rd.yahoo.com/tagline_yyi_1/*http://in.yahoo.com/>
.
>>
>>>>
>>
>>________________________________
 Try the new Yahoo! India Homepage. Click here.
>
>>
>
>________________________________
 Add whatever you love to the Yahoo! India homepage. Try now!



      Keep up with people you care about with Yahoo! India Mail. Learn how. http://in.overview.mail.yahoo.com/connectmore
Mime
View raw message