diff --git a/quad/qtest/test-adjustment-sizing.rkt b/quad/qtest/test-adjustment-sizing.rkt index a467045c..d62d0869 100644 --- a/quad/qtest/test-adjustment-sizing.rkt +++ b/quad/qtest/test-adjustment-sizing.rkt @@ -2,6 +2,6 @@ '(q ((column-count "2")(font-size "18")(line-height "2em")) "The lines in both columns should be vertically aligned. The column on the left is font size 18pt with line height 2em, or 36pt. The right column is font size 50%, or 9pt, with line height 4em, or 36pt." -(q ((break "column"))) -(q ((break "para"))) +(column-break) +(para-break) (q ((font-size "0.5em")(line-height "4em")) "The lines in both columns should be vertically aligned. The column on the left is font size 18pt with line height 2em, or 36pt. The right column is font size 50%, or 9pt, with line height 4em, or 36pt.")) \ No newline at end of file diff --git a/quad/qtest/test-breaks.rkt b/quad/qtest/test-breaks.rkt index 6822b0e2..ad77ca7b 100644 --- a/quad/qtest/test-breaks.rkt +++ b/quad/qtest/test-breaks.rkt @@ -4,37 +4,37 @@ "Page 1 Column 1 Line 1" -(q ((break "line"))) +(line-break) "Page 1 Column 1 Line 2" -(q ((break "column"))) +(column-break) -(q ((break "para"))) +(para-break) "Page 1 Column 2 Line 1" -(q ((break "line"))) +(line-break) "Page 1 Column 2 Line 2" -(q ((break "page"))) +(page-break) "Page 2 Column 1 Line 1" -(q ((break "line"))) +(line-break) -(q ((break "column"))) +(column-break) -(q ((break "page"))) +(page-break) "Page 3 Column 1 Line 1" -(q ((break "page"))) +(page-break) -(q ((break "page"))) +(page-break) "Page 5 Column 1 Line 1" diff --git a/quad/qtest/test-font-setup.rkt b/quad/qtest/test-font-setup.rkt index bd7143ff..7c6315a3 100644 --- a/quad/qtest/test-font-setup.rkt +++ b/quad/qtest/test-font-setup.rkt @@ -1,5 +1,5 @@ #lang quadwriter '(q ((font-family "arbitrary-name")(font-size "24")) "This text is in Charter") -'(q ((break "para"))) +'(para-break) '(q ((font-family "charter")(font-size "24")) "This text is in Charter too") diff --git a/quad/qtest/test-font-tracking.rkt b/quad/qtest/test-font-tracking.rkt index 9fdc8457..f460a6f9 100644 --- a/quad/qtest/test-font-tracking.rkt +++ b/quad/qtest/test-font-tracking.rkt @@ -1,18 +1,18 @@ #lang quadwriter '(q "Left aligned") -'(q ((break "para"))) +'(para-break) '(q ((font-size "20")(font-tracking "5")) "we have the same tracking you see") -'(q ((break "para"))) +'(para-break) '(q ((font-size "20")(font-tracking "0.25em")) "we have the same tracking you see") -'(q ((break "para"))) +'(para-break) '(q "Justified") -'(q ((break "para"))) +'(para-break) '(q ((font-size "20")(font-tracking "5")(line-align "justify")) "we have the same tracking you see") -'(q ((break "para"))) +'(para-break) '(q ((font-size "20")(font-tracking "0.25em")(line-align "justify")) "we have the same tracking you see") diff --git a/quad/qtest/test-ot-features.rkt b/quad/qtest/test-ot-features.rkt index a300c538..9697eb90 100644 --- a/quad/qtest/test-ot-features.rkt +++ b/quad/qtest/test-ot-features.rkt @@ -3,22 +3,22 @@ '(q ((font-features "liga 0")) "No ligs: fifle") -'(q ((break "para"))) +'(para-break) '(q ((font-features "liga 1")) "Ligs: fifle") -'(q ((break "para"))) +'(para-break) '(q ((font-features "liga 1")) (q ((font-features "liga 0")) "No ligs: fifle")) -'(q ((break "para"))) +'(para-break) '(q ((font-features "liga 1")) (q ((font-features "+ liga 0")) "No ligs: fifle")) -'(q ((break "para"))) +'(para-break) '(q ((font-features "zero 1")) (q ((font-features "liga 0")) "No ligs, no slashed zero: fifle0")) -'(q ((break "para"))) +'(para-break) '(q ((font-features "zero 1")) (q ((font-features "+ liga 0")) "No ligs, slashed zero: fifle0")) \ No newline at end of file diff --git a/quad/qtest/test-sections.rkt b/quad/qtest/test-sections.rkt index 358076f2..a2fc1895 100644 --- a/quad/qtest/test-sections.rkt +++ b/quad/qtest/test-sections.rkt @@ -4,19 +4,19 @@ "Section 1 Page 1 on right" -(q ((break "section"))) +(section-break) (q ((page-width "5in")(page-height "5in")(page-side-start "right")) "Section 2 Page 1 on right" -(q ((break "page"))) +(page-break) "Section 2 Page 2 on left") -(q ((break "section"))) +(section-break) (q ((page-width "5in")(page-height "5in")(page-side-start "left")) "Section 3 Page 1 on left" -(q ((break "page"))) +(page-break) "Section 3 Page 2 on right") diff --git a/quad/quad/scribblings/quad.scrbl b/quad/quad/scribblings/quad.scrbl index 93040b03..21f4faa0 100644 --- a/quad/quad/scribblings/quad.scrbl +++ b/quad/quad/scribblings/quad.scrbl @@ -172,7 +172,7 @@ To see this: () (q ((page-margin-left "120") (page-margin-top "80") (page-margin-bottom "120") (font-family "text") (line-height "17")) - (q ((break "para"))) + (para-break) (q ((font-family "heading") (first-line-indent "0") (display "block") (font-size "20") (line-height "24.0") (border-width-top "0.5") (border-inset-top "9") (inset-bottom "-3") (inset-top "6") (keep-with-next "true") (id "did-you-know")) "Did you know?") ยทยทยท } diff --git a/quad/quadwriter/break.rkt b/quad/quadwriter/break.rkt index 4f9e1dc2..b6099a75 100644 --- a/quad/quadwriter/break.rkt +++ b/quad/quadwriter/break.rkt @@ -8,42 +8,47 @@ (define (convert-break-quad q) ;; this is verbose & ugly because `struct-copy` is a macro ;; we want to use break prototypes but also preserve their type - (match (quad-ref q :break) - ["para" (quad-copy para-break-quad q:para-break [attrs (quad-attrs q)])] - ["line" (quad-copy line-break-quad q:line-break [attrs (quad-attrs q)])] - ["page" (quad-copy page-break-quad q:page-break [attrs (quad-attrs q)])] - ["column" (quad-copy column-break-quad q:column-break [attrs (quad-attrs q)])] - ["hr" (quad-copy hr-break-quad q:hr-break [attrs (quad-attrs q)])] - ["section" (quad-copy section-break-quad q:section-break [attrs (quad-attrs q)])] - [_ q])) + (match (quad-tag q) + [(== 'para-break eq?) + (quad-copy para-break-quad q:para-break [attrs (quad-attrs q)])] + [(== 'line-break eq?) + (quad-copy line-break-quad q:line-break [attrs (quad-attrs q)])] + [(== 'page-break eq?) + (quad-copy page-break-quad q:page-break [attrs (quad-attrs q)])] + [(== 'column-break eq?) + (quad-copy column-break-quad q:column-break [attrs (quad-attrs q)])] + [(== 'hr eq?) (quad-copy hr-break-quad q:hr-break [attrs (quad-attrs q)])] + [(== 'section-break eq?) + (quad-copy section-break-quad q:section-break [attrs (quad-attrs q)])] + [_ #false])) (module+ test (require rackunit quad/qexpr) - (check-equal? (quad-ref (convert-break-quad (qexpr->quad '(q ((break "page") (foo "bar"))))) 'foo) "bar")) + (check-equal? (quad-ref (convert-break-quad (qexpr->quad '(page-break ((foo "bar"))))) 'foo) "bar")) (define q:line-break (make-line-break-quad #:printable #f - #:id 'line-break)) + #:tag 'line-break)) (define q:para-break (make-para-break-quad #:printable #f - #:id 'para-break)) + #:tag 'para-break)) (define q:hr-break (make-hr-break-quad #:printable #t - #:id 'hr-break)) + #:tag 'hr-break)) (define q:column-break (make-column-break-quad #:printable #f - #:id 'column-break)) + #:tag 'column-break)) (define q:page-break (make-page-break-quad #:printable #f - #:id 'page-break)) + #:tag 'page-break)) (define q:section-break (make-section-break-quad #:printable #f - #:id 'section-break)) - -(define para-break '(q ((break "para")))) -(define line-break '(q ((break "line")))) -(define page-break '(q ((break "page")))) -(define column-break '(q ((break "column")))) -(define hr-break '(q ((break "hr")))) -(define section-break '(q ((break "section")))) + #:tag 'section-break)) + +(define para-break '(para-break)) +(define line-break '(line-break)) +(define page-break '(page-break)) +(define column-break '(column-break)) +(define hr-break '(hr)) +(define section-break '(section-break)) (module+ test (require rackunit quad/atomize)