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 Matthew East <md...@ubuntu.com> on 2006/04/24 01:15:10 UTC

embedding fonts

Hi again list,

Thanks for your very kind replies on the other thread. I will pursue the
suggestions Glenn makes and approach other lists with xsl related questions.

For the moment, I hope you won't mind if I bother you again with another fop
question: using 0.20-5, is it possible to configure fop easily to embed all the
fonts which it is using? I tried reading the documentation for fonts[1], but
couldn't make head or tail of it. Basically, all I want to do if for fop to use
the same fonts it is using now, but embed them. I don't even know precisely what
embedding means, but it appears to be required by the printer so...

[1] http://xmlgraphics.apache.org/fop/0.20.5/fonts.html

Again, the document is http://mdke.org/ubuntu/desktopguide.pdf

Let me know if you need any more information, and sorry again for bothering you
with my rather ill-informed questions.

Matt


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


Re: [solved?] Re: embedding fonts

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Actually, the FO would have been better in this case. I think you may
have specified font-style="italic" and not font-style="oblique" and
that's why the Courier font was used instead of FreeMono. So if you
change from "oblique" to "italic" in the config file, that's also fine.
It's your choice.

On 25.04.2006 01:56:15 Matthew East wrote:
> Matthew East <mdke <at> ubuntu.com> writes:
> > It occurred to me it might help for you to see the actual pdf. Here it is:
> > http://mdke.org/ubuntu/desktopguide-bw.pdf.
> 
> Sorry for spam, but I think it's resolved: I substituted "oblique" for "italic"
> in the configuration file, and it appears to have worked. Does that sound right?
> The new one is at the same link.



Jeremias Maerki


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


[solved?] Re: embedding fonts

Posted by Matthew East <md...@ubuntu.com>.
Matthew East <mdke <at> ubuntu.com> writes:
> It occurred to me it might help for you to see the actual pdf. Here it is:
> http://mdke.org/ubuntu/desktopguide-bw.pdf.

Sorry for spam, but I think it's resolved: I substituted "oblique" for "italic"
in the configuration file, and it appears to have worked. Does that sound right?
The new one is at the same link.

Matt


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


Re: embedding fonts

Posted by Matthew East <md...@ubuntu.com>.
Matthew East <mdke <at> ubuntu.com> writes:

> 
> Jeremias Maerki <dev <at> jeremias-maerki.ch> writes:
> 
> > 
> > I just tried the same and had no such problem with either 0.20.5 or
> > 0.92beta. Please observe FOP's log output closely. Maybe there's another
> > problem. What I can see here seems fine.
> 
> Nothing I haven't seen before in the output: http://fop.pastebin.com/679803
> 
> Was everything ok in my config file? No typos? I couldn't see any, but a second
> pair of eyes won't hurt.

It occurred to me it might help for you to see the actual pdf. Here it is:
http://mdke.org/ubuntu/desktopguide-bw.pdf.

If I can provide any more information, for example the font files and so on,
please say so!

Thanks,

Matt


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


Re: embedding fonts

Posted by Matthew East <md...@ubuntu.com>.
Jeremias Maerki <dev <at> jeremias-maerki.ch> writes:

> 
> I just tried the same and had no such problem with either 0.20.5 or
> 0.92beta. Please observe FOP's log output closely. Maybe there's another
> problem. What I can see here seems fine.

Nothing I haven't seen before in the output: http://fop.pastebin.com/679803

Was everything ok in my config file? No typos? I couldn't see any, but a second
pair of eyes won't hurt.

> Just curious: Why are you substituting the base 14 fonts with FreeFonts
> in the first place? Do you expect some additional characters not
> supported by the base14 fonts?

They were just the first fonts I selected.

Matt



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


Re: embedding fonts

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
I just tried the same and had no such problem with either 0.20.5 or
0.92beta. Please observe FOP's log output closely. Maybe there's another
problem. What I can see here seems fine.

Just curious: Why are you substituting the base 14 fonts with FreeFonts
in the first place? Do you expect some additional characters not
supported by the base14 fonts?

On 24.04.2006 20:46:58 Matthew East wrote:
> Jeremias Maerki <dev <at> jeremias-maerki.ch> writes:
> 
> > Hmm, Acrobat Reader displays the PDF just fine. GhostScript fails, too.
> > Without better error messages from these programs I don't know what
> > could be wrong. Maybe these are bugs in GhostScript and Evince.
> 
> Yeah, you're right, acrobat shows it fine. The bug is
> https://bugs.freedesktop.org/show_bug.cgi?id=6728 
> 
> One last question on embedding fonts: I've used only Serif and Monospace in the
> document, and have successfully embedded everything except for Monospace
> Oblique. It has used a non-embedded font for that. Here are the relevant
> sections in my config file, did I miss something?
> 
>  <font metrics-file="../libs/pdf/fonts/FreeMonoOblique-ttf.xml" kerning="yes"
> embed-file="/usr/share/fonts/truetype/freefont/FreeMonoOblique.ttf">
>     <font-triplet name="monospace" style="oblique" weight="normal"/>
>  </font>
>  <font metrics-file="../libs/pdf/fonts/FreeMonoBoldOblique-ttf.xml"
> kerning="yes"
> embed-file="/usr/share/fonts/truetype/freefont/FreeMonoBoldOblique.ttf">
>     <font-triplet name="monospace" style="oblique" weight="bold"/>
>  </font>
> 
> Perhaps I was wrong to put style="oblique"?



Jeremias Maerki


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


Re: embedding fonts

Posted by Matthew East <md...@ubuntu.com>.
Jeremias Maerki <dev <at> jeremias-maerki.ch> writes:

> Hmm, Acrobat Reader displays the PDF just fine. GhostScript fails, too.
> Without better error messages from these programs I don't know what
> could be wrong. Maybe these are bugs in GhostScript and Evince.

Yeah, you're right, acrobat shows it fine. The bug is
https://bugs.freedesktop.org/show_bug.cgi?id=6728 

One last question on embedding fonts: I've used only Serif and Monospace in the
document, and have successfully embedded everything except for Monospace
Oblique. It has used a non-embedded font for that. Here are the relevant
sections in my config file, did I miss something?

 <font metrics-file="../libs/pdf/fonts/FreeMonoOblique-ttf.xml" kerning="yes"
embed-file="/usr/share/fonts/truetype/freefont/FreeMonoOblique.ttf">
    <font-triplet name="monospace" style="oblique" weight="normal"/>
 </font>
 <font metrics-file="../libs/pdf/fonts/FreeMonoBoldOblique-ttf.xml"
kerning="yes"
embed-file="/usr/share/fonts/truetype/freefont/FreeMonoBoldOblique.ttf">
    <font-triplet name="monospace" style="oblique" weight="bold"/>
 </font>

Perhaps I was wrong to put style="oblique"?

Matt


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


Re: embedding fonts

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
On 24.04.2006 16:15:44 Matthew East wrote:
> Matthew East <mdke <at> ubuntu.com> writes:
> 
> > Now to see if I can get that xml file working with fop 0.20-5!!
> 
> I'm making slow progress. I've added the fonts to my configuration file[1] and
> told fop to use it. I use "<xsl:param name="body.font.family"
> select="'Serif'"/>" in my xsl. When fop converts the fo to pdf, it looks like it
> completes as before.
> 
> [1] CONFIG: http://fop.pastebin.com/678850
> 
> However, right at the end I get these errors:
> 
> [ERROR] TrueType warning: Can't find prep table
> [ERROR] TrueType warning: Can't find prep table
> [ERROR] TrueType warning: Can't find prep table


Those, I can see, too. You can ignore them. FOP 0.92beta doesn't issue a
warning on these anymore.

> But the pdf is created ok. Then I try to open it in my pdf viewer (Evince) the
> fonts don't show up. In my terminal, I see lots of these errors:
> 
> Error: Couldn't create a font for '1E14e6FreeSerif,Medium'
> Error: Couldn't create a font for '2E152dFreeSerif,Italic'
> 
> Any ideas?

Hmm, Acrobat Reader displays the PDF just fine. GhostScript fails, too.
Without better error messages from these programs I don't know what
could be wrong. Maybe these are bugs in GhostScript and Evince.

Jeremias Maerki


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


Re: embedding fonts

Posted by Matthew East <md...@ubuntu.com>.
Matthew East <mdke <at> ubuntu.com> writes:

> Now to see if I can get that xml file working with fop 0.20-5!!

I'm making slow progress. I've added the fonts to my configuration file[1] and
told fop to use it. I use "<xsl:param name="body.font.family"
select="'Serif'"/>" in my xsl. When fop converts the fo to pdf, it looks like it
completes as before.

[1] CONFIG: http://fop.pastebin.com/678850

However, right at the end I get these errors:

[ERROR] TrueType warning: Can't find prep table
[ERROR] TrueType warning: Can't find prep table
[ERROR] TrueType warning: Can't find prep table

But the pdf is created ok. Then I try to open it in my pdf viewer (Evince) the
fonts don't show up. In my terminal, I see lots of these errors:

Error: Couldn't create a font for '1E14e6FreeSerif,Medium'
Error: Couldn't create a font for '2E152dFreeSerif,Italic'

Any ideas?


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


Re: embedding fonts

Posted by Matthew East <md...@ubuntu.com>.
Jeremias Maerki <dev <at> jeremias-maerki.ch> writes: 
> Looks like you have a good share of bad luck with FOP.

No problem, fortunately you're all really helpful on this list!

>  You've
> stumbled upon a bug in TTFReader we recently fixed. Please use the
> TTFReader coming with FOP 0.92beta to create the font metric files. The
> generated files should also work with FOP 0.20.5.

root@kalliope:/opt/fop-0.92beta# java -cp
build/fop.jar:lib/avalon-framework-4.2.0.jar:lib/commons-logging-1.0.4.jar
:lib/commons-io-1.1.jar
org.apache.fop.fonts.apps.TTFReader
/usr/share/fonts/truetype/freefont/FreeSerif.ttf FreeSerif_ttf.xml
TTF Reader for Apache FOP 0.92beta

Parsing font...
Reading /usr/share/fonts/truetype/freefont/FreeSerif.ttf...
Number of glyphs in font: 5295
3 cmap tables
CMAP format: 4
Creating xml font file...
Creating CID encoded metrics...
Writing xml font file FreeSerif_ttf.xml...
This font contains no embedding license restrictions.

XML font metrics file successfullly created.

:)

(by the way, there's a typo there in "successfullly")

Now to see if I can get that xml file working with fop 0.20-5!!

Thanks again,

Matt


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


Re: embedding fonts

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Looks like you have a good share of bad luck with FOP. :-( You've
stumbled upon a bug in TTFReader we recently fixed. Please use the
TTFReader coming with FOP 0.92beta to create the font metric files. The
generated files should also work with FOP 0.20.5.

Please note that the classpath for the command-line of TTFReader is
slightly different:
http://xmlgraphics.apache.org/fop/0.92/fonts.html

On 24.04.2006 14:38:50 Matthew East wrote:
> Jeremias Maerki <dev <at> jeremias-maerki.ch> writes:
> 
> > If you want to embed all fonts, you have to
> > create font metric files using PFMReader or TTFReader for each one and
> > create the correct font triples in the configuration file.
> 
> Right, i'm trying to use TTFReader now, as specified on the fonts documentation
> page. However, it shows an error. I'm using Ubuntu, java jdk 1.5 and fop 0.20-5
> 
> ERROR: http://fop.pastebin.com/678687
> 
> It's possible that I've misunderstood the command I should be running. Hope you
> can help!
> 
> Matt


Jeremias Maerki


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


Re: embedding fonts

Posted by Matthew East <md...@ubuntu.com>.
Jeremias Maerki <dev <at> jeremias-maerki.ch> writes:

> If you want to embed all fonts, you have to
> create font metric files using PFMReader or TTFReader for each one and
> create the correct font triples in the configuration file.

Right, i'm trying to use TTFReader now, as specified on the fonts documentation
page. However, it shows an error. I'm using Ubuntu, java jdk 1.5 and fop 0.20-5

ERROR: http://fop.pastebin.com/678687

It's possible that I've misunderstood the command I should be running. Hope you
can help!

Matt


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


Re: embedding fonts

Posted by Matthew East <md...@ubuntu.com>.
Jeremias Maerki <dev <at> jeremias-maerki.ch> writes:

> "Embedding" means that the font is included in the PDF file. Otherwise,
> the font is only referenced and is required to be present on the viewer
> or printer. If it's not present on the receiving side, the document
> can't print correctly. If you want to embed all fonts, you have to
> create font metric files using PFMReader or TTFReader for each one and
> create the correct font triples in the configuration file. As soon as
> you specify a embed-file attribute (embed-url in 0.91 and later), the
> font will be embedded in the generated file. ATM, there is no easy way.
> I may get easier later this year when we have an improved font subsystem
> but ATM, it's a lot of manual work.

Thanks for this explanation! I will try and do this, although the "creating font
metric files" bit sounds rather difficult. I'll give it my best shot!

> If that doesn't help you on your way, please tell us exactly what on the
> fonts.html page is unclear to you.

That's fine: it makes sense now. I just wondered whether it was possible to do
it automatically for all fonts used by fop when creating the pdf. No problem!

Matt


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


Re: embedding fonts

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
"Embedding" means that the font is included in the PDF file. Otherwise,
the font is only referenced and is required to be present on the viewer
or printer. If it's not present on the receiving side, the document
can't print correctly. If you want to embed all fonts, you have to
create font metric files using PFMReader or TTFReader for each one and
create the correct font triples in the configuration file. As soon as
you specify a embed-file attribute (embed-url in 0.91 and later), the
font will be embedded in the generated file. ATM, there is no easy way.
I may get easier later this year when we have an improved font subsystem
but ATM, it's a lot of manual work.

If that doesn't help you on your way, please tell us exactly what on the
fonts.html page is unclear to you.

On 24.04.2006 01:15:10 Matthew East wrote:
> Hi again list,
> 
> Thanks for your very kind replies on the other thread. I will pursue the
> suggestions Glenn makes and approach other lists with xsl related questions.
> 
> For the moment, I hope you won't mind if I bother you again with another fop
> question: using 0.20-5, is it possible to configure fop easily to embed all the
> fonts which it is using? I tried reading the documentation for fonts[1], but
> couldn't make head or tail of it. Basically, all I want to do if for fop to use
> the same fonts it is using now, but embed them. I don't even know precisely what
> embedding means, but it appears to be required by the printer so...
> 
> [1] http://xmlgraphics.apache.org/fop/0.20.5/fonts.html
> 
> Again, the document is http://mdke.org/ubuntu/desktopguide.pdf
> 
> Let me know if you need any more information, and sorry again for bothering you
> with my rather ill-informed questions.



Jeremias Maerki


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