Opentype Ranges Question

robarnow's picture

Hi, I'm dropping some substitution features into a new font, and I'm wondering about how to code OpenType ranges.

For example: [a-z] will cover your basic alphabet, but won't cover accented characters.

Is there a way to write out a range that includes, for example, all lowercase characters?

Is there any documentation on this, or basic principles involved?

Obviously, I can do write out every character manually, but would rather do it efficiently if possib.e

Rob

Theunis de Jong's picture

Uppercase vs. lowercase is a somewhat fluid concept -- best illustrated by the long-ongoing discussion on where to put the eszet, and now it officially (or semi-officially) has an uppercase form, what to do with existing fonts, or indeed, with new fonts, and with new fonts in old software (and presumably also the other way around).

The Unicode consortium lists per code point what they consider "lowercase" and "uppercase" (for an introduction, read their view on Case Mapping). You can safely refer to the Unicode lists to decide which characters are uppercase or lowercase.

For example:
U+2C60 LATIN CAPITAL LETTER L WITH DOUBLE BAR
U+2C61 LATIN SMALL LETTER L WITH DOUBLE BAR

(etc.) Once you have decided which characters to put into your font, define named glyph classes:

@mylowercase = [ a b c ... x y z uni2C61 ];

It sounds like a lot of work, but of course you only have to do this once. If you ever add an uppercase of lowercase glyph later on, you only have to add it to the right glyph class.

Syndicate content Syndicate content