[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to walk a Lisp_String?

From: Manuel Giraud
Subject: Re: How to walk a Lisp_String?
Date: Fri, 02 Sep 2022 08:51:34 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (berkeley-unix)

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]