You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Drawing multiline text currently draws a single vertical line of overlapping characters. I'm not sure how/if this can be fixed within the existing API since it is not clear whether ttb lines should advance to the left or the right.
Ideographic languages (e.g. Japanese, Korean, Chinese) are more flexible in their writing direction. They are generally written left-to-right, or vertically top-to-bottom (with the vertical lines proceeding from right to left).
Advancing lines to the left would be fine for languages that actually use ttb, but not for e.g. English text written in ttb mode. For example, the Bungee font is designed with English ttb in mind, and that would most likely advance to the right.
How's this proposal: The spacing=4 parameter is currently used to add an additional offset to the line-height automatically chosen by Pillow (height of the letter A). In ttb mode, it could be reused to specify the exact distance between lines horizontally, so 20 would place lines at 20px intervals advancing to the right and -10 would place lines at 10px intervals advancing to the left. The default value doesn't make sense here, but ttb fonts might not have a glyph for the letter A anyway.
If You mean Top To Bottom it could be easily done by setting spacing variable as @nulano said, and getting textwrap.wrap with it to work, but in your case I see it can be splitted by newlines.
No offence, but I strongly advise You to write fonts on new transparent Image instances, since it's easier to manipulate them later.
I am wondering how it is implemented in Raqm, what their values are in terms of layout. Two different things seem to be mixed up together, text direction and text progression.
ttb tells you the direction of the text run, but doesn't tell you the progression of lines of text.
For instance, Han ideographs when written vertically (Chinese, Japanese, Korean (in Hanja), Vietnamese in Chữ Nôm) is written in lines from top of text area to bottom, with lines of text progressing to the left.
Mongolian script on the other hand is written top to bottom as well, but lines of text progress to the right instead of the left, so as Mongolian progression is the opposite to Han ideographs, any rendering system needs to be able to support vertical text progression in either direction.
I suspected that was the case, although I guess it's a moot point at the moment, since I can't get a single vertical line to correctly render, let alone multiple lines. I suspect that the writing system (script) I am working with isn't supported in raqm yet.
Activity
radarhere commentedon Oct 24, 2020
https://www.w3.org/International/questions/qa-scripts#:~:text=Ideographic%20languages%20(e.g.%20Japanese%2C%20Korean,occasionally%20written%20right%20to%20left.
Should ttb lines then advance to the left?
nulano commentedon Dec 11, 2020
Advancing lines to the left would be fine for languages that actually use ttb, but not for e.g. English text written in ttb mode. For example, the Bungee font is designed with English ttb in mind, and that would most likely advance to the right.
How's this proposal: The
spacing=4parameter is currently used to add an additional offset to the line-height automatically chosen by Pillow (height of the letter A). In ttb mode, it could be reused to specify the exact distance between lines horizontally, so 20 would place lines at 20px intervals advancing to the right and -10 would place lines at 10px intervals advancing to the left. The default value doesn't make sense here, but ttb fonts might not have a glyph for the letter A anyway.kubinka0505 commentedon Dec 17, 2020
If You mean
TopToBottom it could be easily done by settingspacingvariable as @nulano said, and gettingtextwrap.wrapwith it to work, but in your case I see it can be splitted by newlines.No offence, but I strongly advise You to write fonts on new transparent
Imageinstances, since it's easier to manipulate them later.andjc commentedon Jun 29, 2022
@radarhere asked:
I am wondering how it is implemented in Raqm, what their values are in terms of layout. Two different things seem to be mixed up together, text direction and text progression.
ttb tells you the direction of the text run, but doesn't tell you the progression of lines of text.
For instance, Han ideographs when written vertically (Chinese, Japanese, Korean (in Hanja), Vietnamese in Chữ Nôm) is written in lines from top of text area to bottom, with lines of text progressing to the left.
Mongolian script on the other hand is written top to bottom as well, but lines of text progress to the right instead of the left, so as Mongolian progression is the opposite to Han ideographs, any rendering system needs to be able to support vertical text progression in either direction.
nulano commentedon Jun 29, 2022
Raqm does not yet support line-breaking, but instead treats the whole input as a single line of text: HOST-Oman/libraqm#50
andjc commentedon Jul 1, 2022
Thanks @nulano,
I suspected that was the case, although I guess it's a moot point at the moment, since I can't get a single vertical line to correctly render, let alone multiple lines. I suspect that the writing system (script) I am working with isn't supported in raqm yet.
[-]Multiline ttb text doesn't work[/-][+]Multiline ttb text is not supported[/+]radarhere commentedon Jun 12, 2025
I've created #8730 to resolve this.
would generate
