|
|
|
@ -15,52 +15,52 @@
|
|
|
|
|
racket/file)
|
|
|
|
|
|
|
|
|
|
(define quad-compile
|
|
|
|
|
(make-pipeline (list
|
|
|
|
|
;; each pass in the pipeline is at least
|
|
|
|
|
;; (list-of quad?) -> (list-of quad?)
|
|
|
|
|
(make-pipeline
|
|
|
|
|
;; each pass in the pipeline is at least
|
|
|
|
|
;; (list-of quad?) -> (list-of quad?)
|
|
|
|
|
|
|
|
|
|
;; attribute prep =============
|
|
|
|
|
;; all attrs start out as symbol-string pairs.
|
|
|
|
|
;; we convert keys & values to corresponding higher-level types.
|
|
|
|
|
upgrade-attr-keys
|
|
|
|
|
downcase-string-attr-values
|
|
|
|
|
convert-boolean-attr-values
|
|
|
|
|
convert-numeric-attr-values
|
|
|
|
|
convert-set-attr-values
|
|
|
|
|
convert-path-attr-values
|
|
|
|
|
;; attribute prep =============
|
|
|
|
|
;; all attrs start out as symbol-string pairs.
|
|
|
|
|
;; we convert keys & values to corresponding higher-level types.
|
|
|
|
|
upgrade-attr-keys
|
|
|
|
|
downcase-string-attr-values
|
|
|
|
|
convert-boolean-attr-values
|
|
|
|
|
convert-numeric-attr-values
|
|
|
|
|
convert-set-attr-values
|
|
|
|
|
convert-path-attr-values
|
|
|
|
|
|
|
|
|
|
;; wrap default values around top level
|
|
|
|
|
set-top-level-attr-values
|
|
|
|
|
;; wrap default values around top level
|
|
|
|
|
set-top-level-attr-values
|
|
|
|
|
|
|
|
|
|
;; pre-linearization resolutions & parsings =============
|
|
|
|
|
;; these need the tree shape
|
|
|
|
|
parse-dimension-strings
|
|
|
|
|
resolve-font-sizes
|
|
|
|
|
resolve-font-features
|
|
|
|
|
parse-page-sizes
|
|
|
|
|
;; pre-linearization resolutions & parsings =============
|
|
|
|
|
;; these need the tree shape
|
|
|
|
|
parse-dimension-strings
|
|
|
|
|
resolve-font-sizes
|
|
|
|
|
resolve-font-features
|
|
|
|
|
parse-page-sizes
|
|
|
|
|
|
|
|
|
|
;; linearization =============
|
|
|
|
|
;; we postpone this step until we're certain any
|
|
|
|
|
;; information encoded from the hierarchy of quads
|
|
|
|
|
;; has been absorbed into the attrs
|
|
|
|
|
;; (e.g., cascading font sizes)
|
|
|
|
|
;; because once we linearize, that information is gone.
|
|
|
|
|
linearize
|
|
|
|
|
;; linearization =============
|
|
|
|
|
;; we postpone this step until we're certain any
|
|
|
|
|
;; information encoded from the hierarchy of quads
|
|
|
|
|
;; has been absorbed into the attrs
|
|
|
|
|
;; (e.g., cascading font sizes)
|
|
|
|
|
;; because once we linearize, that information is gone.
|
|
|
|
|
(print-pass linearize)
|
|
|
|
|
|
|
|
|
|
;; post-linearization resolutions & parsings =============
|
|
|
|
|
resolve-font-paths
|
|
|
|
|
complete-attr-paths
|
|
|
|
|
;; post-linearization resolutions & parsings =============
|
|
|
|
|
resolve-font-paths
|
|
|
|
|
complete-attr-paths
|
|
|
|
|
|
|
|
|
|
mark-text-runs
|
|
|
|
|
merge-adjacent-strings
|
|
|
|
|
split-whitespace
|
|
|
|
|
split-into-single-char-quads
|
|
|
|
|
fill-missing-font-path
|
|
|
|
|
remove-font-without-char
|
|
|
|
|
insert-fallback-font
|
|
|
|
|
layout
|
|
|
|
|
make-drawing-insts
|
|
|
|
|
stackify)))
|
|
|
|
|
mark-text-runs
|
|
|
|
|
merge-adjacent-strings
|
|
|
|
|
split-whitespace
|
|
|
|
|
split-into-single-char-quads
|
|
|
|
|
fill-missing-font-path
|
|
|
|
|
remove-font-without-char
|
|
|
|
|
insert-fallback-font
|
|
|
|
|
layout
|
|
|
|
|
make-drawing-insts
|
|
|
|
|
stackify))
|
|
|
|
|
|
|
|
|
|
(module+ main
|
|
|
|
|
(require "render.rkt")
|
|
|
|
|