Thin spaces
quasicomputational opened this issue · 7 comments
Thin spaces (U+2009 THIN SPACE and U+202F NARROW NO-BREAK SPACE) are pretty nice as a way to separate digit groups, but they're not currently present in Source Serif Pro. Could they be added, please?
Since support for it is so bad, I doubt anyone actually uses it, but U+202F NARROW NO-BREAK SPACE has a potential use for punctuation spacing in French. See HTML authoring in French.
Since support for it is so bad, I doubt anyone actually uses it, but U+202F NARROW NO-BREAK SPACE has a potential use for punctuation spacing in French. See HTML authoring in French.
I can confirm that I use this character whenever possible, both for French punctuation and for spacing before unit symbols:
La vitesse à 30 km/h sur plus de 80 % du réseau nantais a un double objectif d’après la maire de Nantes Johanna Rolland : « Renforcer la sécurité des piétons comme des cyclistes, mais aussi de réduire les nuisances sonores pour une meilleure qualité de vie. »
Hoping that’s a reasonable assumption:
I am thinking of making the THIN SPACE and NARROW NO-BREAK SPACE the same width – corresponding to the calculations here: https://helpx.adobe.com/indesign/user-guide.html/indesign/using/glyphs-special-characters.ug.html (⅛ em).
I had the impression that they were usually about 1/6 em, but weren't necessarily constant (e.g., could be stretched for justification). I have found 1/9 em to be too narrow for digit group separation (mhchem/MathJax-mhchem#18 has some pictures), and I think 1/8 em would possibly also be too narrow. Is it possible that that document's using a slightly different definition of 'thin space'?
I would like to keep the impact on users of InDesign low, that’s why I will likely follow the factors on that help page.
I have reconstructed the exact distances in a test file:
It turns out that InDesign actually uses the width of the normal space character for U+202F NARROW NO-BREAK SPACE, which is probably not the original intent of “NARROW”:
I decided to deviate from InDesign’s calculation for that one space, and make it equal to U+2009 THIN SPACE.
What’s “too narrow” is of course a matter of personal preference, but I think the thin space works as a number separator:
for posterity – here are the factors used:
def make_space(name, unicodes, factor):
g = f.newGlyph(name, clear=True)
g.width = int(round(1000 * factor))
g.unicodes = unicodes
spaces = [
# name, unicodes, factor
('enspace', [0x2002], 1 / 2),
('emspace', [0x2003], 1),
('threeperemspace', [0x2004], 1 / 3),
('fourperemspace', [0x2005], 1 / 4),
('sixperemspace', [0x2006], 1 / 6),
# ('figurespace', [0x2007], None) # = zero
# ('punctuationspace', [0x2008], None) # = semicolon
# ('narrownbspace': [0x202F], None), # Indesign assumes = space, which is odd
('thinspace', [0x2009, 0x202F], 1 / 8),
('hairspace', [0x200A], 1 / 24),
('zerowidthspace', [0x200B], 0),
]
# write lines for GOADB
for friendly_name, unicodes, _ in spaces:
if len(unicodes) > 1:
final_name = friendly_name
override = ','.join([f'uni{uc:04X}' for uc in unicodes])
line = '\t'.join([final_name, friendly_name, override])
else:
final_name = f'uni{unicodes[0]:04X}'
line = '\t'.join([final_name, friendly_name])
print(line)
a = AllFonts()
for f in a:
for gname, unicodes, factor in spaces:
make_space(gname, unicodes, factor)
f.save()
f.close()
Various spaces are part of Source Serif 4.004: https://github.com/adobe-fonts/source-serif/releases/tag/4.004R