Extra high initials only with salt.

Scriptor Abbatiſſæ's picture

Does anyone know of a way to enable special initial capitals only when 'salt' is selected? This is for a font that uses the 'salt' feature to produce extra high ascenders as for the first line of text. I know that I can simply include the substitutions for the extra high initial capitals in the 'salt' block, and then use a downstream 'calt' block to supress them whenever any of them might follow another upper case glyph, but that would require an enormous 'calt' block which I really want to avoid. If the OpenType formatt permitted an 'init' block to be subsumed inside a 'salt' block, this would be very easy, but unfortunately that is not permitted.

gargoyle's picture

To suppress neighboring initial caps in the 'calt' feature, would the following sort of code work in your situation?

sub @initialcaps' @initialcaps by @capitials;
sub @capitals @initialcaps' by @capitals;

Scriptor Abbatiſſæ's picture

Would I then name the initial forms [A.init - Z.init] ? How would that work?

gargoyle's picture

Those names seem appropriate. The initial cap glyphs would just need to be grouped into a class, and the regular capitals in another class, in the same order. They can be defined like you showed using ranges, presuming every capital has an initial form. If you have any additional initial forms such as accented capitals, they can be added individually inside the brackets after the range.

Scriptor Abbatiſſæ's picture

Thanks gargoyle, that works very well -- and special thanks for the 'ranges' link.

Scriptor Abbatiſſæ's picture

Thanks gargoyle, that works very well -- and special thanks for the 'ranges' link.

twardoch's picture

Scriptor,

I don't quite follow what you mean by "salt" block or "calt" block.

OpenType Layout works in the way that you define some lookups, and assign it to some features. Then, the OpenType Layout engine either applies some features automatically, or only upon user's discretion, to the entire text run, or (for some specific features) only in a particular context determined by the engine.

For example, "init" is only applied to the first glyph in a word. "calt" is applied to the entire text run, and is typically on by default. "salt" is applied to the entire text run as well, but is off by default.

You can assign the same lookup to multiple features, and the OpenType spec doesn't restrict you from performing any types of lookups within any features. You can use contextual substitutions in "salt", or non-contextual substitutions in "calt". You can use contextual or non-contextual substitutions in "liga" or "smcp" or whatever. Sure, it's not a good idea to confuse the font user by making features do something that the user doesn't expect. So a "smcp" feature that would substitute lowercase glyphs with variants that have long ascenders would be confusing — but there is nothing in the world to stop you from doing that.

But you're most certainly are not restricted from using contextual lookups in the "salt" or "ss01" features — if that's what works well with your font.

Best,
Adam

twardoch's picture

Gargoyle,

The "ranges" functionality is useful, but not quite so useful. Sure, you can do [A-Z] and [A.init-Z.init], but in the real world, you'd naturally want to make "initial" versions of the glyphs for all uppercase glyphs (both basic English letters and the accented letters with diacritics). In that case, in order for the "ranges" to work, you need to make sure that the glyph order of the "normal" uppercase glyphs and the variants is identical in the font. Defining a normal class that just enumerates all the glyphs by their names is much safer, because you don't need to have the same glyph order in the font.

gargoyle's picture

From the spec:

For non-CID fonts, the ordering is independent of the ordering of glyphs in the font. <firstGlyph> and <lastGlyph> must be the same length and can differ...

I took this to mean that that the order of the glyphs was not an issue, that ranges were expanded by simple incrementation of either the alphabetic name or a numeric suffix. Does this differ in FontLab 5, or am I misinterpreting the spec?

twardoch's picture

Oh, yes, sorry, you're right. Anyhow, the syntax is rather useless if you (which is rather likely) want to include Aacute, Adieresis etc.

Scriptor Abbatiſſæ's picture

The regular capitals in the font include all the accented variants for most European languages, but the initial capitals are really only for the first glyph on the first line of a page, and coded as part of salt feature, so they only include the unaccented [A - Z] forms. They are the same height as the extra high ascenders which are also only for first line use, so I do not want to increase the height any more, nor do I see any real need to observe accents in decorative forms that function in a way similar to drop caps.

riccard0's picture

What if someone would like to start the first line of a page with a word which starts with an accented character? Or, maybe, with Å?

twardoch's picture

Scriptor,

the accented letters in European languages are no different from the unaccented ones. A German phrase can start with the word "Änderungen" as much as it can with "Angriff". A Polish phrase can start with "Ławnicy" as often as it can with "Lamperia".

Only including a subset of letters as initial capitals makes as much sense as if you'd include initial capitals for A-K but not for L-Z.

Best,
Adam

Scriptor Abbatiſſæ's picture

Arguably so, but considering that 99% of my intended use would be for either Latin or English, and that the ordinary size capitals (which are provided in virtually all accented flavours) look almost as good with the extra high ascenders as the extra large initial capitals, an [A - Z] limit on the latter is not really any problem.
I am thinking, though, that the extra large initial capitals might better be coded as a separate feature from the extra high ascenders.


The above poem is done in cut and paste kalligraphy, but uses exactly the same extra high ascenders that the salt feature is intended to call up in the font.

Syndicate content Syndicate content