-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to underline and strikethrough fonts? #224
Comments
These two seem to be part of SkPaint in skia which was removed 7 years ago mono/SkiaSharp#391 . I checked there only one reference to these in current skia-python code, which is in the FontMetrics class. The Font class has a getMetrics method which gets it, but I don't think it supports setting. I.e. it looks like with current skia-python, you can try getting at the metrics of your current font of choice, then draw those lines at the returned positions... though I'd be happy to be corrected if you can set underlinewidth/strikeoutwidth to non-zero and get it to work that way. In current upstream skia code, it seems that the skparagraph module has a text declaration class and a setter for this. So I'll open a new issue for binding skparagraph if one doesn't exist yet. |
There seems to be a custom typeface builder class which allows one to change the metrics of a supplied typeface. Skia-python currently doesn't touch that, I think. Though it is designated SK_API, it is also not documented... |
Thanks. I will close this issue. |
The custom typeface builder class seems stable (SK_API) so we might add that, besides the bigger skparagraph project. |
This includes underline and strikethrough text effects. Fixes kyamagu#224
See the example in #258 on how to do underline / strikethrough. There is a donation link in from my profile https://hintak.github.io/ if you are feeling generous. |
You'll need to install the python wheels when CI finishes https://github.com/kyamagu/skia-python/actions/runs/10337416324 to try it out, of course. |
How to underline and strikethrough fonts? Could you indicate me which function or class I can refer to?
The text was updated successfully, but these errors were encountered: