…
Hi Guys,
I've looked over the great posts that are here for this and I think I've settled on the code below, which I grabbed from the Adobe Caslon Pro font. It's nice and compact and should suit out needs just right.
It all seems to be working fine but I'm not completely clear as to how the single quote works and I don't want to end up in a "A little knowedge is a dangerous thing" situation. An Adobe page states that the single quote "Marks a glyph or glyph class for contextual substitution or positioning" but I'm still lost.
Thanks for any help you can offer my feeble mind.
All Best,
Ken
@frac1regfigs=zero one two three four five six seven eight nine
@frac2numr=zero.numr one.numr two.numr three.numr four.numr five.numr six.numr seven.numr eight.numr nine.numr
@frac3dnom=zero.dnom one.dnom two.dnom three.dnom four.dnom five.dnom six.dnom seven.dnom eight.dnom nine.dnom
@frac4fracsdnom=perthousand slash percent onehalf onethird onequarter twothirds threequarters threeeighths seveneighths one.dnom two.dnom three.dnom four.dnom five.dnom six.dnom seven.dnom eight.dnom nine.dnom
feature frac {
lookup frac01 {
#all to numerators
sub @frac1regfigs by @frac2numr;
} frac01;
lookup frac02 {
#change numerators to denominators contextually
sub zero.numr' @SLASH' zero.numr' zero.numr' by perthousand;
sub zero.numr' @SLASH' zero.numr' by percent;
sub one.numr' slash' two.numr' by onehalf;
sub one.numr' slash' three.numr' by onethird;
sub one.numr' slash' four.numr' by onequarter;
sub two.numr' slash' three.numr' by twothirds;
sub three.numr' slash' four.numr' by threequarters;
sub three.numr' slash' eight.numr' by threeeighths;
sub seven.numr' slash' eight.numr' by seveneighths;
sub @frac4fracsdnom @frac2numr' by @frac3dnom;
} frac02;
lookup frac03 {
#change the slash
sub slash by fraction;
} frac03;
} frac;