[LUGOS] Abiword latin2
Luka Lezaic
llezaic at volja.net
Tue Feb 4 12:55:22 CET 2003
Lep pozdrav.
> Ali kdo mogoče ve, kje je problem?
>
> egon
Tole je iz AbiWord ovega Help-a, ga sigurno imaš. Mogoče ti pride prav, mi
izgleda kot podoben problem(broken font).
Luka
My Fonts for Encoding XXX Print as Circles but Display Correctly
Symptoms: you installed a custom pfa/pfb font for some other encoding than
Latin-1 (commonly ISO-8859-2) and while everything works fine on the screen
you get circles in place of some of the (accented) characters when you print
the document out. The font works fine with other applications. (NB: if you
are seeing the circles on the screen, than that is a different problem.)
Diagnosis: While this problem can sometimes be keyboard-related most likely
it is caused by your font. To decide which it is, you should carry out the
following test. Create a new AbiWord document and type couple of letters from
your language (those that appear printed as circles). Save the document in
the abw format and then open it with a plain text editor. At the start of the
document there is a kind of a header, and then later on you will find your
characters in between a pair of <c></c> tags. In a normal AbiWord document
created under an 8-bit locale each of these characters should be represented
by a single byte, and most likely you will be able to read them. If this is
the case, then read on. However, if you find instead that the characters are
represented by &#xXXXX tokens (where XXXX is the Unicode value of the
character), then your problem is keyboard related and you should see Keyboard
Related Problems below.
Cause: your font is broken. It was probably created by modifying an original
Latin-1 font, and while the person doing the modification changed the glyphs,
s/he did not change the glyph names. It works with other (8-bit) applications
because they use 8-bit character codes to access the glyphs, assuming that
the first 256 glyphs in the font and its metric file are ordered according to
the encoding of the current locale. This assumption is unsafe and AbiWord
cannot afford to make it, because we support other than 8-bit locales and
fonts that contain many more glyphs than the 256 that a 8-bit application
would use (for instance the MS Times New Roman font contains around 1200
glyphs). The only reliable way we can retrieve the metrics information about
the glyph from the font's metric file is by using the name of the glyph. In
case of a pfa/pfb font, Adobe specifies an unambiguous conversion between its
standard glyph names and Unicode, and we use this to translate the Unicode
value into a glyph name. If the glyphs in your font are misnamed, the glyph
which according to the Adobe's PostScript standard we should be looking for
is not found in the font, and we draw a small circle in the place.
Solution: while this is not AbiWord's fault, we have provided a workaround
for such broken fonts. You need to create a u2g file with a name identical
with the name of the font, i.e., if your font is called amaretto.pfa, you
need a file called amaretto.u2g. Here you have to specify the mapping from
glyph names to Unicode values that your font uses. Any lines in the u2g file
starting with # will be considered a comment and ignored, the first
non-comment line must contain the count of the map entries (i.e., lines) to
follow.
Each individual entry consists of the glyph name followed by a comma and then
a hexadecimal Unicode value. Each entry must be on a single line, and they
have to be sorted alphabetically by the glyph name. You can use
adobe-full.u2g, located in the fonts directory as a sample. If you have
multiple fonts that all use the same wrong glyph names, you only need to
create one such file, and just create symbolic links to it for the rest of
the fonts. If all fonts in your directory used the same wrong glyph names,
you do not need to create symbolic links, just call the file locale.u2g.
More information about the lugos-list
mailing list