summaryrefslogtreecommitdiff
path: root/suweren/home/services/fontutils.scm
blob: 587adcc1f9101a1bb0813802455e7e8253ac12b8 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
(define-module (suweren home services fontutils)
  ;; suweren-home-fontconfig-service-type

  #:use-module (gnu home services fontutils)

  ;; suweren-home-fontconfig-service-type
  #:use-module (gnu services))

(define-public suweren-home-fontconfig-service-type
  (let* ((antialias '(match (@ (target "font"))
                       (edit (@ (mode "assign")
				(name "antialias"))
			     (bool "true"))))
	 (hinting '(match (@ (target "font"))
		     (edit (@ (mode "assign")
			      (name "hinting"))
			   (bool "true"))))
	 (hintstyle '(match (@ (target "font"))
		       (edit (@ (mode "assign")
				(name "hintstyle"))
			     (const "hintfull"))))
	 (monospace '(alias (family "monospace")
			    (prefer (family "Unifont"))))
	 (rgba '(match (@ (target "font"))
		  (edit (@ (mode "assign")
			   (name "rgba"))
			(const "rgb"))))
	 (sans-serif '(alias (family "sans-serif")
			    (prefer (family "Unifont"))))
	 (serif '(alias (family "serif")
			    (prefer (family "Unifont"))))

	 ;; TODO sxml -> (sxml)
	 (rules (list antialias
		      hinting
		      hintstyle
		      rgba
		      monospace
		      sans-serif
		      serif))

	 ;; TODO Remove the hardcoded path by using an appropriate variable.
	 ;; TODO string -> (sxml) -> fontconfig-extension
	 (extensions (list "~/.guix-home/profile/share/fonts"
			   rules)))

    ;; TODO symbol -> service-type? -> fontconfig-extension -> service
    (simple-service 'suweren-fontconfig
		    home-fontconfig-service-type
		    extensions)))