On Thursday 07 April 2005 17:06, Herbert Duerr wrote:
> > I'm a font developer and I'd like my fonts to support this feature
> > to display different presentation forms for some glyphs, depending
> > on which language the user chooses.
> >
> > Can someone explain me in detail which OTF features are used for
> > this purpose and how I have to set them in my fonts to support the
> > language feature?
>
> Currently OOo uses the defaults of the underlying font systems (e.g.
> Win32 API, Uniscribe, Freetype, ICU) for this. The document's locale
> is not yet fed into these systems so at best just the system's local
> is available to these subsystems. As far as I know only the Win32 API
> supports this.

freetype 2 also does.

> > I tried already to have some GSUB (Simplified Form and Traditional
> > Form) entries for languages hani(zhs) and hani(zht), but this one
> > doesn't do the trick.
>
> The only chance for OOo to handle this on all platforms would be to
> parse all the OT tables itself and only deal with glyphids instead of
> unicodes. Unfortunately this would cause a lot of problems with e.g.
> printer drivers which often like to mess with the fonts like
> replacing the selected font with builtin fonts etc.

Ok, I'm not sure about the details here... I'm using Linux, not Windoze, 
so I don't know how printing works on Windoze systems. But on Linux you 
usually generate a PostScript or PDF file and send this to the printer. 
This has the advantage that you can embedd the fonts from the system 
and even do the rendering first. So, no need for the printer driver to 
replace the fonts. :)

One possible solution wold be to only support OTF features on systems 
which have the necessary libraries installed.
I use 'fontforge' to work on my fonts and 'fontforge' is currently the 
only application I know which supports all the OTF features. It also 
uses freetype 2.

What is urgently needed are the following features:
* 'anchor' support for latin characters and 'combining diacritics' in 
Unicode. These are used to correctly align combining diacritics to 
their base characters and also to stack diacritcs onto each other. This 
is used for example in Vietnamese and Taiwanese. Vietnamese also has 
corresponding codepoints in Unicode, but Taiwanese has not. Those 
characters need to be composed by combining diacritcs.
The 'anchors' are defined in the font, a base anchor in the base glyph 
and a mark anchor in the combining diacritc character. The anchors then 
'glue' together.

* vertical alternatives to select vertical varients of (mainly 
punctuation) characters in CJK languages (but also others).

* stylistic alternatives (salt) to select other presentation forms 
independend from the document language.

* alternatives by language tag. This feature and the 'salt' feature 
should be choosable on character base. For example, my main document 
language is zht (Taiwan), so all characters in the document should 
display the language varient for hani(zht) if it is available in the 
selected font. Then maybe I want to display the difference on how some 
glyphs have a different presentation form in Mainland China (zhs). So, 
I select that particular character in the document and choose the 
available presentation form for hani(zhs).

To send the document correctly to the printer, it should be rendered 
first into PostScript and then sent to the printer driver.

Even if you would have to parse the GSUB tables of the fonts yourself, 
there is no need to use glyphids instead of unicodes as all the 
glyphids map to a unicode codepoint in the font (for example I have 
'salt' characters in my font placed to U+100000~U+100009, which is 
outside the currently defined Unicode space (U+0000~U+FFFFF), but which 
is available in the font as those codepoints.

For the user interface: the alternatives could be presented to the user 
as following:
1. User selects a CJK character from the text, presses the right mouse 
button, choose 'Display Substitutions' and the gets a list of all 
possible substitutions for that glyph defined in that particular font.

2. User wants to 'replace' all occurences of the glyph in te document by 
his preferred presentation form: user selects a character, uses 
'Edit'->'Find/Replace', chooses 'Substitutions', then gets a list of 
all possible substitutions for that glyph in that font.

The substitution function can either work only for one character, in 
which case we could present the user with a list of possible choices 
(and display a preview window), or for many glyphs (string) in which 
case we cannot display all possible combinations, but only a list of 
what kind of possible substitutions the font can offer (or if you want 
to make it independend of the font, list all possible OTF substitutions 
-- they are too many, this is not convenient).

Any comments? :)

Cheers
Arne
-- 
Arne GÃtje (éçè) <[EMAIL PROTECTED]>
PGP/GnuPG key: 1024D/685D1E8C
Fingerprint: 2056 F6B7 DEA8 B478 311F  1C34 6E9F D06E 685D 1E8C
Key available at wwwkeys.pgp.net.   Encrypted e-mail preferred.

Attachment: pgpg0EWUfhxTi.pgp
Description: PGP signature

Reply via email to