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
In SVG there's a concept of a text chunk, sometimes referred to as an "Anchored Chunk", and is defined as follows:
An independent block of text in which all characters are positioned together. Each new absolute positioning adjustment (due to an ‘x’ or ‘y’ attribute, or forced line break) creates a new text chunk. Ligature substitution and bidi-reordering only occur within a text chunk. Text chunks are only relevant to pre-formatted text.
In a way, these are not too dissimilar to the concept of 'lines'. However, where lines imply the presence of a hard break inside the text, this one can also be invoked by setting certain rich text properties (the x and y properties). Because Firefox has some issues here as well (in particular it doesn't handle the bidi case), I had hoped to delay this particular feature, until we ran into a situation where the font Calibri decided to make ligatures between 't' and 'i', which lead to problems with text positioning.
Right now I have a simple implementation that adds raqm_set_arbitrary_run_break, which in turn toggles a boolean in the text_info struct. Said boolean is checked by _raqm_compare_text_info, breaking the run when the second info has this toggled.
This works for non-required ligatures. It doesn't work for required ones (probably because in _raqm_shape Harfbuzz gets the full text and has no concept of these arbitrary breaks). Furthermore, it of course doesn't split the bidi runs.
Splitting the bidi runs seems like it requires reworking both instances of _raqm_bidi_itemize to apply to partial pieces of text (I'm having a hard time figuring out what that would look like as I'm not very good at C). Then in _raqm_itemize the text would be split up on the basis of whether an arbitrary run break is present.
Such rework will be necessary for horizontal-in-vertical as well, because while I'm having a hard time interpreting UAX 9 and UAX 50's interaction with one another, my best guess is that you only want to apply the bidi-algorithm to the horizontally shaped parts and ignore the vertically shaped parts.
My problem right now is that I am not really sure how to proceed here.
FWIW, I am very hesitant to insert unicode format controls inside the text-string to trick Raqm into giving correct results, because computing SVG's x and y positioning needs to happen after the CSS white-space rule, and I'm worried I'm going to lose track of which index in the final string corresponds to the input string index if I start inserting characters that late into the text layout algorithm.
The text was updated successfully, but these errors were encountered:
In SVG there's a concept of a text chunk, sometimes referred to as an "Anchored Chunk", and is defined as follows:
In a way, these are not too dissimilar to the concept of 'lines'. However, where lines imply the presence of a hard break inside the text, this one can also be invoked by setting certain rich text properties (the x and y properties). Because Firefox has some issues here as well (in particular it doesn't handle the bidi case), I had hoped to delay this particular feature, until we ran into a situation where the font Calibri decided to make ligatures between 't' and 'i', which lead to problems with text positioning.
Right now I have a simple implementation that adds
raqm_set_arbitrary_run_break
, which in turn toggles a boolean in the text_info struct. Said boolean is checked by_raqm_compare_text_info
, breaking the run when the second info has this toggled.This works for non-required ligatures. It doesn't work for required ones (probably because in
_raqm_shape
Harfbuzz gets the full text and has no concept of these arbitrary breaks). Furthermore, it of course doesn't split the bidi runs.Splitting the bidi runs seems like it requires reworking both instances of
_raqm_bidi_itemize
to apply to partial pieces of text (I'm having a hard time figuring out what that would look like as I'm not very good at C). Then in_raqm_itemize
the text would be split up on the basis of whether an arbitrary run break is present.Such rework will be necessary for horizontal-in-vertical as well, because while I'm having a hard time interpreting UAX 9 and UAX 50's interaction with one another, my best guess is that you only want to apply the bidi-algorithm to the horizontally shaped parts and ignore the vertically shaped parts.
My problem right now is that I am not really sure how to proceed here.
FWIW, I am very hesitant to insert unicode format controls inside the text-string to trick Raqm into giving correct results, because computing SVG's x and y positioning needs to happen after the CSS white-space rule, and I'm worried I'm going to lose track of which index in the final string corresponds to the input string index if I start inserting characters that late into the text layout algorithm.
The text was updated successfully, but these errors were encountered: