Recommendations for monospaced .numr/.dnom .sups/.subs and fractions?

For a monospaced font, what are recommended ways to create fractions?

What I was originally planning:

  1. Glyphs for zero.numr through nine.numr, visually centered and spaced, appropriately. Same for .dnom glyphs.
  2. Glyphs for zero.sups through nine.sups made from components of zero.numr through nine.numr. Same for .subs and .dnom, perhaps. Similar for .sinf, adjusting vertical positioning.
  3. Fraction glyph, appropriately angled and centered.
  4. Build fraction glyphs such as onequarter, fiveeighths, etc. from components, keeping within the monospaced width.
  5. Use OpenType frac feature to build additional fractions (with single digit for numeral and denominator) on the fly that aren’t prebuilt, when feature is enabled.

Since this is a monospaced font, all of the glyphs have the same width (600).

For building a glyph like fiveeighths, one way seems to be:

  1. create the five.numr, fraction, and eight.dnom glyphs,
  2. add glyph fiveeighths (which creates a glyph (1800 width) of those three components,
  3. disable automatic alignment for each component by right (control-) clicking on each component and selecting,
  4. then move the five.numr and eight.dnom to appropriate spots.

For the frac feature side, since the glyphs are mostly visually centered, I assume I’ll need to play with OpenType positioning.

If this weren’t a monospaced font, I’d probably consider adjusting side bearings on the fraction glyph, perhaps kern the fraction and .numr/.dnom glyphs.

What do others do or recommend? Thanks.

One idea: you can use the afrc feature for the precomposed fractions. This way you could keep them at 600 and perhaps design them as nut fractions.

Set up the dnom and numr figures as you said.

Then add classes for dnom and numr contain each.

Then add a kern feature containing this:
pos @numr’ fraction <-120 0 -600 0>;
pos fraction @dnom’ <-480 0 -600 0>;

You need to add at least one regular kerning pair. This is a bug that I will fix with the next update. And the manual kerning feature only works in the version 1.3.19.

Export your font and test the fractions. The preview in Glyphs will not work.

Thanks, Georg. I’ll look into that idea, too.

One possible bug I noticed: if one has both .subs and .sinf glyphs, automatic feature generation puts both in the sinf feature. If you have, for example, zero.subs and zero.sinf, then the feature won’t compile since there would be two substitution lines:

sub zero by zero.sinf;
sub zero by zero.subs;

in the same feature. For now, I just disable automatic generation for that feature and remove the extraneous .subs substitutions.

The reasoning for having both .subs and .sinf glyphs.
.subs sit on the baseline for shilling fractions.
.sinf are shifted further below for scientific use, etc.

fyi.

It would be lovely if Mekka or Georg or somebody who knows Python would automate this boring part of the process.

…or if the Make Component command would generate the fraction automatically once the fraction glyph is created.

It does that already, i.e. compose precomposed fractions from their dnom and numr parts. Does it not work for you?

.subs glyphs are supposed to go below the base line for things like H₂O. To build fractions you should use the .dnom and .numr as mekkablue suggested.

im confused, why are we adding a kerning feature to a monospaced font?

it all glyph are monospace, typed fractions would look awful wide. Then you do some positioning to make them look more compact.