[XeTeX] Res: overriding \addfontfeatures

Jonathan Kew jonathan_kew at sil.org
Wed Jun 4 18:05:25 CEST 2008


On 4 Jun 2008, at 4:42 pm, Flavio Costa wrote:

>> This isn't really a bug, it's a manifestation of how OpenType
>> features work and how the fonts are designed.
>
> Since this is an expected OpenType behaviour, we cannot really call  
> it a bug.
>
> However, with a high-level interface like fontspec a different  
> behaviour is expected. Grouping the mutually exclusive features may  
> provide a solution for this,

Yes; this is what is done, for example, in InDesign's user interface.

However, it is an inherently flawed strategy, because it means that  
the only features that can be presented appropriately are those that  
the application developer was specifically aware of and chose to  
support. This is inadequate when font developers may create new  
features with newly-registered or even unregistered feature tags, and  
there may be feature interactions that were not fully anticipated by  
the application developer.

> but maybe it's possible and easier to create a \setfontfeatures  
> command: instead of just adding new features to the previously  
> defined ones, it would ignore existing features and apply only the  
> ones provided in the command parameter, so it would drop an  
> existing +lnum and use only +onum for the current block. So this  
> \setfontfeatures would be a kind of \newfontfamily, but changing  
> only the features while keeping the current font, whatever it is.

That could be useful, though it might be tricky to decide exactly  
which "features" to drop -- would that include things that aren't  
actually OpenType features, but are specified in a similar way? (Like  
mapping, color, slant, embolden, etc.)

Alternatively, how about \removefontfeature to individually remove  
features from the current font definition, just like \addfontfeature  
adds them?

JK



More information about the XeTeX mailing list