5

We have designed an interface with the Montserrat font, but for many numeric displays (think of a calculator display), the fact that the digits don't have the same letter width and don't align vertically is a problem:

enter image description here

I have thought about using another font (e.g. monospace) specifically for digits, but the result is not optimal, because it does not match with the rest of the interface.

Question: what's the simplest way to edit the OpenSans-VariableFont_wdth,wght.ttf file, set all digit glyphs (0, 1, ..., 9) to the same width, and save into a new TTF output file?

If possible, would it be possible with a command-line tool and no GUI editor? so that we can do this automatically via a script in our build operations.

2
  • You're right @Luciano, but now everything has been designed with that font, which is very good for the rest of the project, so it's not possible to change it ;) I was curious if modifying the font digit glyphs can be easily done ;)
    – Basj
    Commented Jun 25 at 14:08
  • sorry, i deleted my previous comment once I saw it was possible to just change font settings externally :)
    – Luciano
    Commented Jun 25 at 14:53

1 Answer 1

10

Montserrat has a tabular lining (monospaced numerals) option in its OpenType preferences. How to access these properties will depend on what platform / software you're using the font.

Since it looks like you're using it in a web project you could just set it with the font-variant-numeric CSS property:

font-variant-numeric: tabular-nums;

3
  • 2
    You litterally saved me 10 more hours of unsuccessful attempts. Thanks a lot! You can also add this answer here, I'll also accept it.
    – Basj
    Commented Jun 25 at 14:17
  • 1
    Must feel good to give such a simple yet extremely useful answer!
    – Wolff
    Commented Jun 25 at 16:46
  • 1
    @Wolff it actually feels nice :)
    – Luciano
    Commented Jun 26 at 9:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.