On Sat, Apr 25, 2020 at 6:07 PM Eli Zaretskii wrote: or these > Then I guess I don't understand your implementation at all. My use case is to include a glyph which is supposed to look like a character, but doesn't actually have a unicode codepoint. (I'm sorry if this differs from the use cases you're exclusively concerned with, but it appeared to be relevant enough to Clément's problem that I assumed he was having a similar issue). That means that we want to use an image spec, not a character in a font; but that image spec depends on face/font properties, because we want to blend in with surrounding text. The most obvious ones are foreground and background color and size, but slant and weight would also affect properly-rendered character-like images. It seems fairly obvious to me that it's a bad idea to do all the work in the display engine or in C code: sub-pixel rendering and anti-aliasing are hard to get right. A character-like glyph might need a third color which provides sufficient contrast to the foreground and background colors, and that color space calculation is complicated enough to be moved to Lisp. So I moved it to Lisp: there's Lisp code which is passed the font/face properties, and returns an image spec that's appropriate for that. The attached patch actually applies to and works with master, and includes an example. It can no longer easily be demonstrated to do the right thing when the same buffer is displayed in different frames, because Emacs currently applies text scaling per buffer rather than per frame (IMHO, that's a bug). It also doesn't properly display the cursor as a block cursor when it's over the glyph, because I can no longer find the code which allowed me to tell, from Lisp, whether that was the case. And of course it doesn't use the right font metrics, because these currently aren't exposed to Lisp. But all these limitations are fixable.