Tabular punctuation in the font with both Lining and Oldstyle Figures

Michael Rafailyk
Michael Rafailyk Posts: 143
edited August 2023 in Technique and Theory

I want to add a space, period, and comma (maybe something else usefull for the tables?) to the Tabular Figures feature, but the font contains both Lining and Oldstyle Figures, so it's become more complicated and I'm stuck a bit in the dependencies.


@lf = [zero one two three four five six seven eight nine];
@osf = [zero.osf one.osf two.osf three.osf four.osf five.osf six.osf seven.osf eight.osf nine.osf];
@tf = [];
@tosf = [zero.tosf one.tosf two.tosf three.tosf four.tosf five.tosf six.tosf seven.tosf eight.tosf nine.tosf];

@lfPunct = [space period comma]; # original
@osfPunct = [space.osf period.osf comma.osf]; # identical to original
@tfPunct = []; # by Lining Tabular width
@tosfPunct = [space.tosf period.tosf comma.tosf]; # by Oldstyle Tabular width


sub @osf by @lf
sub @osfPunct by @lfPunct
sub @lf by @osf
sub @lfPunct by @osfPunct
sub @tf by @lf
sub @tfPunct by @lfPunct
sub @tosf by @osf
sub @tosfPunct by @osfPunct
sub @lf by @tf
sub @lfPunct by @tfPunct
sub @osf by @tosf
sub @osfPunct by @tosfPunct

Here, Tabular and Proportional lookups are dependent from what has been substituted before it – in the Lining and Oldstyle. So it's a chain where the first step is a substitution of space by space.osf in the Oldstyle lookup, and the next step is a substituton of space.osf by space.tosf in the Tabular lookup.

The problem

Lining Tabular figures have different advance width (in my case) than Oldstyle Tabular figures, so I need to have different and space.tosf. That mean, I also need to have different space and space.osf. It's 4 different versions of the space glyph (and for period and comma too) where space and space.osf are identical (the same width) just with the different names.

I'm wondering if this intermediate duplicate (space.osf) can be avoided. I know it's possible to apply a few unicodes to one glyph, but not the a few names, so it should be different separated glyphs. Is that right?


  • John Hudson
    John Hudson Posts: 3,054
    edited August 2023
    /space is default (proportional)

    So order your tnum lookup before your onum lookup and in tnum have
    sub space by

    then in your onum lookup have
    sub space by space.osf
    sub by space.tosf


  • Michael Rafailyk
    Michael Rafailyk Posts: 143
    edited August 2023
    I understood, to order tnum/pnum first, and then onum/lnum. Interesting.
    My case is just reversed (onum/lnum first and then tnum/pnum) and it looks like this:

    sub space by space.osf

    sub space by
    sub space.osf by space.tosf

    That is, the number of steps is the same. So, in any case, there should be 4 (not 3) versions of space. O'k, looks like it's normal practice.

    Thanks John.
  • Nick Shinn
    Nick Shinn Posts: 2,168
    Why not make both oldstyle and lining tab figures with the same width?

    Imagine that a typographer has prepared a complex table with oldstyle figures and the client says “Nah, change the figures to lining”.

    (And while you’re at it, make sure that different weights of tab figures have the same width too.)
  • Michael Rafailyk
    Michael Rafailyk Posts: 143
    edited August 2023
    Nick, that make a sense. I didn't even thinked about it.

    I think it's possible to leave both proportional figures as they are, and just find a certain common advance width for Tabular Linings and Tabular Oldstyle figures only.

    And it also simplifies the logic, to only two versions of punctuation instead of four.

    Thanks for your thoughts.