You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Asbjørn Thorsen <a....@usit.uio.no> on 2006/12/21 15:34:06 UTC

Font problems

We have a XML document in UTF-8 encoding. It contains characters for the 
sami (lappish) language. When we generate postscript documents with 
FOP/XEP the resulting document is missing 3 characters. These are all 
replaced by the character \240 in XEP and '#' in FOP. The characters in 
question are 0xc4 0x91, 0xc5 0x8b, 0xc4 0x8d in UTF-8. Why does this 
happen ? And how can we solve this problem ?

I have attatched a sample document which shows the problem.

Merry christmas !

Asbjørn Thorsen

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


Re: Font problems

Posted by Vincent Hennebert <vi...@anyware-tech.com>.
Asbjørn Thorsen a écrit :
> Manuel Mall skrev:
>> On Thursday 21 December 2006 23:34, Asbjørn Thorsen wrote:
>>> We have a XML document in UTF-8 encoding. It contains characters for
>>> the sami (lappish) language. When we generate postscript documents
>>> with FOP/XEP the resulting document is missing 3 characters. These
>>> are all replaced by the character \240 in XEP and '#' in FOP. The
>>> characters in question are 0xc4 0x91, 0xc5 0x8b, 0xc4 0x8d in UTF-8.
>>> Why does this happen ? And how can we solve this problem ?
>>>
>>> I have attatched a sample document which shows the problem.
>>
>> Which font are you using for rendering. I assume the Adobe default
>> fonts don't contain the glyphs for those code points. You need to use
>> a font which contains those glyphs.
>>
>>> Merry christmas !
>>>
>>> Asbjørn Thorsen
>>>
>> Manuel
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
>> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>>
> 
> So what you're saying that if we choose a font that has the glyphs we need,
> then FOP/XEP will use different codes for the characters instead of just
> using
> /240 or '#' for all of them ?

More precisely, FOP will use the right glyphs for those characters. The
 '#' are used to make you easily notice that there are missing glyphs
for some characters.

Vincent

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


Re: Font problems

Posted by Asbjørn Thorsen <a....@usit.uio.no>.
Manuel Mall skrev:
> On Friday 22 December 2006 17:49, Asbjørn Thorsen wrote:
>> Manuel Mall skrev:
>>> On Thursday 21 December 2006 23:34, Asbjørn Thorsen wrote:
>>>> We have a XML document in UTF-8 encoding. It contains characters
>>>> for the sami (lappish) language. When we generate postscript
>>>> documents with FOP/XEP the resulting document is missing 3
>>>> characters. These are all replaced by the character \240 in XEP
>>>> and '#' in FOP. The characters in question are 0xc4 0x91, 0xc5
>>>> 0x8b, 0xc4 0x8d in UTF-8. Why does this happen ? And how can we
>>>> solve this problem ?
>>>>
>>>> I have attatched a sample document which shows the problem.
>>> Which font are you using for rendering. I assume the Adobe default
>>> fonts don't contain the glyphs for those code points. You need to
>>> use a font which contains those glyphs.
>>>
>>>> Merry christmas !
>>>>
>>>> Asbjørn Thorsen
>>> Manuel
>>>
>> So what you're saying that if we choose a font that has the glyphs we
>> need, then FOP/XEP will use different codes for the characters
>> instead of just using /240 or '#' for all of them ?
> 
> Basically yes, if the font used doesn't contain the glyph then a) FOP 
> cannot calculate how much space to reserve for the character and it 
> makes some default assumption and b) when displaying the PDF the PDF 
> viewer has no means of rendering the character.
> 
> I assume you know how to configure using fonts other than the default 
> PDF fonts. If not see 
> http://xmlgraphics.apache.org/fop/0.92/fonts.html.
> 
> Manuel
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 
That was quite helpful. Thanks a lot :-)

Merry christmas

Asbjørn

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


Re: Font problems

Posted by Manuel Mall <ma...@apache.org>.
On Friday 22 December 2006 17:49, Asbjørn Thorsen wrote:
> Manuel Mall skrev:
> > On Thursday 21 December 2006 23:34, Asbjørn Thorsen wrote:
> >> We have a XML document in UTF-8 encoding. It contains characters
> >> for the sami (lappish) language. When we generate postscript
> >> documents with FOP/XEP the resulting document is missing 3
> >> characters. These are all replaced by the character \240 in XEP
> >> and '#' in FOP. The characters in question are 0xc4 0x91, 0xc5
> >> 0x8b, 0xc4 0x8d in UTF-8. Why does this happen ? And how can we
> >> solve this problem ?
> >>
> >> I have attatched a sample document which shows the problem.
> >
> > Which font are you using for rendering. I assume the Adobe default
> > fonts don't contain the glyphs for those code points. You need to
> > use a font which contains those glyphs.
> >
> >> Merry christmas !
> >>
> >> Asbjørn Thorsen
> >
> > Manuel
> >
>
> So what you're saying that if we choose a font that has the glyphs we
> need, then FOP/XEP will use different codes for the characters
> instead of just using /240 or '#' for all of them ?

Basically yes, if the font used doesn't contain the glyph then a) FOP 
cannot calculate how much space to reserve for the character and it 
makes some default assumption and b) when displaying the PDF the PDF 
viewer has no means of rendering the character.

I assume you know how to configure using fonts other than the default 
PDF fonts. If not see 
http://xmlgraphics.apache.org/fop/0.92/fonts.html.

Manuel

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


Re: Font problems

Posted by Asbjørn Thorsen <a....@usit.uio.no>.
Manuel Mall skrev:
> On Thursday 21 December 2006 23:34, Asbj�rn Thorsen wrote:
>> We have a XML document in UTF-8 encoding. It contains characters for
>> the sami (lappish) language. When we generate postscript documents
>> with FOP/XEP the resulting document is missing 3 characters. These
>> are all replaced by the character \240 in XEP and '#' in FOP. The
>> characters in question are 0xc4 0x91, 0xc5 0x8b, 0xc4 0x8d in UTF-8.
>> Why does this happen ? And how can we solve this problem ?
>>
>> I have attatched a sample document which shows the problem.
> 
> Which font are you using for rendering. I assume the Adobe default fonts 
> don't contain the glyphs for those code points. You need to use a font 
> which contains those glyphs.
> 
>> Merry christmas !
>>
>> Asbj�rn Thorsen
>>
> Manuel
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 

So what you're saying that if we choose a font that has the glyphs we need,
then FOP/XEP will use different codes for the characters instead of just using
/240 or '#' for all of them ?

Font problems

Posted by Richard King <ri...@allfinanz.com>.
Hi there,
I am trying to include and embad a font into a FOP generated PDF file.

I have sucessfully done this via the fop configuration file but am hoping it is also possible to do this programatically.

Do you know if this is possible?

My Java implementation is as follows:
            FopFactory fopFactory = FopFactory.newInstance();
            FOUserAgent userAgent = fopFactory.newFOUserAgent();

            File file = new File("C:/work/36/wa/bil/misc/fop/config.xml");
            fopFactory.setUserConfig(file);

            // Setup output
            out = new java.io.FileOutputStream(fopOutputDir + fileRoot + ".pdf");
            out = new java.io.BufferedOutputStream(out);
            Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, userAgent, out);

            //Setup Transformer
            Source xsltSrc = new StreamSource(fopDirectory + xslName);
            TransformerFactory transformerFactory = TransformerFactory.newInstance();
            Transformer transformer = transformerFactory.newTransformer(xsltSrc);

            Source src = new StreamSource(new StringReader(xmlString));

            //Make sure the XSL transformation's result is piped through to FOP
            Result res = new SAXResult(fop.getDefaultHandler());

            //Start the transformation and rendering process
            transformer.transform(src, res);

Cheers,
Richard

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


Re: Font problems

Posted by Manuel Mall <ma...@apache.org>.
On Thursday 21 December 2006 23:34, Asbjørn Thorsen wrote:
> We have a XML document in UTF-8 encoding. It contains characters for
> the sami (lappish) language. When we generate postscript documents
> with FOP/XEP the resulting document is missing 3 characters. These
> are all replaced by the character \240 in XEP and '#' in FOP. The
> characters in question are 0xc4 0x91, 0xc5 0x8b, 0xc4 0x8d in UTF-8.
> Why does this happen ? And how can we solve this problem ?
>
> I have attatched a sample document which shows the problem.

Which font are you using for rendering. I assume the Adobe default fonts 
don't contain the glyphs for those code points. You need to use a font 
which contains those glyphs.

> Merry christmas !
>
> Asbjørn Thorsen
>
Manuel

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