Skip to content

Implement arbitrary run breaks inside raqm

This tackles BUG:471374 by adding a small patch to raqm to enable arbitrary run breaks. This allows for breaking non-required ligatures in particular places.

Technically speaking, text spans that have absolute positioning (and thus are an SVG text chunk), require to also have their own bidi-reordering, as well, be completely separately shaped. For the former, that would require modifying (both implementations of...) _raqm_bidi_itemize to accept partial chunks to run the bidi algorithm on, then _raqm_itemize to split up the text into those partial chunks to hand them to _raqm_bidi_itemize, and then after that, for the latter _raqm_shape should probably also be modified so that harfbuzz doesn't get too much information that it'll use to shape. I'm currently not good enough at C to get that working within any reasonable timeframe (FWIW, all of these things will be required for an implementation of text-orientation as well, because only horizontal parts of mixed text-orientation need bidi-reordering).

What is more important however is that because this patch adds an API call, we'll need to figure out how to ifdef that API call somehow, to ensure that people with unpatched raqm (or, indeed our CI) can still build krita. I'm not sure how to approach this.

BUG:471374

NB: this also updates raqm to 0.10.1, I hope I did that part correctly.

Test Plan

Check the bug report.

Formalities Checklist

  • I confirmed this builds.
  • I confirmed Krita ran and the relevant functions work.
  • I tested the relevant unit tests and can confirm they are not broken. (If not possible, don't hesitate to ask for help!)
    • One would expect the absolute positioning with arabic text to be changed, but it seems that would require bigger changes inside raqm, as harfbuzz is being a little too smart about this.
  • I made sure my commits build individually and have good descriptions as per KDE guidelines.
  • I made sure my code conforms to the standards set in the HACKING file.
  • I can confirm the code is licensed and attributed appropriately, and that unattributed code is mine, as per KDE Licensing Policy.

Reminder: the reviewer is responsible for merging the patch, this is to ensure at the least two people can build the patch. In case a patch breaks the build, both the author and the reviewer should be contacted to fix the build. If this is not possible, the commits shall be reverted, and a notification with the reasoning and any relevant logs shall be sent to the mailing list, kimageshop@kde.org.

Merge request reports

Loading