main
Matthew Butterick 8 years ago
parent 976d257930
commit ce1374eb49

@ -0,0 +1,7 @@
#lang pitfall/racket
(require "font.rkt")
(provide EmbeddedFont)
(define-subclass PDFFont (EmbeddedFont document name id)
(super-new)
'boing)

@ -0,0 +1,16 @@
#lang pitfall/racket
(require "standard-fonts.rkt" "font.rkt" "fontkit.rkt" "embedded.rkt")
(provide PDFFont-open)
(define/contract (PDFFont-open document src family id)
(object? any/c any/c any/c . -> . (is-a?/c PDFFont))
(cond
[(and (string? src) (isStandardFont src))
(make-object StandardFont document src id)]
[else
(define font
(cond
[(string? src) (openSync src family)]
;; todo: other font-loading cases
[else (raise-argument-error 'PDFFont-open "loadable font thingy" src)]))
(make-object EmbeddedFont document font id)]))

@ -1,6 +1,6 @@
#lang pitfall/racket
(require "standard-fonts.rkt" "afm.rkt" "reference.rkt" "fontkit.rkt")
(provide PDFFont PDFFont-open)
(provide PDFFont StandardFont)
(define PDFFont
(class object%
@ -14,22 +14,6 @@
lineHeight)
))
(define-subclass PDFFont (EmbeddedFont document name id)
(super-new)
'boing)
(define/contract (PDFFont-open document src family id)
(object? any/c any/c any/c . -> . (is-a?/c PDFFont))
(cond
[(and (string? src) (isStandardFont src))
(make-object StandardFont document src id)]
[else
(define font
(cond
[(string? src) (openSync src family)]
;; todo: other font-loading cases
[else (raise-argument-error 'PDFFont-open "loadable font thingy" src)]))
(make-object EmbeddedFont document font id)]))
(define/contract (ref this)

@ -1,5 +1,5 @@
#lang pitfall/racket
(require "font.rkt")
(require "font.rkt" "font-open.rkt")
(provide fonts-mixin)
(define (fonts-mixin [% mixin-tester%])

Loading…
Cancel
Save