Recognize unicodes as well as glyph names in the glyph name field
Opened this issue · 7 comments
Traceback (most recent call last):
File "/Applications/RoboFont-4_4b2.app/Contents/Resources/lib/python3.9/vanilla/vanillaEditText.py", line 11, in controlTextDidChange_
File "/Applications/RoboFont-4_4b2.app/Contents/Resources/lib/python3.9/vanilla/vanillaBase.py", line 520, in action_
File "/Applications/RoboFont-4_4b2.app/Contents/Resources/lib/python3.9/ezui/items/textField.py", line 463, in _internalCallback
File "main.py", line 342, in glyphNamesTextBoxCallback
File "lib/fontObjects/fontPartsWrappers.pyc", line 1866, in __getitem__
KeyError: "No glyph named '1'."
Maybe this was from a v1 copy
at the moment the glyph name field only accepts glyph names, so if you want the one glyph you need to type one
instead of 1
... an enhancement would be to recognize unicodes as well as glyph names, perhaps
Related: Tal wrote some code a while ago that acts as an auto-complete for glyph names. I use it for throwing a current foreground glyph into the background:
https://gist.github.com/ryanbugden/a7b946f786dce9cfd92853cdc827aeb1#file-throw_glyph_bg-py-L148
cc @typesupply
Would you want this behavior built into ezui? I have wanted this...
Would you want this behavior built into ezui? I have wanted this...
@typesupply That would be sick! Would it be like a descriptionData entry for TextField
called something like autoCompleteData
and take a list?
@typesupply it would be very cool to have that in ezui!
I've opened an issue over at ezui. I'll try to get to this after I finish drawing this 6 that refuses to be drawn. It should be pretty easy to implement. I'll probably use the name autoCompleteValues
or something like that and allow a list of values [A, Aacute, ...]
or a dict of display values to matched values {A:A, Aacute: Aacute, Á:Aacute, 0x00C1:Aacute, ...}
so we can have more complex matching when desired.