You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
typesetting/pitfall/ptest/test21.rkt

28 lines
708 B
Racket

6 years ago
#lang debug racket/base
(require pitfall/pdftest)
;; subset OTF font
(define-runtime-path fira "assets/fira.otf")
(define-runtime-path charter "assets/charter.otf")
;; embed otf
(define (proc doc)
;; Register a font name for use later
(register-font doc "fira" (path->string fira))
(register-font doc "charter" (path->string charter))
;; Set the font, draw some text
6 years ago
[font doc "charter"]
6 years ago
[font-size doc 40]
6 years ago
[text doc "Charter OTF rifle fire" 100 100])
6 years ago
;; test against non-subsetted font version
6 years ago
(define-runtime-path this "test21rkt.pdf")
6 years ago
(make-doc this #f proc)
6 years ago
(define-runtime-path that "test21crkt.pdf")
6 years ago
(make-doc that #t proc)
6 years ago
(check-font-subsets-equal? "test21rkt.pdf" "test21.pdf")