From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Manuel Giraud Newsgroups: gmane.emacs.devel Subject: Re: How to walk a Lisp_String? Date: Thu, 01 Sep 2022 22:45:12 +0200 Message-ID: <87ler2963r.fsf@elite.giraud> References: <87a67jw1kw.fsf@elite.giraud> <83o7vzqey8.fsf@gnu.org> <83mtbjqemd.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22480"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (berkeley-unix) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Sep 01 22:46:53 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oTr5R-0005ej-BN for ged-emacs-devel@m.gmane-mx.org; Thu, 01 Sep 2022 22:46:53 +0200 Original-Received: from localhost ([::1]:56788 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oTr5P-0003tb-Sc for ged-emacs-devel@m.gmane-mx.org; Thu, 01 Sep 2022 16:46:51 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41732) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oTr3v-00039m-A9 for emacs-devel@gnu.org; Thu, 01 Sep 2022 16:45:19 -0400 Original-Received: from ledu-giraud.fr ([51.159.28.247]:15252) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oTr3t-00061q-88; Thu, 01 Sep 2022 16:45:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=MR62mWJ0jkq0e2mI zdK5JFqdIBs1cInnLHgOTFeifaE=; h=date:references:in-reply-to:subject: cc:to:from; d=ledu-giraud.fr; b=iZGoeWubrXbtMm72rw6CltZQR60jxHsj/jCAIe j1zeWH5+XovYZfcZ7ThoeJtqR9MPxsEAuxaJVZKo2XJxIuzql0R/Oaa0P6ecN8vuly+Vh0 dNuYQVz427awBz3WpBLg6esr9CzI7GFqk0FnP0YuGKzISkscAMLZPSOUBVsAnZnDr9ThsK iAJvOW6fPGlUzDmlSdgAmN7beVCjZGIGlJwuBNXMQymPg6XpHAoNhbWOp71dxN07BGL7Tg w+eBnS528asXzrD9an/wbCTWhw8K1dHalbiq4oKM80WOYJpOHakA7Mf9ztlzJz67G7i1EB N0g6+8prZuwu1DFlcd27z+UA== Original-Received: from elite.giraud (82-65-148-221.subs.proxad.net [82.65.148.221]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id 403c14db (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 1 Sep 2022 22:45:13 +0200 (CEST) In-Reply-To: <83mtbjqemd.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 01 Sep 2022 18:49:14 +0300") Received-SPF: pass client-ip=51.159.28.247; envelope-from=manuel@ledu-giraud.fr; helo=ledu-giraud.fr X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:294504 Archived-At: Eli Zaretskii writes: [...] > Btw, my suggestion would be to describe your preliminary design ideas > here before you decide how to implement them. E.g., it is not clear > to me why you'd need to walk strings character by character in order > to use the face machinery. I'm probably missing something. Sure, good idea. I'm working into lwlib only. So I've made a function to get the frame of the menu widget (mw). I'm also converting the char* display_string of each menu entry to a Lisp_String with make_string (note: I don't know if I should have done that but it seems the way to get a proper multi-byte string from a char*). 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? -- Manuel Giraud