florianpircher/GutenTag

Don’t use space characters to make space for disclosure chevron

florianpircher opened this issue · 2 comments

Don’t use space characters to make space for disclosure chevron

Currently, three spaces are used to to create padding for the disclosure chevron. This feels wrong. Hopefully there is a better solution.

def tokenField_displayStringForRepresentedObject_(self, tokenField, tag):
# the trailing spaces make space for the menu disclose button
# \u200C prevents whitespace trimming
# \u2068 and \u2069 embed the tag name such that the spaces are always to the right of the tag name (needed if the tag name displays as right-to-left text)
return '\u2068' + tag + '\u2069 \u200C'

The space collapse is caused by Glyphs internal customizations. See: https://forum.glyphsapp.com/t/does-glyphs-3-modify-the-internals-of-nstokenfield/17877/2