Closed mathieureguer closed 1 year ago
Oups, uploaded an image with no justification issue. Fixed!
appendGlyph()
adds glyph by ids directly, no unicodes involved, so no text layout processing, no features... just that very specific glyph. see
you could roundtrip this by adding a " "
chars = ["A", "B", "C", "D"] * 30
fs = FormattedString()
fs.font("Georgia")
fs.fontSize(50)
for c in chars:
fs.appendGlyph(c)
fs += " "
textBox(fs, (100, 100, 320, 800
That's what I ended up doing. Works like a charm. Thanks!
I am not sure this is bug, maybe it is expected or desirable behaviour.
Using
appendGlyph("space")
on aFormattedString()
can lead to a visible word space at the start of a line in an aligned leftTextBox()
.On the left, with appendGlyph() the unexpected leading space. On the right, with append() the expected justification.
I assume this has something to do with
appendGlyph()
using a non breaking space abaseString
? Should it use a breakingbaseString
when the appended glyph is a breaking space? I guess this would required checking for a potential unicode for the appended glyph name / glyph index and creates a lot of additional work…I can work around this in my specific use case, so I am not sure this is worth fixing, if it is a bug at all :)