Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
micro-HOWTO: international printing in mozilla
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
lesha
n00b
n00b


Joined: 18 Nov 2002
Posts: 45

PostPosted: Sat Feb 21, 2004 9:15 pm    Post subject: micro-HOWTO: international printing in mozilla Reply with quote

Since you're reading this, you've probably discovered that printing a document with non-latin characters from Mozilla (trunk or Firefox; hereafter "mozilla") doesn't work. This is a brief overview of the situation.

Mozilla supports 3 ways of printing; all output to PostScript, which is then sent to a file or to your printer spooler.

PostScript (default in Gentoo): This is broken for international characters -- the driver can't embed the proper fonts in its output, and no characters show up. There's a hack called "wprint" to convert these files to printable ones. However, it's hard to get to work (esp. with the latest mozilla versions), only supports one font per document, and is generally inconvenient. This method should, and (I hope) will die soon.

FreeType2: This method embeds the TrueType fonts from the page in the output PS file. It is thus much closer to WYSIWYG; it also means that if you have TT fonts for the languages you care about, you're all set. While the code existed for a while, it only recently ( 1.6 / ff 0.8 ) became usable with GTK2, and so isn't the default method in Gentoo (see https://bugs.gentoo.org/show_bug.cgi?id=42328).

It takes a little work to set this up. First, you need to compile mozilla with --enable-freetype2 (modify the ebuild to do this, if the above bug hasn't been fixed).

Next, find where your TT fonts live (usually /usr/X11R6/lib/X11/fonts/truetype/). Open up mozilla, and go to about:config. Set:

    font.FreeType2.enable to true
    font.FreeType2.printing to true
    font.FreeType2.unhinted to false
    font.directory.truetype.1 to your tt directory
    (you can have up to 3)

The directory variables you will need to add (right-click, New->String).

Now FreeType2 printing should be set up. You may need to restart Mozilla for these settings to take effect. To test it, go to a page with international characters, and/or interesting fonts, and print to a file. It should
display well in your favorite PS viewer. Note: the first time you print, mozilla will print some info about the fonts it finds to the standard output.

XPrint Disclaimer: I haven't actually tested this, as FreeType2 is good enough for me.
Xprint has many advantages, the main ones being: excellent international support, and MathML support. If you need either, or want to help test the "right" solution, this is for you.

This is the hardest method to set up. It requires a separate daemon, which handles a the rendering/font embedding work. To use it, you need to compile mozilla with --with-xprint (again, modify the ebuild), as well as get xprint (emerge xprint should do it). Read how to set it up on http://xprint.mozilla.org.

References

[1] http://www.mozilla.org/releases/mozilla1.6/known-issues-int.html
[2] http://www.mozilla.org/projects/fonts/unix/enabling_truetype.html
Back to top
View user's profile Send private message
asyr
n00b
n00b


Joined: 01 Sep 2004
Posts: 56
Location: Hellas

PostPosted: Mon Sep 06, 2004 1:25 pm    Post subject: Reply with quote

Thanks a lot !

You save me from to many troubles with mozilla + xprint !
Back to top
View user's profile Send private message
okram
n00b
n00b


Joined: 06 Aug 2002
Posts: 74
Location: Taipei, Taiwan

PostPosted: Mon Nov 01, 2004 8:50 pm    Post subject: Reply with quote

This is really excellent. At last, CJK printing in Mozilla without jumping through hoops.

I do hope it gets enabled as default in mozilla ebuilds.

Thanks.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum