I wonder, could OpenType automatically convert regular numerals to spelled-out Danish numerals without a crazy number of ligatures? Can OT do one-to-many and many-to-many?
More on the Danish counting system: http://www.olestig.dk/dansk/numbers.html
I wonder, could OpenType automatically convert regular numerals to spelled-out Danish numerals without a crazy number of ligatures? Can OT do one-to-many and many-to-many?
More on the Danish counting system: http://www.olestig.dk/dansk/numbers.html
OT does one-to-many (type 2 GSUB lookup) easily enough. In theory, it can be made to do many-to-many, but in fact this is nowhere supported in either tools or apps. So you'd probably have to do some clever contextual one-to-many substitutions. In other words, you would have to analyse the decimal positions in the number, and substitute the appropriate word for the letters in each position. So, for an English example you might have a number '625', and you would need context to isolate the initial numeral and capture that it is in the hundreds position (followed by two integers), then substitute
six -> s i x space h u n d r e d space a n d
then you would capture the 2 in the tens position:
two -> t w e n t y hyphen
and finally the five in the ones position:
five -> f i v e
The biggest risk in this kind of approach is failure of context, which means you need to carefully think through all the permutations of situations in which a number might occur. I think the feature would need to be like the 'frac' feature, i.e. explicitly applied by a user to a selected string of characters, and not the sort of feature one could safely turn on for an entire document.
There is a problem with the zero in any language -- in English, 70 is not "seventy-zero," and I'd bet in Danish, it's not "zero and seventy."
That aside, with some work, you could probably get the font to do the job, even in Danish. But if you're working on a document, it might be better to do search & replaces. If you do the work in the font, what's in the underlying document (say, the XML exported from an InDesign file...)?
Reordering glyphs using GSUB is a bit tricky. I do it sometimes in order to be able to ligate reordered characters in Indic fonts, but I'm never entirely comfortable doing so. You have to do it in two steps: contextually insert the new glyph where you want it, and then contextually delete the old glyph from the unwanted location. Since there are no insert/delete GSUB lookup types per se, what you need to do is first use a one-to-many lookup, and then a many-to-one lookups. So, for example, let's say I want to reorder the glyphs in the sequence ABC so that they are BAC, I would first have a lookup (VOLT syntax; sorry the Adobe stuff makes no sense to me).
A -> B A
|C
which would result in BABC; then a second lookup something like
A B -> A
B|
resulting in BAC.
Wait, didn’t I post a comment here about how Danish cheques are formatted in the Swedish style of cardinal numbers? Or was that on twitter? I can find it neither place, so let me put it up here again for posterity’s sake: On Danish cheques, when writing out the cardinal, eg. kr. 768,32 you would write syvhundredesekstiottekronerogtretitoøre (like in Swedish common use), and not syvhundredeottetredskronerogtoogtrediveøre (like in Danish common use).
Captured from web.archive.org on 10 Aug 2014. view this capture