From: Manuel Giraud <manuel@ledu-giraud.fr>
To: Po Lu <luangruo@yahoo.com>
Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
Subject: Re: How to walk a Lisp_String?
Date: Fri, 02 Sep 2022 08:51:34 +0200 [thread overview]
Message-ID: <875yi68e15.fsf@elite.giraud> (raw)
In-Reply-To: <875yi6mvlx.fsf@yahoo.com> (Po Lu's message of "Fri, 02 Sep 2022 09:08:10 +0800")
Po Lu <luangruo@yahoo.com> writes:
> Manuel Giraud <manuel@ledu-giraud.fr> writes:
>
>> Finally, I'd like to walk this Lisp_String and call FACE_FOR_CHAR for
>> each charater of this frame. And then be able to call XftDrawStringUtf8
>> (or XmbDrawString) on each substring/font pair. WDYT?
>
> That won't work correctly since glyphs do not correspond to
> characters.
>
> After you obtain the substring containing characters that can be
> displayed with a single font, you should pass it to the font driver's
> `shape' function, and then give the resulting glyphs and offsets to
> XftDrawGlyphs.
Thanks for those hints. What is a "font driver's `shape' function"?
> Using XftDrawStringUtf8 is a bad idea, along with any other "UTF-8"
> interface provided by an X library. They simply don't work very well,
> and cannot handle complicated things such as character compositions and
> shaping.
Ok. I've said XftDrawStringUtf8 because this is what is currently used
in lwlib for cairo or xft.
> Using XmbDrawString in conjunction with the Emacs face machinery is
> probably a bad idea too, since both have differing notions of "fontset"
> and "font".
Yes, I think that this design could be for cairo and xft only and that
XmbDrawString/XDrawString should stay as they are.
--
Manuel Giraud
next prev parent reply other threads:[~2022-09-02 6:51 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-01 15:34 How to walk a Lisp_String? Manuel Giraud
2022-09-01 15:42 ` Stefan Monnier
2022-09-01 15:42 ` Eli Zaretskii
2022-09-01 15:49 ` Eli Zaretskii
2022-09-01 20:45 ` Manuel Giraud
2022-09-02 1:08 ` Po Lu
2022-09-02 6:32 ` Eli Zaretskii
2022-09-02 8:27 ` Po Lu
2022-09-02 10:36 ` Eli Zaretskii
2022-09-02 11:03 ` Po Lu
2022-09-02 11:15 ` Eli Zaretskii
2022-09-02 12:48 ` Po Lu
2022-09-02 13:17 ` Eli Zaretskii
2022-09-02 6:51 ` Manuel Giraud [this message]
2022-09-02 7:20 ` Eli Zaretskii
2022-09-02 8:31 ` Po Lu
2022-09-02 6:43 ` Eli Zaretskii
2022-09-02 7:18 ` Manuel Giraud
2022-09-02 7:30 ` Eli Zaretskii
2022-09-02 8:56 ` Manuel Giraud
2022-09-02 10:52 ` Eli Zaretskii
2022-09-02 11:40 ` Manuel Giraud
2022-09-02 12:51 ` Po Lu
2022-09-02 15:07 ` Manuel Giraud
2022-09-03 0:58 ` Po Lu
2022-09-03 5:46 ` Tomas Hlavaty
2022-09-03 6:19 ` Po Lu
2022-09-03 8:05 ` Tomas Hlavaty
2022-09-02 13:08 ` Eli Zaretskii
2022-09-02 14:58 ` Manuel Giraud
2022-09-02 15:33 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=875yi68e15.fsf@elite.giraud \
--to=manuel@ledu-giraud.fr \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=luangruo@yahoo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.