Help:Manual Fontsgs: Difference between revisions

From Scribus Wiki
Jump to navigation Jump to search
(Created page with "Category:Help_Manual Table of Contents <h2>CJK, Indic Script and Other non-Latin Fonts</h2> <p>CJK (Chinese, Japanese, Korean) usage in Scribus is possible. Ac...")
 
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 3: Line 3:
[[Help:TOC|Table of Contents]]
[[Help:TOC|Table of Contents]]


<h2>CJK, Indic Script and Other non-Latin Fonts</h2> <p>CJK (Chinese, Japanese, Korean) usage in Scribus is possible. Actually, except for adding KOIR-8 encodings, not much has been done to support CJK fonts (yet). However, some users have reported some success, including using exported PDFs for commercial print jobs. Thanks to QT's excellent Unicode support, already some of the work is done. Major work is underway on the next generation of Scribus to vastly expand support for non-Latin scripts. Stay tuned.</p> <h4>So, what Scribus can do now ?</h4> <ul> <li>Almost any good Unicode font will display individual glyphs in Scribus. Testing with large Unicode fonts such as Bitsream Cyberbit font shows no issues in display or printing, except for loading speed.</li> <li>Arabic script can be written and imported, but the special features of glyph combination in line endings are not yet enabled.</li> <li>Hebrew is well supported and right to left text is already enabled in Scribus. There are some issue with some accents.</li> <li>Indic Scripts are a much more difficult task, however, we have strong interest in supporting them. One developer has been working with Scribus developers to modify the display canvas to fully support the special features needed to display and print them properly.</li> <li>Glyph combining in these languages is not supported (yet).</li> <li>Scribus supports both Unicode TrueType fonts and OpenType Fonts, even if you export PDF 1.3.</li> <li>Exported EPS or PostScript works fine with most CJK or Unicode fonts.</li> <li>Cyrillic works perfectly and Scribus has active translators for Russian and Ukrainian.</li> </ul> <h4>Hints:</h4> <ul> <li>To reduce the size of your exported PDF and PostScript files either: <ol> <li>Convert all fonts in text frames to PostScript outlines.</li> <li>Enable sub-setting of any Unicode or CJK TrueType font in Settings &gt; Fonts.</li> </ol> </li> <li>When viewing in Acrobat Reader, enable the preference for smooth artwork display. See the <a href="toolbox1.html">Acrobat Reader section</a>.</li> <li>If you are exporting to SVG, conversion of text to PostScript outlines is almost always more satisfactory.</li> <li>Some Unicode fonts are quite large and will slow launching Scribus significantly. You should expect higher memory usage as well. Scribus does some very needed sanity checks on fonts upon loading.</li> </ul>
  <h2>Ghostscript Font Hints for Linux, Unix and MacOSX.</h2> <br> <em>These notes thanks to Craig Ringer and Russell Lang, maintainer of GSview.</em> <p>One of the most common causes of Ghostscript failure to render/import/convert a file is when Ghostscript can't find the fonts it needs to either display an EPS or PS. This not a weakness or flaw in Ghostscript, as <strong>all</strong> EPS/PS interpreters need to be able access the correct fonts listed within the PostScript. This can most definitely affect EPS/PS files you are trying to import into Scribus. Some applications do not properly embed the fonts, so they must be supplied externally.</p> <p>When Ghostcript can't find a font usually an error message from the console will be something like:</p> <pre>  gs -h  AFPL Ghostscript 8.50 (2004-12-10)  Copyright (C) 2004 artofcode LLC, Benicia, CA.  All rights reserved. blah blah bah...  invalidfont Current allocation mode is local Last OS error: No such file or directory and so on... </pre> <p>The <strong>invalidfont</strong> error means a: Ghostscript can't find the font or fonts. b: Ghostscript can't find <strong>any</strong> fonts c: There is a broken or malformed font on your system.</p> <p>The fix:</p> <h4>Creating a Fontmap File</h4> There's a secret gem in the GS source distribution, <pre> $GS_SRC_DIR/toolbin/genfontmap.ps </pre> This can be used to generate a Fontmap file - the same files you see frightening perl scripts for on the 'net. This file may or may not be shipped by your distro, so for this example, we are mentioning the un-tarred source directory for building a parallel GS install. You should use the <em>genfontmap.ps</em> from the version of Ghostscript you are using. Others may not work correctly. This is another good reason to get a recent version of Ghostscript. <pre>      $ gs -q -sFONTPATH=/usr/local/share/fonts/TrueType ${HOME}/build/ghostscript-8.31/toolbin/genfontmap.ps      % This Fontmap generated by genfontmap.ps      (AndaleMono)    (/usr/local/share/fonts/TrueType/AndaleMo.TTF) ;  (Arial-Black)  (/usr/local/share/fonts/TrueType/AriBlk.TTF) ;  (Arial-BoldItalicMT)    (/usr/local/share/fonts/TrueType/Arialbi.TTF) ;  (Arial-BoldMT)  (/usr/local/share/fonts/TrueType/Arialbd.TTF) ;  ... blah blah blah ...  (Utopia-Regular)        (putr.pfa) ;  (Verdana)      (/usr/local/share/fonts/TrueType/Verdana.TTF) ;  (Verdana-Bold)  (/usr/local/share/fonts/TrueType/Verdanab.TTF) ;  (Verdana-BoldItalic)    (/usr/local/share/fonts/TrueType/Verdanaz.TTF) ;  (Verdana-Italic)        (/usr/local/share/fonts/TrueType/Verdanai.TTF) ;  (Webdings)      (/usr/local/share/fonts/TrueType/Webdings.TTF) ;  (ZapfChancery-MediumItalic)    /URWChanceryL-MediItal ;  (ZapfDingbats)  /Dingbats ;      genfontmap completed OK. 42 new fonts added.    </pre> <p>So you redirect stdout or copy paste everything from the <code>% This Fontmap..</code> line to a text editor to save the Fontmap, copy the generated FontMap into the font directory, then add the directory to your GS_LIB env var:</p> <p>The exact path may vary.</p> <pre>   $ gs -q -sFONTPATH=/usr/local/share/fonts/TrueType ${HOME}/build/ghostscript-8.50/toolbin/genfontmap.ps &gt; /tmp/Fontmap  $ sudo cp /tmp/Fontmap /usr/local/share/fonts/Truetype  $ export GS_LIB=/usr/local/share/fonts/TrueType:$GS_LIB    </pre> <p>Then you can launch Scribus from the same console and GS will find them and will import EPS/PS files without issues.</p> <p>Alternately, you can edit your GS lib/Fontmap to source the new fontmap or append the new fontmap entries to your main lib/Fontmap.</p> <h4>Adding User Added TrueType Fonts</h4> <p>Despite the very best efforts of the Ghostscript documentation to make it appear otherwise, TrueType fonts are well supported in Ghostscript and quite easy to use with it.</p> <p>Most importantly, the GS_FONTPATH environment var and the -sFONTPATH argument may specify directories containing any supported type of font - not just PostScript fonts as described in the documentation.</p> <pre> $ export GS_FONTPATH=$MY_FONT_DIR:$HOME/.fonts $ scribus </pre> <h4>Ghostscript Fonts and EPS Import</h4> <p>EPS import in Scribus is affected by the Ghostscript font path. If GS can't find the fonts, they'll be silently substituted. You really, really want GS to be able to find your fonts.</p> <p>You are recommend to create Fontmap files for your font directories then add them to the GS_LIB env var, as this will cause GS to load fonts quickly in future. Testing confirms that once GS has been told where to find the fonts, the EPS import in Scribus happily pulls in local fonts where there is a suitable one to use for a font requested by the EPS, but not embedded.</p> <p>Note in all of the above, the creation and updating of Fontmap.gs is usually handled automagically, by using Kfontinstaller, as noted here: [[Help:Manual_Fontsadvanced|Font Installation with KDE]]</p>
 
{{OPL}}

Latest revision as of 18:32, 29 March 2012


Table of Contents

Ghostscript Font Hints for Linux, Unix and MacOSX.


These notes thanks to Craig Ringer and Russell Lang, maintainer of GSview.

One of the most common causes of Ghostscript failure to render/import/convert a file is when Ghostscript can't find the fonts it needs to either display an EPS or PS. This not a weakness or flaw in Ghostscript, as all EPS/PS interpreters need to be able access the correct fonts listed within the PostScript. This can most definitely affect EPS/PS files you are trying to import into Scribus. Some applications do not properly embed the fonts, so they must be supplied externally.

When Ghostcript can't find a font usually an error message from the console will be something like:

   gs -h   AFPL Ghostscript 8.50 (2004-12-10)   Copyright (C) 2004 artofcode LLC, Benicia, CA.  All rights reserved. blah blah bah...  invalidfont Current allocation mode is local Last OS error: No such file or directory and so on... 

The invalidfont error means a: Ghostscript can't find the font or fonts. b: Ghostscript can't find any fonts c: There is a broken or malformed font on your system.

The fix:

Creating a Fontmap File

There's a secret gem in the GS source distribution,

 $GS_SRC_DIR/toolbin/genfontmap.ps 

This can be used to generate a Fontmap file - the same files you see frightening perl scripts for on the 'net. This file may or may not be shipped by your distro, so for this example, we are mentioning the un-tarred source directory for building a parallel GS install. You should use the genfontmap.ps from the version of Ghostscript you are using. Others may not work correctly. This is another good reason to get a recent version of Ghostscript.

      $ gs -q -sFONTPATH=/usr/local/share/fonts/TrueType ${HOME}/build/ghostscript-8.31/toolbin/genfontmap.ps      % This Fontmap generated by genfontmap.ps      (AndaleMono)    (/usr/local/share/fonts/TrueType/AndaleMo.TTF) ;   (Arial-Black)   (/usr/local/share/fonts/TrueType/AriBlk.TTF) ;   (Arial-BoldItalicMT)    (/usr/local/share/fonts/TrueType/Arialbi.TTF) ;   (Arial-BoldMT)  (/usr/local/share/fonts/TrueType/Arialbd.TTF) ;   ... blah blah blah ...   (Utopia-Regular)        (putr.pfa) ;   (Verdana)       (/usr/local/share/fonts/TrueType/Verdana.TTF) ;   (Verdana-Bold)  (/usr/local/share/fonts/TrueType/Verdanab.TTF) ;   (Verdana-BoldItalic)    (/usr/local/share/fonts/TrueType/Verdanaz.TTF) ;   (Verdana-Italic)        (/usr/local/share/fonts/TrueType/Verdanai.TTF) ;   (Webdings)      (/usr/local/share/fonts/TrueType/Webdings.TTF) ;   (ZapfChancery-MediumItalic)     /URWChanceryL-MediItal ;   (ZapfDingbats)  /Dingbats ;      genfontmap completed OK. 42 new fonts added.    

So you redirect stdout or copy paste everything from the % This Fontmap.. line to a text editor to save the Fontmap, copy the generated FontMap into the font directory, then add the directory to your GS_LIB env var:

The exact path may vary.

   $ gs -q -sFONTPATH=/usr/local/share/fonts/TrueType ${HOME}/build/ghostscript-8.50/toolbin/genfontmap.ps > /tmp/Fontmap   $ sudo cp /tmp/Fontmap /usr/local/share/fonts/Truetype   $ export GS_LIB=/usr/local/share/fonts/TrueType:$GS_LIB    

Then you can launch Scribus from the same console and GS will find them and will import EPS/PS files without issues.

Alternately, you can edit your GS lib/Fontmap to source the new fontmap or append the new fontmap entries to your main lib/Fontmap.

Adding User Added TrueType Fonts

Despite the very best efforts of the Ghostscript documentation to make it appear otherwise, TrueType fonts are well supported in Ghostscript and quite easy to use with it.

Most importantly, the GS_FONTPATH environment var and the -sFONTPATH argument may specify directories containing any supported type of font - not just PostScript fonts as described in the documentation.

 $ export GS_FONTPATH=$MY_FONT_DIR:$HOME/.fonts $ scribus 

Ghostscript Fonts and EPS Import

EPS import in Scribus is affected by the Ghostscript font path. If GS can't find the fonts, they'll be silently substituted. You really, really want GS to be able to find your fonts.

You are recommend to create Fontmap files for your font directories then add them to the GS_LIB env var, as this will cause GS to load fonts quickly in future. Testing confirms that once GS has been told where to find the fonts, the EPS import in Scribus happily pulls in local fonts where there is a suitable one to use for a font requested by the EPS, but not embedded.

Note in all of the above, the creation and updating of Fontmap.gs is usually handled automagically, by using Kfontinstaller, as noted here: Font Installation with KDE

This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.0 or later. Distribution of the work or derivative of the work in any standard (paper) book form is prohibited unless prior permission is obtained from the copyright holder. A copy of the license is included in the section entitled "Text of the Open Publication License."