[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: how to determine whether a char can be displayed or not
From: |
Eli Zaretskii |
Subject: |
Re: how to determine whether a char can be displayed or not |
Date: |
Mon, 09 Oct 2000 07:31:40 +0200 |
> From: "Stefan Monnier" <monnier+gnu/address@hidden>
> Date: Sun, 08 Oct 2000 23:49:22 -0400
>
> (defun display-check-font (char)
> "Return non-nil if a font is available to display CHAR."
> (if (symbolp char) (setq char (make-char char)))
> (let* ((spec (fontset-font t char)))
> (cond
> ((memq window-system '(x))
> (x-list-fonts
> (concat "*-" (or (car spec) (face-attribute 'default :family))
> "-*-" (cdr spec))))
> ;; In doubt, let's say no.
> (t nil))))
This should return non-nil for an ASCII font on all systems. Also,
calling fontset-font unconditionally will signal an error on systems
which don't support fontsets (e.g., MS-DOS); you should use fboundp.
Finally, I think w32 will also work here, so (display-multi-font-p)
would be better than looking at window-system (if you call
display-multi-font-p outside the let* form, you could avoid fboundp).
> - shouldn't this be implemented in C instead, reusing the existing
> font selection code, so as to be 100% sure of the answer ?
Is x-list-fonts slow? If it is, then IMHO a primitive would be
better.
- VC/CVS: local diffing and reverting implemented, Andre Spiegel, 2000/10/04
- Re: VC/CVS: local diffing and reverting implemented, Stefan Monnier, 2000/10/04
- Re: VC/CVS: local diffing and reverting implemented, Andre Spiegel, 2000/10/04
- how to determine whether a char can be displayed or not, Stefan Monnier, 2000/10/04
- Re: how to determine whether a char can be displayed or not, Eli Zaretskii, 2000/10/04
- Re: how to determine whether a char can be displayed or not, Stefan Monnier, 2000/10/08
- Re: how to determine whether a char can be displayed or not, Miles Bader, 2000/10/09
- Re: how to determine whether a char can be displayed or not,
Eli Zaretskii <=
- Re: how to determine whether a char can be displayed or not, Dave Love, 2000/10/09
- Re: how to determine whether a char can be displayed or not, Eli Zaretskii, 2000/10/09
- Re: how to determine whether a char can be displayed or not, Dave Love, 2000/10/09
- Re: how to determine whether a char can be displayed or not, Kenichi Handa, 2000/10/11
- Re: how to determine whether a char can be displayed or not, Eli Zaretskii, 2000/10/11
- Re: how to determine whether a char can be displayed or not, Kenichi Handa, 2000/10/11
- Re: how to determine whether a char can be displayed or not, Eli Zaretskii, 2000/10/11
- Re: how to determine whether a char can be displayed or not, Kenichi Handa, 2000/10/16
- Re: how to determine whether a char can be displayed or not, Dave Love, 2000/10/11
- Re: how to determine whether a char can be displayed or not, Kenichi Handa, 2000/10/11