Typophile

OpenType problem

Pieter van Rosmalen

Hello. I just started designing OpenType typefaces and have a problem with the fractions.
Can anyone tell me if something is wrong with this:

feature frac { # Fractions
sub [one one.onum] [slash fraction] [two two.onum] by onehalf;
} frac;

Thanks!
Pieter

this is the top of a font I did. The brackets you have seem odd. The names aren’t standard are they the glyph names? and I’ve encluded the perthousand and percent to show if you have similar glyphs like a 1/10 and 1/100 you need to order longest first or it won’t work.

What is your behaviour?

What are the names of the base glyphs?

=================================

feature frac { # Fractions
# Latin
sub zero slash zero zero by perthousand;
sub zero slash zero by percent;
sub one slash two by onehalf;
} frac;

Thanks for the information, but it’s still not working.
I entred the lines exactly as you did.
The glyphs have the same names as yours.
Pieter

Pieter, here’s what I would do...

Create classes for your numerals like this:

@class_0 = [zero zero.OP];
@class_1 = [one one.OP];
@class_2 = [two two.OP];
@class_3 = [three three.OP];
@class_4 = [four four.OP];
@class_5 = [five five.OP];
@class_6 = [six six.OP];
@class_7 = [seven seven.OP];
@class_8 = [eight eight.OP];
@class_9 = [nine nine.OP];

Arse... My post got bust up...

Also add a class for the slashes:

@class_slash = [slash fraction];

Then your frac will look like this, (also incorporating the perthousand and percent subs Mr Connare suggested):

feature frac { # Fractions
# Latin
sub @class_0 @class_slash @class_0 @class_0 by perthousand;
sub @class_0 @class_slash @class_0 by percent;
sub @class_1 @class_slash @class_4 by onequarter;
sub @class_1 @class_slash @class_2 by onehalf;
sub @class_3 @class_slash @class_4 by threequarters;
} frac;

also in the OT output you have to type ’1’ ’//’ ’2’ not just one slash but two.

that’s two slashes for ’/’

Or better yet: /one/slash/two

It’s working now! I only typed 1/2 instead of 1//2...
Thanks!
Also thanks for the ’class’ suggestion.
Pieter

Captured from web.archive.org on 29 Oct 2008. view this capture