mirror of
https://github.com/stumpwm/stumpwm.git
synced 2026-09-10 07:26:20 -04:00
Simplify FONT-EXISTS-P
No need to check for the length for list returned by LIST-FONT-NAMES. Returning the list itself is enough. The empty list NIL, is false and any list containing one element is true.
This commit is contained in:
parent
0ddebd14c1
commit
1cab4c85e7
|
|
@ -25,12 +25,12 @@
|
|||
sequence &rest keys &key start end translate width size))
|
||||
|
||||
;;;; X11 fonts
|
||||
(defmethod font-exists-p ((font string))
|
||||
(defmethod font-exists-p ((font-name string))
|
||||
;; if we can list the font then it exists
|
||||
(plusp (length (xlib:list-font-names *display* font :max-fonts 1))))
|
||||
(xlib:list-font-names *display* font-name :max-fonts 1))
|
||||
|
||||
(defmethod open-font ((display xlib:display) (font string))
|
||||
(xlib:open-font display (first (xlib:list-font-names display font :max-fonts 1))))
|
||||
(defmethod open-font ((display xlib:display) (font-name string))
|
||||
(xlib:open-font display (first (xlib:list-font-names display font-name :max-fonts 1))))
|
||||
|
||||
(defmethod close-font ((font xlib:font))
|
||||
(xlib:close-font font))
|
||||
|
|
|
|||
Loading…
Reference in a new issue