Difference between revisions of "Font-FAQ"
Line 139: | Line 139: | ||
= Glyph Fallback = | = Glyph Fallback = | ||
+ | |||
+ | Some documents contain text that is not supported by the font specified for this text. This happens often when e.g. [http://www.unicode.org/versions/Unicode4.0.0/ch14.pdf symbols] or [http://www.unicode.org/charts/PDF/U0100.pdf extended latin characters] are involved. In order to display something reasonable the characters missing in the specified font are substituted by glyphs from other fonts. | ||
+ | |||
== What is this sophisticated "Glyph Fallback" == | == What is this sophisticated "Glyph Fallback" == | ||
== My extended latin characters look different than the rest of my text == | == My extended latin characters look different than the rest of my text == |
Revision as of 12:12, 10 February 2006
This is the place where the work on the Font-FAQ for OOo 2.x (*nix) will happen... Feel free to fill out missing items, suggest new ones or correct mistakes and fix typos!
If you have other suggestions, feel free to use the discussion-page.
Adding Fonts
How do I add fonts to OpenOffice.org 2 exclusively
There are two choices: Either for all users of OOo or only for one single user. If you intend to add the fonts...
- for all users of OOo (but only within OOo, put the fonts into the directory
/opt/openoffice.org2.0/share/fonts/truetype/
- only for one single user of OOo, put the fonts into the directory
~/.openoffice.org2/user/fonts/
Instead of moving around the fonts manually, you can as well use the Printer Administration tool "spadmin" to install the fonts. If you cannot find a "OpenOffice.org Printer Administration" launcher in your desktop's menu, you can lauch it manually by executing
/opt/openoffice.org2.0/program/spadmin
How do I add fonts to one user's desktop exclusively
When using fontconfig (which is the case for virtually every modern/current distribution out there), it is sufficient to place the fonts in the directory
~/.fonts/
If it doesn't exist already, create it. After adding or removing fonts, you should regererate the font-cache of that directory by running
fc-cache ~/.fonts/
How do I add fonts system wide
To make the fonts available system-wide, you have to add the fonts to a directory that is included in the global configuration file(s). Usually, you can find that file (fonts.conf) here:
/etc/fonts/fonts.conf
As stated in the file itself, you should not modify that file. Instead, modify the file local.conf instead (create it in the same directory if it doesn't exist already). But have a look at the default one for the syntax, etc. If you don't want to add your font to one of the already listed directories, then just create the directory and add that one to
/etc/fonts/local.conf
Let's say you decided to copy your fonts to the directory "/usr/local/share/myfonts", then you would add
<dir>/usr/local/share/myfonts</dir>
to "/etc/fonts/local.conf"
As when adding the fonts for a single user only, you should create the font-cache to speed up font-lookup. Keeping with the example, you would run
fc-cache /usr/local/share/myfonts/
and you're done.
Where can I find fonts for OpenOffice.org 2
You can install a bunch of fonts using the wizard "File|Wizards → Install Fonts from the Web". This includes the "Core Fonts" from Microsoft (can be obtained from http://corefonts.sourceforge.net/) and many others.
If you're looking for fonts that cover a special language, I'm sure you'll find these links useful:
SIL has a couple of high-quality fonts as well, some of them are worth mentioning individually:
- Gentium http://scripts.sil.org/gentium/
- Charis SIL http://scripts.sil.org/CharisSILFont or Doulos SIL http://scripts.sil.org/DoulosSILfont
- Galatia SIL http://scripts.sil.org/SILgrkuni
- Ezra SIL http://scripts.sil.org/EzraSIL_Home
Font Fallback
What is this Font Fallback in OpenOffice.org 2
Font-Fallback kicks in whenever a font is requested that is not installed on the system. (Not installed means: not available to OOo).
OOo then tries to use a different font from the ones that OOo knows about that matches the requested one as close as possible.
How does Font Fallback work
For font-fallback to produce satisfying results, OOo somehow has to know about similarities of fonts. OOo must know that it can for example substitue Arial by Helvetica, but not with Comic Sans. This task is not as easy as it sounds, since there are very many fonts out there and OOo cannot know about all of them.
FIXME: (is this corerct?)
OOo uses 2½ ways to find a suitable replacement:
- hard-coded list of fallback-fonts, from VCL.xcu (tried first)
if that fails:
- fallback by font-attributes (e.g. does it have CJK-characters, is it a Symbol-font) or style (serif/non-serif, proportional/non-proportional)
if that fails as well:
- use a default font
Where is the VCL.xcu in OpenOffice.org 2
You'll find the VCL.xcu in
/opt/openoffice.org2.0/share/registry/data/org/openoffice/VCL.xcu
(where "/opt/openoffice.org2.0/" is the default prefix of your installation)
How does the VCL.xcu work
The VCL.xcu includes both the default font-lists as well as the substitiution lists for fallback. The replacement-lists are in <node oor:name="FontSubstitutions">
Let's look at an example:
[..lots of lines...] <node oor:name="FontSubstitutions"> [...lots of lines...] <node oor:name="thorndale" oor:op="replace"> <prop oor:name="SubstFonts"> <value>timesnewroman;times;timesroman;newyork;timmons;serif;lucidaserif;lucidabright;roman;nimbusromanno9;nimbusromanno9l;bookman;itcbookman;garamond;garamondmt;palatino</value> </prop> <prop oor:name="SubstFontsMS"> <value>Times New Roman</value> </prop> <prop oor:name="SubstFontsPS"> <value>Times</value> </prop> <prop oor:name="SubstFontsHTML"> <value>serif</value> </prop> <prop oor:name="FontWeight"> <value>Normal</value> </prop> <prop oor:name="FontWidth"> <value>Normal</value> </prop> <prop oor:name="FontType"> <value>Default,Standard,Normal,Serif</value> </prop> </node> [..lots of lines...]
The first think you notice is that the fontnames listed in that section are all normalized, that means only lowercase letters with all numbers, spaces and other characters removed.
Second thing you notice is that there is not only one item with a list of replacement fonts, but also some other properties like SubstFontsMS, SubstFontsPS, SubstFontsHTML,...
So what does all these mean?
<node oor:name="thorndale" oor:op="replace">
starts a new section, a new set of replacements for the font "Thorndale" the property
<prop oor:name="SubstFonts">
describes the list of fonts that could be used instead of Thorndale, when Thorndale is not installed. In the example, this would include "Times New Roman", "Times", "Times Roman",... and finally "Palatino"
This list works the other way as well, so when you request e.g. Palatino but don't have that one installed, Thorndale is a possible replacement.
The other properties are optional and describe the font in more detail or for special circumstances. If you export the document to a Microsoft Office Format, the font given in
<prop oor:name="SubstFontsMS">
(in this case "Times New Roman") would be specified as alternative in the document, if you print to a postscript printer, the font would be replaced by "Times" (most likely built-into the printer), when you export to HTML, it would be specified as a "serif" font, etc.
How can I configure OpenOffice.org 2 to perform a specific font substitution
If you're not happy with the replacement that OOo does, you can override the replacement and define a new one of your choice by using
Tools|Options → OpenOffice.org → Fonts
check "[x] Apply Replacement Table" and type in the name of the font you want to replace, and select a font that should be the replacement from the list.
check [x] always if you want the font to be replaced, even when it is installed check [x] screen if you want the font to be replaced on screen only
My document using a popular Windows font looks different than on Windows
Many systems have fonts that claim to look like Windows fonts (e.g. Arial, Times New Roman or Courier New ) but actually don't. It helps considerably to download and install the real fonts from Corefonts.
My document using TNR looks awful
How can I find out what font OpenOffice.org 2 really uses
Glyph Fallback
Some documents contain text that is not supported by the font specified for this text. This happens often when e.g. symbols or extended latin characters are involved. In order to display something reasonable the characters missing in the specified font are substituted by glyphs from other fonts.