Assuming a typeface which defaults to proportional figures, do you think it’s sane and user-friendly to adjust more characters than just digits when fixed-width, tabular `tnum` numerals get activated? I’m thinking about making currency and other symbols the same width as figures then, so they align properly.
feature tnum {
@digits = [zero one two three four five six seven eight nine];
@digits.pnum = @digits;
@digits.tnum = [zero.tnum one.tnum two.tnum three.tnum four.tnum five.tnum six.tnum seven.tnum eight.tnum nine.tnum];
sub @digits.pnum by @digits.tnum;
lookup units {
@currencysymbols = [dollar cent sterling currency yen Euro]
@unitsymbols = [percent @currencysymbols]
@currencysymbols.tnum = [dollar.tnum cent.tnum sterling.tnum currency.tnum yen.tnum Euro.tnum]
@unitsymbols.tnum = [percent.tnum @currencysymbols.tnum]
sub @digits @unitsymbols' by @unitsymbols.tnum;
sub @digits @spaces @unitsymbols' by @unitsymbols.tnum;
sub @unitsymbols' @digits by @unitsymbols.tnum;
sub @unitsymbols' @spaces @digits by @unitsymbols.tnum;
} units;
} tnum;I also have written code to deal with rather simple SI unit symbols including prefixes.
In general I always try to make currency characters the same width as tnum figures if the design allows it. There are some that can not be done that way without distortion of their traditional appearance. The ones you show in your code usually will work well with the exception of the percent character.
Percent does not need such treatment because it doesn't usually need to align with any character other than another percent in tabular typesetting. I would not force it into a width it doesn't look good in.