Skip to main content
Inspiring
October 6, 2002
Question

FEATURE FILE SAMPLE: Arbitrary Fraction support (4 Dec 2002)

  • October 6, 2002
  • 1 reply
  • 982 views
Here's how we've made arbitrary fractions work at Adobe.

[note: updated 4 Dec 2002]

feature frac {

lookup FRAC {
sub [zero zerooldstyle zero.taboldstyle zerosuperior zero.inferior zero.denominator zero.titling] by zero.numerator;
sub [one onefitted oneoldstyle one.taboldstyle onesuperior one.inferior one.denominator one.titling] by one.numerator;
sub [two twooldstyle two.taboldstyle twosuperior two.inferior two.denominator two.titling] by two.numerator;
sub [three threeoldstyle three.taboldstyle threesuperior three.inferior three.denominator three.titling] by three.numerator;
sub [four fouroldstyle four.taboldstyle foursuperior four.inferior four.denominator four.titling] by four.numerator;
sub [five fiveoldstyle five.taboldstyle fivesuperior five.inferior five.denominator five.titling] by five.numerator;
sub [six sixoldstyle six.taboldstyle sixsuperior six.inferior six.denominator six.titling] by six.numerator;
sub [seven sevenoldstyle seven.taboldstyle sevensuperior seven.inferior seven.denominator seven.titling] by seven.numerator;
sub [eight eightoldstyle eight.taboldstyle eightsuperior eight.inferior eight.denominator eight.titling] by eight.numerator;
sub [nine nineoldstyle nine.taboldstyle ninesuperior nine.inferior nine.denominator nine.titling] by nine.numerator;
} FRAC;

sub zero.numerator' @10523040' zero.numerator' zero.numerator' by perthousand;
sub zero.numerator' @10523040' zero.numerator' by percent;
sub one.numerator' @10523040' four.numerator' by onequarter;
sub one.numerator' @10523040' two.numerator' by onehalf;
sub three.numerator' @10523040' four.numerator' by threequarters;
sub one.numerator' @10523040' three.numerator' by onethird;
sub two.numerator' @10523040' three.numerator' by twothirds;
sub one.numerator' @10523040' eight.numerator' by oneeighth;
sub three.numerator' @10523040' eight.numerator' by threeeighths;
sub five.numerator' @10523040' eight.numerator' by fiveeighths;
sub seven.numerator' @10523040' eight.numerator' by seveneighths;

sub [@SLASH @11320540_DENOMINATOR @13931658] @11320540_NUMERATOR' by @11320540_DENOMINATOR;
sub [slash uni2215] by fraction;

} frac;

I hope this is helpful!

T

Thomas W. Phinney
Program Mgr., Western Language Fonts
Adobe Systems
This topic has been closed for replies.

1 reply

Participating Frequently
November 4, 2005
Very helpful!
Thanks Thomas

ChrisL