Add glyph palette
This adds a QML driven glyph palette to the text tool. It can do 2 things: firstly, it can show a character map of the given font, secondly, it can present both glyph alternates and variation selectors. While there will be toggles for opentype features as well, a glyph palette can be the most intuitive way to select these.
text-tool-demo-feb-glyph-palette-2024-02-26_12.19.38.mp4
TODO:
-
Use unicode blocks instead of scripts for filtering, this will require generating a blocks file from UCD text file. -
Allow filtering by string. -
Make glyph alts pop-up a qtwidgets popup, because QtQuickWidget clips QML pop-ups. -
Improve tooltips/localize -
Improve harfbuzz glyph retrieval code (localize). -
Docs
Test Plan
Test the glyph palette by editing a text with a font that uses opentype features:
- The demo uses MonteCarlo from google fonts, another good test font is Junicode, which has tons of alternate glyphs, but even Noto Sans has small caps.
- For variation selectors, you can try Source Han or Noto Sans CJK, 邉󠄀 (edge) is the character with the most variation selectors.
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!) -
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.