[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Entering emojis
From: |
Lars Ingebrigtsen |
Subject: |
Re: Entering emojis |
Date: |
Fri, 29 Oct 2021 23:09:10 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) |
Lars Ingebrigtsen <larsi@gnus.org> writes:
> And indeed, for that set of code points, internal-char-font and
> font-get-glyphs take almost exactly the same time, which is very odd.
Or perhaps not! That function does quite a lot of work both when it
gets a match and not (allocating vectors and stuff).
As a test, I made it return t/nil if fed a character:
diff --git a/src/font.c b/src/font.c
index 5e761abc5e..3b0309088b 100644
--- a/src/font.c
+++ b/src/font.c
@@ -5067,6 +5067,14 @@ DEFUN ("font-get-glyphs", Ffont_get_glyphs,
Sfont_get_glyphs, 3, 4, 0,
}
chars = aref_addr (object, ifrom);
}
+ else if (INTEGERP (object))
+ {
+ int c = XFIXNAT (object);
+ if (font->driver->encode_char (font, c) == FONT_INVALID_CODE)
+ return Qnil;
+ else
+ return Qt;
+ }
else
wrong_type_argument (Qarrayp, object);
And that made it really, really fast -- like 100x faster in the test
case. :-)
Should I fix this up and document it? It's perhaps not an ideal
interface...
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
- Re: Entering emojis, (continued)
- Re: Entering emojis, Eli Zaretskii, 2021/10/29
- Re: Entering emojis, Lars Ingebrigtsen, 2021/10/29
- Re: Entering emojis, Eli Zaretskii, 2021/10/29
- Re: Entering emojis, Lars Ingebrigtsen, 2021/10/29
- Re: Entering emojis, Eli Zaretskii, 2021/10/29
- Re: Entering emojis, Lars Ingebrigtsen, 2021/10/29
- Re: Entering emojis, Lars Ingebrigtsen, 2021/10/29
- Re: Entering emojis,
Lars Ingebrigtsen <=
- Re: Entering emojis, Lars Ingebrigtsen, 2021/10/29
- Re: Entering emojis, Eli Zaretskii, 2021/10/30
- Re: Entering emojis, Lars Ingebrigtsen, 2021/10/30
- Re: Entering emojis, Robert Pluim, 2021/10/28
- Re: Entering emojis, Stefan Kangas, 2021/10/28
- Re: Entering emojis, Lars Ingebrigtsen, 2021/10/28
- Re: Entering emojis, Stefan Kangas, 2021/10/28
- Re: Entering emojis, Lars Ingebrigtsen, 2021/10/28
- Re: Entering emojis, Eli Zaretskii, 2021/10/28
- Re: Entering emojis, Stefan Kangas, 2021/10/28