rename some tags

main
Matthew Butterick 6 years ago
parent f26f9fd70c
commit 2cf1f3da27

@ -25,7 +25,7 @@ Naming guidelines
(match (cdr (regexp-match #rx"^(-?[0-9\\.]+)([a-z]+)$" (string-downcase x)))
[(list num-string unit)
((match unit
[(regexp #rx"in(ch)?") in->pts]
[(regexp #rx"in(ch|ches)?") in->pts]
[(regexp #rx"cm") (compose1 in->pts cm->in)]
[(regexp #rx"mm") (compose1 in->pts cm->in mm->cm)]) (string->number num-string))])]))
(if round? (inexact->exact (floor val)) val))
@ -61,10 +61,11 @@ Naming guidelines
border-color-bottom
background-color
keep-lines
keep-first
keep-last
keep-all
keep-first-lines
keep-last-lines
keep-all-lines
keep-with-next
line-align

@ -23,7 +23,7 @@
(when (pair? (quad-elems q))
(font doc (path->string (quad-ref q font-path-key default-font-face)))
(font-size doc (quad-ref q 'font-size default-font-size))
(fill-color doc (quad-ref q 'color default-font-color))
(fill-color doc (quad-ref q 'font-color default-font-color))
(define str (unsafe-car (quad-elems q)))
(match-define (list x y) (quad-origin q))
(text doc str x y
@ -123,11 +123,6 @@
#:printable (λ (q sig) (not (memq sig '(start end))))
#:draw-start (if (draw-debug-line?) draw-debug void)))
(define q:line-spacer-unbreakable
(struct-copy line-spacer q:line-spacer
[attrs #:parent quad
(make-hasheq '((keep-lines . #true)))]))
(define softies (map string '(#\space #\- #\u00AD)))
(define (soft-break-for-line? q)

@ -24,7 +24,7 @@
(define-tag-function (p attrs exprs)
;; no font-family so that it adopts whatever the surrounding family is
(qexpr (append `((keep-first "2")(keep-last "3") (font-size-adjust "100%") (character-tracking "0") (hyphenate "true") (display ,(symbol->string (gensym)))) attrs) exprs))
(qexpr (append `((keep-first-lines "2")(keep-last-lines "3") (font-size-adjust "100%") (character-tracking "0") (hyphenate "true") (display ,(symbol->string (gensym)))) attrs) exprs))
(define-tag-function (hr attrs exprs)
hrbr)
@ -39,7 +39,7 @@
(border-width-bottom "0.5") (border-color-bottom "gray") (border-inset-bottom "-2")
(border-width-right "0.5") (border-color-right "gray") (border-inset-right "20")
(inset-top "10") (inset-bottom "8") (inset-left "30") (inset-right "30")
(keep-lines "yes"))
(keep-all "yes"))
attrs) exprs))
(define id (default-tag-function 'id))
@ -50,7 +50,7 @@
(define b strong)
(define-tag-function (a attrs exprs)
(qexpr `((link ,(cadr (assoc 'href attrs)))(color "MediumVioletRed")) exprs))
(qexpr `((link ,(cadr (assoc 'href attrs)))(font-color "MediumVioletRed")) exprs))
(define-tag-function (em attrs exprs)
(qexpr (list* '(font-italic "true") '(font-size-adjust "100%") attrs) exprs))

Loading…
Cancel
Save