Re: RemapGlyph()

Subject: Re: RemapGlyph()
From: WJCarpenter (bill-abisource@carpenter.ORG)
Date: Wed Jun 20 2001 - 18:46:11 CDT

ad> Can somebody please explain the role of GR_Graphics::remapGlyph()?
ad> It converts zero-width characters into "degree" symbols. This is
ad> the cause of Bug 1518. Why do we do this?

ms> I'm fighting with this too. Symbol fonts have major problems being
ms> printed on Gtk. I suspect that something even more serious is
ms> happening with them too.

ms> Twice I've saved a test document with symbol fonts and both have
ms> turned up as "bogus documents". I suspect we problems in our
ms> import/exporters.

Whoa, Nellie. I think there are three different things in this one

1. What does remapGlyphs actually do? I'll come back to tha, below.

2. Printing under Gtk. My guess is that this is a specific print
driver problem. Since remapGlyphs only comes into play when a
character has a zero-width glyph, it can't be the source of this
problem unless Gtk printing can somehow do something more appropriate
with zero-width glyphs.

3. Bogus documents for documents with symbol fonts. I think you're
right about the exporter being the problem, though I thought this had
been fixed at least a couple months ago (I still think that). It was
first noticed that the *.abw exporter was exporting smart quote
characters as some other strange thing. My assumption is that other
non-Latin1 characters would get similar treatment.

OK, so what is remapGlyphs all about? Here is a description I sent to
someone about a year ago (so some things in the code base may have
changed since then).

On some platforms, and for some fonts, there are glyphs missing at
positions of interest. In particular, the fonts supplied with Abi on
Unix only have glyphs among the first 256 positions (ie, 8 bits).
That means that any Unicode characters >=256 will be measured and
rendered as zero-width characters. This can be somewhat confusing to
the average user.

The most common case of this is in the use of "smart quotes" in
documents imported from MSWord. Abi MSWord and RTF importers
correctly translate the characters to the appropriate Unicode
characters positions, but they are all in the U+20xx range.

The remapGlyphs feature provides preference values for which
characters to show instead of invisible characters. The remapping is
done only for display/printing purposes; the document itself is not
changed. The default preferences will only do the remapping if the
character is actually zero-width in the font being used, remappings
are provided for the four Unicode curly quote characters, and there is
a default remapping for any other characters that happen to come up

AbiWord 0.7.10 had some other distracting character spacing problems,
so the best way to see the difference is to use a recent Unix build
and view a document with smart quotes (easiest is to import a simple
MSWord document, but I have attached a somewhat messy document I've
been testing with) with the preference value turned on and off.
Besides being invisible when the preference is turned off, moving the
cursor with arrow keys does a double step at the position of the
zero-width character. This makes great sense to programmers but is
confusing to regular folks.

bill@carpenter.ORG (WJCarpenter)    PGP 0x91865119
38 95 1B 69 C9 C6 3D 25    73 46 32 04 69 D6 ED F3

This archive was generated by hypermail 2b25 : Wed Jun 20 2001 - 18:48:03 CDT