how to draw text with underline and/or strikeout?

992 views
Skip to first unread message

tj_s...@yahoo.com

unread,
May 10, 2018, 4:54:15 AM5/10/18
to skia-discuss
How to use SkCanvas to draw underlinetext or strikeThrutext in windows OS ?
old api SkPaint::setUnderlineText has deprecated

Cary Clark

unread,
May 10, 2018, 7:11:41 AM5/10/18
to skia-d...@googlegroups.com
Skia draws text glyphs, and leaves text layout to support libraries like harfbuzz. The underline drawn by Chrome using Skia, for instance, uses text layout information.. See https://skia.org/user/api/SkPaint_Reference#Text_Intercepts for how Chrome skips the descenders when it draws underlines.

If you want a simple underline or strikethrough, you can draw a line over the text. This is all Skia used to do.

On Thu, May 10, 2018 at 4:54 AM, tj_swjtu via skia-discuss <skia-d...@googlegroups.com> wrote:
How to use SkCanvas to draw underlinetext or strikeThrutext in windows OS ?
old api SkPaint::setUnderlineText has deprecated

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to skia-d...@googlegroups.com.
Visit this group at https://groups.google.com/group/skia-discuss.
For more options, visit https://groups.google.com/d/optout.

Hal Canary

unread,
May 10, 2018, 9:57:13 AM5/10/18
to skia-discuss
Here's an example of underline and strikethrough without intercepts:

On Thu, May 10, 2018 at 7:11 AM 'Cary Clark' via skia-discuss <skia-d...@googlegroups.com> wrote:
Skia draws text glyphs, and leaves text layout to support libraries like harfbuzz. The underline drawn by Chrome using Skia, for instance, uses text layout information.. See https://skia.org/user/api/SkPaint_Reference#Text_Intercepts for how Chrome skips the descenders when it draws underlines.

If you want a simple underline or strikethrough, you can draw a line over the text. This is all Skia used to do.
On Thu, May 10, 2018 at 4:54 AM, tj_swjtu via skia-discuss <skia-d...@googlegroups.com> wrote:
How to use SkCanvas to draw underlinetext or strikeThrutext in windows OS ?
old api SkPaint::setUnderlineText has deprecated

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.

To post to this group, send email to skia-d...@googlegroups.com.
Visit this group at https://groups.google.com/group/skia-discuss.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.

tj_s...@yahoo.com

unread,
May 11, 2018, 2:51:19 AM5/11/18
to skia-discuss
Thank you.

在 2018年5月10日星期四 UTC+8下午4:54:15,tj_s...@yahoo.com写道:

fla...@worldiety.de

unread,
Feb 26, 2019, 10:57:19 AM2/26/19
to skia-discuss
Hey,

this link is no longer available. Would you mind recreating your fiddle?

Thank you!
Reply all
Reply to author
Forward
0 new messages