bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#57693: 29.0.50; Is there a more reliable version of `char-displayabl


From: Ihor Radchenko
Subject: bug#57693: 29.0.50; Is there a more reliable version of `char-displayable-p'?
Date: Sat, 10 Sep 2022 12:56:39 +0800

Stefan Kangas <stefankangas@gmail.com> writes:

> I know very little about this area of Emacs, but is there any reason why
> we couldn't just (try to) make `char-displayable-p' more accurate?
>
> I'm not asking for a perfect solution, but even just making it a bit
> better might be a step forward.

>From the docstring:

>> On a multi-font display, the test is only whether there is an
>> appropriate font from the selected frame's fontset to display
>> CHAR's charset in general.  Since fonts may be specified on a
>> per-character basis, this may not be accurate.

The actual font used to display char in specific buffer at specific
position may depend on various buffer-local settings, property
inheritance, and fontification (possibly modified by user). As Eli
pointed, the most accurate way to check if character can be displayed
involves trying to insert it first, letting the display engine do its
job, and checking what is the result.

-- 
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92





reply via email to

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