aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/assets/font.lisp
blob: 30175728acd7bcf5e51afc6c1059205f9b5d7c7d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
;;;; asset/font.lisp

(in-package #:wheelwork)

(define-symbol-macro +standard-font-chars+
  " 
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890\".,!?-'"  )

(def:class font (asset)
  ((characters "The characters renderable with this font")
   :prefix :type string :initform +standard-font-chars+)
  ((oversample "Oversampling factor")
   :prefix :type (or null number) :initform nil)
  ((object "Stored font returned by cl-fond")
   :prefix :ro :type cl-fond::font))

(defmethod ensure-loaded ((font font))
  (with-slots (path characters oversample object) font
    (setf object (cl-fond:make-font path characters :oversample oversample))))