Re: Get individual graphemes from a SkTextBlob

197 views
Skip to first unread message
Message has been deleted

Shachar Langbeheim

unread,
Feb 2, 2021, 4:06:12 AM2/2/21
to skia-discuss
If you only care about glyphs and don't care about shaping, you can use SkFont::textToGlyphs. you can combine it with SkFont::getPos in order to get each glyph's position, which is the basic information needed by SkShaper.

On Tue, 2 Feb 2021 at 10:08, JackRedstonia <jackred...@gmail.com> wrote:
Hi, I'm currently experimenting with Skia's SkShaper and the likes, but documentation is rather sparse. Is there a way I can get SkShaper (or any other thing in Skia) to take in a string and give back a list of individual characters (each "character" as in a collection of SkPaths that when drawn shows the grapheme) so I can draw them however I like?

Also sorry for any confusion I might cause, I am really new to things like handling text and fonts, so I don't have much of a grasp on terminology, ect.

The text I'm going to feed in is mostly going to be rather "sane" text like English and Japanese, so it's fine if things like Arabic and other irregular/RTL stuff breaks.

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/skia-discuss/46d5e361-cc90-425a-8dae-b860d27daff9n%40googlegroups.com.
Message has been deleted

Ben Wagner

unread,
Feb 2, 2021, 9:51:07 AM2/2/21
to skia-d...@googlegroups.com
Skottie needs to do things like this (shape some text but then later
move glyphs around). You may be interested in SkottieShaper.cpp and
how it is used by the rest of the Skottie code.

On Tue, Feb 2, 2021 at 4:45 AM JackRedstonia <jackred...@gmail.com> wrote:
>
> Thanks, I got it working as I wanted to, except that the font I am using (IBM Plex Sans, if that helps) does not support Japanese. I'm getting rectangles in place of them. SkShaper on the other hand seems to be using a fallback font. Is there something in Skia I can use to get a similar fallback mechanism on textToGlyphs?
> To view this discussion on the web visit https://groups.google.com/d/msgid/skia-discuss/e19e7505-046c-4be5-8256-9bab5ec02f7an%40googlegroups.com.
Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
0 new messages