DrawBotGlyphsPlugin
DrawBotGlyphsPlugin copied to clipboard
Problem with FormattedString and tracking
There is a bug with FormattedString when I try to add tracking. This bug happens only when I use the drawBot module in Glyph. With the DrawBot app everything works well.
I'm using with open() and .read to access different text files. This is a part of my code :
import drawBot as d
import os
dir_path = "/Users/hugojourdan/Desktop/Typo/Specimen Drawbot Script"
with open("/Users/hugojourdan/Desktop/Typo/Specimen Drawbot Script", "r", encoding='utf8') as Text_sample1:
Text_sample1 = Text_sample1.read()
l, h, ml, mh = 842, 595, 20, 26
d.newPage(l,h)
t = d.FormattedString()
t.append(Text_sample1, font="Helvetica", fontSize=15, tracking=-5)
Box2 = d.textBox(t, (ml, mh-10, 500, h-2*mh), align="left")
With this code, if I change the tracking value, it doesn't change tracking but the width of my textBox. If I replace the variable that contains my text (here Text_sample1), directly by text (like "hello") its work. If I create a variable with my text inside ( mytext = "hello"), it's works too.
I feel that something is going wrong by using .read inside textBox
@schriftgestalt Any suggestion?
The drawbot code probably needs to be updated. But I don't have time for it right now.