File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 358358(defun char-type (char )
359359 (guess-font-type *display* (char-code char )))
360360
361+ (defun get-font (&key attribute type bold)
362+ (or (alexandria :if-let (attribute (and attribute (lem :ensure-attribute attribute)))
363+ (lem :attribute-value attribute ' font))
364+ (get-display-font *display* :type type :bold bold)))
365+
361366(defun split-string-by-character-type (string )
362367 (loop :with pos := 0 :and items := ' ()
363368 :while (< pos (length string ))
375380 (bold (and attribute (lem :attribute-bold attribute)))
376381 (foreground (attribute-foreground-with-reverse attribute))
377382 (surface
378- (sdl2-ttf :render-utf8-blended (get-display- font *display*
379- :type type
380- :bold bold)
383+ (sdl2-ttf :render-utf8-blended (get-font :attribute attribute
384+ :type type
385+ :bold bold)
381386 c-string
382387 (lem :color-red foreground)
383388 (lem :color-green foreground)
436441 (cffi :with-foreign-string (c-string (string character ))
437442 (let ((surface
438443 (sdl2-ttf :render-utf8-blended
439- (get-display- font *display*
440- :type (char-type character )
441- :bold bold)
444+ (get-font :attribute attribute
445+ :type (char-type character )
446+ :bold bold)
442447 c-string
443448 (lem :color-red foreground)
444449 (lem :color-green foreground)
You can’t perform that action at this time.
0 commit comments