Wondering if it's possible to organize a font to have features such as combining characters.
Basically, I'm wondering if you can design a font in a modular way so that it can have these features:
- superscripts/subscripts
- diacritical marks
- composable shapes
So for example, say I have a vertical line character like |
, and I want a double vertical line character not just by using two |
, e.g. ||
. I would like this: ‖
. So I would have in the font a single line character |
, and then ~somehow~ would combine two of them together when writing so that I get the ‖
character. This would mean reusing font assets/symbols/shapes/glyphs.
A more complex example would be like combining ‖
and the accent mark ´
: ‖́
. So now we have two |
and and one ´
combined into a single "character".
This would make it so you don't have to predefine every combination of glyph/symbol, which could be a lot. Say for example, I have a-z
, and 10 diacritical marks for the top, and 10 possible for the bottom. That is 10² or 100 combinations of diacritical marks for each character. So instead of 26 + 10 + 10 = 46 glyphs, the font would have 26 * 100 = 2,600 glyphs, a big difference. Add on top of that the ability to support super and subscripts, and that could easily be 2,600 * 3 = 7,800 glyphs, vs. 46. I would also like to support nested superscripts. But maybe sub/superscripts should be saved for a separate question b/c it might be unrelated and/or complicated.
Then there is the question of how the keyboard is mapped to all of these combinations, which I am not familiar with.
So my question is, if it is possible to organize a font to have these features of combining characters into "complex glyphs", from "primitive glyphs". And if so, how to map it to the keyboard, since 2,600 possible combinations is a lot more than the number of keys on the keyboard, you would probably have some sort of "key codes" or "key combinations" to enter to get a character, not sure about that.