Repository navigation
Description
Run this code -
`
#set page(width: 5in)
#set par(justify: true)
#lorem(100)
לאחר שנאספו כל ההחלטות שהיו פזורות בכרכי זיכרונות האקדמיה, נפרסה התמונה הכוללת ונחשפו בעיות מסוגים שונים: אי־אחידות בניסוח, כללים ופרטים חסרים, חוסר התאמה למציאות הלשונית, סתירות פנימיות ועוד. עלה אפוא צורך לשקול מחדש החלטות רבות, לשנותן, לתקנן, להשלימן או לעדכנן. ועדת הדקדוק[4] ישבה על מדוכה זו ברבות מישיבותיה בשנים תשנ"ד–תשס"ה ופעלה נמרצות לשיפור הכללים, להשלמתם ולעדכונם. נוסף על כך העמידה הוועדה כללים חדשים רבים – בהם פרקים בנטיית הפועל.
#show " ": sym.space.quad
#lorem(100)
לאחר שנאספו כל ההחלטות שהיו פזורות בכרכי זיכרונות האקדמיה, נפרסה התמונה הכוללת ונחשפו בעיות מסוגים שונים: אי־אחידות בניסוח, כללים ופרטים חסרים, חוסר התאמה למציאות הלשונית, סתירות פנימיות ועוד. עלה אפוא צורך לשקול מחדש החלטות רבות, לשנותן, לתקנן, להשלימן או לעדכנן. ועדת הדקדוק[4] ישבה על מדוכה זו ברבות מישיבותיה בשנים תשנ"ד–תשס"ה ופעלה נמרצות לשיפור הכללים, להשלמתם ולעדכונם. נוסף על כך העמידה הוועדה כללים חדשים רבים – בהם פרקים בנטיית הפועל.
#set text(dir: rtl)
#lorem(100)
לאחר שנאספו כל ההחלטות שהיו פזורות בכרכי זיכרונות האקדמיה, נפרסה התמונה הכוללת ונחשפו בעיות מסוגים שונים: אי־אחידות בניסוח, כללים ופרטים חסרים, חוסר התאמה למציאות הלשונית, סתירות פנימיות ועוד. עלה אפוא צורך לשקול מחדש החלטות רבות, לשנותן, לתקנן, להשלימן או לעדכנן. ועדת הדקדוק[4] ישבה על מדוכה זו ברבות מישיבותיה בשנים תשנ"ד–תשס"ה ופעלה נמרצות לשיפור הכללים, להשלמתם ולעדכונם. נוסף על כך העמידה הוועדה כללים חדשים רבים – בהם פרקים בנטיית הפועל.`
Then look at the results (or just see atached pdf)
for english - look at the yellowed part. For Hebrew text you will seeright away. I would guess that this is also a problem with Arabic.
I'm running current instalation of Archlinux. Typst version is 0.14.2 (b33de9d).
And anyway, thank you for an already excellent tool!
Ben
Activity
MDLC01 commentedon May 17, 2026
Could you clarify exactly what the problem is? What do you expect, and what do you see instead?
nessi-bl commentedon May 17, 2026
Please look at the pdf I've attached to my original message. And to clarify - onve spaces are replace with em-spaces, justification becomes batty. It's more prononced in hebrew texts.
In the code I've psoted above, I'm asking for justification in paragraphs. Then I'm creating 3 sets of texts, each comprised from #lorem(100) followed by hebrew text.
1st set is normal spaces, everything is just fime.
2nd set, I'm replacing spaces with em spaces - #show " ": sym.space.quad. In the english text you can see some battines (yellowed in the pdf), but the hebrew text .... all hell breaks loose.
3rd set iis just like the second but with text direction set to rtl - same problems (but on the left instead of the right side).
There is something wrong with handling em-spaces. It's MUCH more pronaunced in hebrew (and I guess arabic and othe rtl languages).
MDLC01 commentedon May 17, 2026
I am not surprised that the paragraphs aren't justified properly when using EM spaces: there is no regular space to stretch or shrink to justify the text.
That Hebrew text is not line wrapped properly is an actual issue though.
More minimal reproduction, without justification:
MDLC01 commentedon May 17, 2026
Let's keep this issue open to track the line wrapping problem
YDX-2147483647 commentedon Nov 10, 2026
This issue is caused by the upstream Unicode Line Breaking Algorithm (UAX
#14).The current line segmenter used by Typst is targeting Unicode 15.1. In this version of the algorithm, LB21a, the rule preventing line breaks after Hebrew hyphens, is so broad that it unconditionally treats em spaces (as an instance of BA) the same as hyphens. As a result, em spaces after Hebrew characters prevent line breaks.
This mistake has already been corrected in Unicode 16. In the latest algorithm, LB21a is only effective when the hyphen or the em space is followed by a non-Hebrew character. In other words, LB21a no longer interfere with this issue.
There, this issue can be fixed by upgrading the line segmenter to Unicode 18. See #9002 for the details.
Questions
In #9057, I confirm that the lines no longer overflow after the line segmenter is updated to Unicode 18.
However, I'm not sure if the results are correct for Hebrew.
Does anyone know Hebrew? Could you take a look at the following two cases?
|appropriate? Are there any unwanted or missing opportunities?