SOLVED Recreate native Glyph inspector panel sidebearing EditText input
-
I'd like to make a sidebearing input essentially like the native RF Glyph inspector panel’s sidebearing input.
Goals:
- accepts integers and letters
- arrow keys + shift + cmd change integers
- continuous
True
with arrows + numbers, butFalse
with letter input.
Normal
EditText
doesn’t offer the benefits of the arrow key interaction by default. I've triedNumberEditText
but it won't allow letters nor will my continuous argument work.Thanks!
-
That is True! for now the inspector is made for inspecting single glyphs. An extension can add a inspector pan with this behaviour!
-
Regarding the RF inspector, I think it would be handy if mutltiple glyphs were selected, and user enters a side-bearing value, then it would affect all the selected glyphs. ( ͡° ͜ʖ ͡°)
-
Thanks!! I should have asked much sooner for Sidebear, haha.
-
import vanilla from lib.UI.glyphMetricsEditText import GlyphMetricsEditText from lib.tools.glyphMetricsMath import glyphMetricsMath def callback(sender): # provide a glyph object, an attribute of that glyph and a text value = glyphMetricsMath(CurrentGlyph(), "width", sender.get()) print(value) w = vanilla.Window((150, 40)) w.edit = GlyphMetricsEditText((10, 10, -10, 22), callback=callback, continuous=False) w.open()
-
hello @ryan,
the Inspector uses
GlyphMetricsEditText
, which currently lives inlib.UI
:from lib.UI.glyphMetricsEditText import GlyphMetricsEditText
give it a try… cheers!