schriftgestalt/DrawBotGlyphsPlugin

Error with tracking in Glyph 2

HugoJourdan opened this issue · 3 comments

The text properties to change tracking work with Glyph3 but not with Glyph2. (Glyph 2.6.7)

script :

size(1000, 350)
tracking(100)
fontSize(100)
text("hello", (100, 200))

Error message :

Traceback (most recent call last):
  File "<untitled>", line 7, in <module>
  File "/Users/hugojourdan/Library/Application Support/Glyphs/Plugins/DrawBot.glyphsPlugin/Contents/Resources/drawBot/drawBotDrawingTools.py", line 1590, in text
    attrString = self._dummyContext.attributedString(txt, align=align)
  File "/Users/hugojourdan/Library/Application Support/Glyphs/Plugins/DrawBot.glyphsPlugin/Contents/Resources/drawBot/context/baseContext.py", line 2449, in attributedString
    self._state.text.append(txt, align=align)
  File "/Users/hugojourdan/Library/Application Support/Glyphs/Plugins/DrawBot.glyphsPlugin/Contents/Resources/drawBot/context/baseContext.py", line 1340, in append
    attributes[CoreText.kCTTrackingAttributeName] = self._tracking
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/objc/_lazyimport.py", line 143, in __getattr__
    raise AttributeError(name)
AttributeError: kCTTrackingAttributeName

Fixed it.

There is also a problem with "Formatted Stings" with DrawBot in Glyph 2.

code :

textBox(
    FormattedString(
        txt='Test', 
        fontSize=50, 
        tracking=100, 
        font='Helvetica'
    ), 
    (10, 300, 400, 400)
)

Error message :

Traceback (most recent call last):
  File "<untitled>", line 6, in <module>
  File "/Users/hugojourdan/Library/Application Support/Glyphs/Repositories/DrawBot/DrawBot.glyphsPlugin/Contents/Resources/drawBot/drawBotDrawingTools.py", line 1837, in FormattedString
    return self._formattedStringClass(*args, **kwargs)
  File "/Users/hugojourdan/Library/Application Support/Glyphs/Repositories/DrawBot/DrawBot.glyphsPlugin/Contents/Resources/drawBot/context/baseContext.py", line 1102, in __init__
    self.append(txt, **attributes)
  File "/Users/hugojourdan/Library/Application Support/Glyphs/Repositories/DrawBot/DrawBot.glyphsPlugin/Contents/Resources/drawBot/context/baseContext.py", line 1203, in append
    raise TypeError("expected 'unicode' or 'FormattedString', got '%s'" % type(txt).__name__)
TypeError: expected 'unicode' or 'FormattedString', got 'str'

You have to put an u before 'Test' like this: txt=u'Test'