@frederik Works beautifully, thank you!
chrisjansky
@chrisjansky
0
Reputation
3
Posts
1
Profile views
0
Followers
0
Following
Best posts made by chrisjansky
This user hasn't posted anything yet.
Latest posts made by chrisjansky
-
RE: Clip off text in textBox
Yes, that would be a workaround. Ideally I‘d like to show all fully visible glyphs and hide all remaining that don‘t fit within canvas bounds, like this:
I was just wondering if there‘s something like hyphenation() that switches from words to glyphs if you know what I mean.
-
Clip off text in textBox
Hello,
Started playing around in Drawbot and loving it so far. I am wondering – is there a way to clip off text inside a textBox on a glyph-by-glyph basis?
I understand dictionary-based hyphenation takes priority, so that‘s what happens:
What I am after is more like:
AaBbCc 2
AaBbCc 22
AaBbCc 225
AaBbCc 225p
AaBbCc 225ptAnd not:
AaBbCc
AaBbCc
AaBbCc 225
AaBbCc 225ptMy code so far:
newPage(1500,1500) lh = 10 factor = 1 for i in range(17): fs = 1 * (i + 1) * factor fontSize(fs) lineHeight(fs * 0.8) textBox(f"AaBbCc {round(fs)} pt", (10, lh, width(), fs)) lh += fontLineHeight() + 7 factor += 1
Hopefully makes sense :—) Thanks for any pointers!