[cairo] GTKCairo development
dturner at cptechno.com
Wed May 5 02:50:51 PDT 2004
> On Tue, 2004-05-04 at 16:26, Bill Spitzak wrote:
> I think a *killer* feature (one that will make Cairo
> instantly preferrable to every other graphics interface) would be
> to hide "font sets" inside it. My proposal is simple: when you
> select a font you are guaranteed that you will get 2^32 possible
> glyphs, and that you will get equivalent Unicode coverage
> no matter what font you choose. This will remove the need
> for Pango to switch fonts, for it to figure out what glyphs exist,
> and eliminate any need for any interface to indicate what glyphs
> exist, thus simplifying both Pango and Cairo. More importantly
> it will mean there will be reasonable compatability between programs
> using Pango and programs using something else, the glyphs
> will at least match, even if the positioning is wrong.
Would you care to elaborate a bit about your proposed API for Cairo,
because I clearly don't get exactly what you're describing.
To me, it seems that you're basically telling us to exclusively index
glyphs through Unicode points in "cairo fonts" (otherwise, what does
"equivalent Unicode coverage" really means ?).
You do understand that mapping character codes to real font glyph
indices is a bit more complex than a simple dictionary lookup, since
it can heavily depend on context, e.g.:
- locale: see the Han unification problem for a good example,
another one is the use of Indian numbers instead of Arabic ones
in certain countries (e.g. Pakistan, I believe).
- language & context-specific shaping: Arabic glyph shaping is
already part of Unicode's "Arabic presentation forms" blocks,
but this isn't true for all languages (e.g. Indian ones)
- availibility of combined forms: as described by Owen
- application of user-selectable context-sensitive typographic features,
like moon ligatures in Arabic, logo substitutions, number spacing,
- more generally, any non-trivial substitution that can be embedded
in OpenType or AAT tables
I have five open questions:
1. How do you implement this without duplicating _most_ of the functionality
of Pango, Uniscribe or ATSUI ?
2. How do you define and select a "cairo font" exactly. Should it include
locale, writing direction, and other context information ?
3. How do you push data from fonts into Cairo. What kind of data can
libraries and applications extract from a "cairo font". Especially
things like Pango itself.
4. What kind of glyph codes should the application send to Cairo.
what level of processing is required by the app when dealing with
complex combinations for example.
5. How do you keep this simple ?
Again, I may misunderstand your proposal. Any example code to show this API
would be welcome.
- David Turner
- The FreeType Project (www.freetype.org)
> Have you thought about:
> Metrics: What do you report for the metrics for this "combined font".
> Is it always going to have a huge descent because it contains
> Arabic somewhere in there?
> Language tagging: when creating fontsets you want to prefer the fonts
> that have all the characters of the language of the text.
> OpenType and other layout tables: Fonts aren't just collections of
> glyphs, they also have other tables that determine how these
> fonts interact. (Ligatures, substitutions, etc.)
> Integration with native font systems: On Windows, Pango works on top
> of Uniscribe. Uniscribe needs the individual fonts.
> Combining accents: If I have LATIN SMALL LETTER A followed by
> COMBINING ACUTE ACCENT, how do I select the font that doesn't
> have COMBINING ACUTE ACCENT but has LATIN SMALL LETTER A WITH ACUTE
> It's a really complex area; there's no way you can isolate Pango from
> the fontset selection process and get good results.
This message and any attachments (the "message") is intended solely for the
addressees and is confidential. If you receive this message in error, please
delete it and immediately notify the sender.
Any use not in accordance with its purpose, any dissemination or disclosure,
either whole or partial, is prohibited except formal approval.
The E-Mail transmission can not guarantee the integrity of this message.
NDS TECHNOLOGIES FRANCE will not therefore be liable for the message if modified.
More information about the cairo