From f153c4e775ec4e218ddc97af3f599bafc0af5b0b Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Sun, 26 May 2019 17:58:57 -0700 Subject: [PATCH] renamings --- quad/quad/scribblings/quad.scrbl | 10 +++++----- quad/quadwriter/core.rkt | 6 +++--- quad/quadwriter/font.rkt | 2 +- .../{default-heading => blockquote}/LICENSE.txt | 0 .../bold-italic/fira-sans-bold-italic.otf | Bin .../bold/fira-sans-bold.otf | Bin .../italic/fira-sans-italic.otf | Bin .../regular/fira-sans.otf | Bin .../fonts/{default-mono => code}/LICENSE.txt | 0 .../fonts/{default-mono => code}/fira-mono.otf | Bin .../fonts/{default-emoji => emoji}/LICENSE_OFL.txt | 0 .../{default-emoji => emoji}/NotoEmoji-Regular.ttf | Bin .../fonts/{default-emoji => emoji}/README | 0 .../{default-fallback => fallback}/LICENSE_OFL.txt | 0 .../bold-italic/NotoSans-BoldItalic.ttf | Bin .../bold/NotoSans-Bold.ttf | Bin .../italic/NotoSans-Italic.ttf | Bin .../regular/NotoSans-Regular.ttf | Bin .../fonts/{default-sans => heading}/LICENSE.txt | 0 .../bold-italic/fira-sans-light-bold-italic.otf | Bin .../bold/fira-sans-light-bold.otf | Bin .../italic/fira-sans-light-italic.otf | Bin .../regular/fira-sans-light.otf | Bin .../fonts/{default-math => math}/LICENSE_OFL.txt | 0 .../{default-math => math}/NotoSansMath-Regular.ttf | Bin .../fonts/{default-serif => text}/LICENSE.md | 0 .../bold-italic/SourceSerifPro-BoldIt.otf | Bin .../bold/SourceSerifPro-Bold.otf | Bin .../italic/SourceSerifPro-It.otf | Bin .../regular/SourceSerifPro-Regular.otf | Bin quad/quadwriter/tags.rkt | 8 ++++---- 31 files changed, 13 insertions(+), 13 deletions(-) rename quad/quadwriter/fonts/{default-heading => blockquote}/LICENSE.txt (100%) rename quad/quadwriter/fonts/{default-sans => blockquote}/bold-italic/fira-sans-bold-italic.otf (100%) rename quad/quadwriter/fonts/{default-sans => blockquote}/bold/fira-sans-bold.otf (100%) rename quad/quadwriter/fonts/{default-sans => blockquote}/italic/fira-sans-italic.otf (100%) rename quad/quadwriter/fonts/{default-sans => blockquote}/regular/fira-sans.otf (100%) rename quad/quadwriter/fonts/{default-mono => code}/LICENSE.txt (100%) rename quad/quadwriter/fonts/{default-mono => code}/fira-mono.otf (100%) rename quad/quadwriter/fonts/{default-emoji => emoji}/LICENSE_OFL.txt (100%) rename quad/quadwriter/fonts/{default-emoji => emoji}/NotoEmoji-Regular.ttf (100%) rename quad/quadwriter/fonts/{default-emoji => emoji}/README (100%) rename quad/quadwriter/fonts/{default-fallback => fallback}/LICENSE_OFL.txt (100%) rename quad/quadwriter/fonts/{default-fallback => fallback}/bold-italic/NotoSans-BoldItalic.ttf (100%) rename quad/quadwriter/fonts/{default-fallback => fallback}/bold/NotoSans-Bold.ttf (100%) rename quad/quadwriter/fonts/{default-fallback => fallback}/italic/NotoSans-Italic.ttf (100%) rename quad/quadwriter/fonts/{default-fallback => fallback}/regular/NotoSans-Regular.ttf (100%) rename quad/quadwriter/fonts/{default-sans => heading}/LICENSE.txt (100%) rename quad/quadwriter/fonts/{default-heading => heading}/bold-italic/fira-sans-light-bold-italic.otf (100%) rename quad/quadwriter/fonts/{default-heading => heading}/bold/fira-sans-light-bold.otf (100%) rename quad/quadwriter/fonts/{default-heading => heading}/italic/fira-sans-light-italic.otf (100%) rename quad/quadwriter/fonts/{default-heading => heading}/regular/fira-sans-light.otf (100%) rename quad/quadwriter/fonts/{default-math => math}/LICENSE_OFL.txt (100%) rename quad/quadwriter/fonts/{default-math => math}/NotoSansMath-Regular.ttf (100%) rename quad/quadwriter/fonts/{default-serif => text}/LICENSE.md (100%) rename quad/quadwriter/fonts/{default-serif => text}/bold-italic/SourceSerifPro-BoldIt.otf (100%) rename quad/quadwriter/fonts/{default-serif => text}/bold/SourceSerifPro-Bold.otf (100%) rename quad/quadwriter/fonts/{default-serif => text}/italic/SourceSerifPro-It.otf (100%) rename quad/quadwriter/fonts/{default-serif => text}/regular/SourceSerifPro-Regular.otf (100%) diff --git a/quad/quad/scribblings/quad.scrbl b/quad/quad/scribblings/quad.scrbl index 7cfa7e79..4583018c 100644 --- a/quad/quad/scribblings/quad.scrbl +++ b/quad/quad/scribblings/quad.scrbl @@ -119,7 +119,7 @@ Next, on the REPL enter this: You will see the actual input to Quadwriter, which is called a @tech{Q-expression}: @repl-output{ -'(q () (q ((page-margin-left "120") (page-margin-top "80") (page-margin-bottom "120") (font-family "default-serif") (line-height "17")) (q ((keep-first-lines "2") (keep-last-lines "3") (font-size-adjust "100%") (character-tracking "0") (hyphenate "true") (display "g49598")) "Brennan and Dale like fancy sauce."))) +'(q () (q ((page-margin-left "120") (page-margin-top "80") (page-margin-bottom "120") (font-family "text") (line-height "17")) (q ((keep-first-lines "2") (keep-last-lines "3") (font-size-adjust "100%") (character-tracking "0") (hyphenate "true") (display "g49598")) "Brennan and Dale like fancy sauce."))) } In the demos that follow, the input language will change slightly. But the PDF will be rendered the same way (by running the source file) and you can always look at @racket[doc] or use @racket[view-result]. @@ -172,9 +172,9 @@ To see this: '(q () (q - ((page-margin-left "120") (page-margin-top "80") (page-margin-bottom "120") (font-family "default-serif") (line-height "17")) + ((page-margin-left "120") (page-margin-top "80") (page-margin-bottom "120") (font-family "text") (line-height "17")) (q ((break "para"))) - (q ((font-family "default-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?") + (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?") ยทยทยท } @@ -247,7 +247,7 @@ Brennan and Dale like fancy sauce. In the REPL, the @racket[doc] was this Q-expression: @repl-output{ -'(q () (q ((page-margin-left "120") (page-margin-top "80") (page-margin-bottom "120") (font-family "default-serif") (line-height "17")) "Brennan and Dale like fancy sauce.")) +'(q () (q ((page-margin-left "120") (page-margin-top "80") (page-margin-bottom "120") (font-family "text") (line-height "17")) "Brennan and Dale like fancy sauce.")) } Let's copy this Q-expression and use it as our new source code. This time, however, we'll switch to plain @code{#lang quadwriter} (instead of the @racket[markup] or @racket[markdown] dialects): @@ -256,7 +256,7 @@ Let's copy this Q-expression and use it as our new source code. This time, howev @codeblock|{ #lang quadwriter '(q () (q ((page-margin-left "120") (page-margin-top "80") -(page-margin-bottom "120") (font-family "default-serif") +(page-margin-bottom "120") (font-family "text") (line-height "17")) "Brennan and Dale like fancy sauce.")) }| ] diff --git a/quad/quadwriter/core.rkt b/quad/quadwriter/core.rkt index 6449cedd..d9be37bb 100644 --- a/quad/quadwriter/core.rkt +++ b/quad/quadwriter/core.rkt @@ -686,9 +686,9 @@ (setup-font-path-table! pdf-path) (parameterize ([current-missing-glyph-action 'fallback]) (time-name atomize (atomize qx #:attrs-proc handle-cascading-attrs - #:fallback "default-fallback" - #:emoji "default-emoji" - #:math "default-math" + #:fallback "fallback" + #:emoji "emoji" + #:math "math" #:font-path-resolver resolve-font-path))))) ;; page size can be specified by name, or measurements. diff --git a/quad/quadwriter/font.rkt b/quad/quadwriter/font.rkt index f56c74cd..f998be51 100644 --- a/quad/quadwriter/font.rkt +++ b/quad/quadwriter/font.rkt @@ -7,7 +7,7 @@ (define-runtime-path quadwriter-fonts-dir "fonts") (define-runtime-path default-font-face "fonts/default/SourceSerifPro-Regular.otf") -(define default-font-family "default-serif") +(define default-font-family "text") (define default-font-size 12) (define default-line-height 16) (define default-font-color "black") diff --git a/quad/quadwriter/fonts/default-heading/LICENSE.txt b/quad/quadwriter/fonts/blockquote/LICENSE.txt similarity index 100% rename from quad/quadwriter/fonts/default-heading/LICENSE.txt rename to quad/quadwriter/fonts/blockquote/LICENSE.txt diff --git a/quad/quadwriter/fonts/default-sans/bold-italic/fira-sans-bold-italic.otf b/quad/quadwriter/fonts/blockquote/bold-italic/fira-sans-bold-italic.otf similarity index 100% rename from quad/quadwriter/fonts/default-sans/bold-italic/fira-sans-bold-italic.otf rename to quad/quadwriter/fonts/blockquote/bold-italic/fira-sans-bold-italic.otf diff --git a/quad/quadwriter/fonts/default-sans/bold/fira-sans-bold.otf b/quad/quadwriter/fonts/blockquote/bold/fira-sans-bold.otf similarity index 100% rename from quad/quadwriter/fonts/default-sans/bold/fira-sans-bold.otf rename to quad/quadwriter/fonts/blockquote/bold/fira-sans-bold.otf diff --git a/quad/quadwriter/fonts/default-sans/italic/fira-sans-italic.otf b/quad/quadwriter/fonts/blockquote/italic/fira-sans-italic.otf similarity index 100% rename from quad/quadwriter/fonts/default-sans/italic/fira-sans-italic.otf rename to quad/quadwriter/fonts/blockquote/italic/fira-sans-italic.otf diff --git a/quad/quadwriter/fonts/default-sans/regular/fira-sans.otf b/quad/quadwriter/fonts/blockquote/regular/fira-sans.otf similarity index 100% rename from quad/quadwriter/fonts/default-sans/regular/fira-sans.otf rename to quad/quadwriter/fonts/blockquote/regular/fira-sans.otf diff --git a/quad/quadwriter/fonts/default-mono/LICENSE.txt b/quad/quadwriter/fonts/code/LICENSE.txt similarity index 100% rename from quad/quadwriter/fonts/default-mono/LICENSE.txt rename to quad/quadwriter/fonts/code/LICENSE.txt diff --git a/quad/quadwriter/fonts/default-mono/fira-mono.otf b/quad/quadwriter/fonts/code/fira-mono.otf similarity index 100% rename from quad/quadwriter/fonts/default-mono/fira-mono.otf rename to quad/quadwriter/fonts/code/fira-mono.otf diff --git a/quad/quadwriter/fonts/default-emoji/LICENSE_OFL.txt b/quad/quadwriter/fonts/emoji/LICENSE_OFL.txt similarity index 100% rename from quad/quadwriter/fonts/default-emoji/LICENSE_OFL.txt rename to quad/quadwriter/fonts/emoji/LICENSE_OFL.txt diff --git a/quad/quadwriter/fonts/default-emoji/NotoEmoji-Regular.ttf b/quad/quadwriter/fonts/emoji/NotoEmoji-Regular.ttf similarity index 100% rename from quad/quadwriter/fonts/default-emoji/NotoEmoji-Regular.ttf rename to quad/quadwriter/fonts/emoji/NotoEmoji-Regular.ttf diff --git a/quad/quadwriter/fonts/default-emoji/README b/quad/quadwriter/fonts/emoji/README similarity index 100% rename from quad/quadwriter/fonts/default-emoji/README rename to quad/quadwriter/fonts/emoji/README diff --git a/quad/quadwriter/fonts/default-fallback/LICENSE_OFL.txt b/quad/quadwriter/fonts/fallback/LICENSE_OFL.txt similarity index 100% rename from quad/quadwriter/fonts/default-fallback/LICENSE_OFL.txt rename to quad/quadwriter/fonts/fallback/LICENSE_OFL.txt diff --git a/quad/quadwriter/fonts/default-fallback/bold-italic/NotoSans-BoldItalic.ttf b/quad/quadwriter/fonts/fallback/bold-italic/NotoSans-BoldItalic.ttf similarity index 100% rename from quad/quadwriter/fonts/default-fallback/bold-italic/NotoSans-BoldItalic.ttf rename to quad/quadwriter/fonts/fallback/bold-italic/NotoSans-BoldItalic.ttf diff --git a/quad/quadwriter/fonts/default-fallback/bold/NotoSans-Bold.ttf b/quad/quadwriter/fonts/fallback/bold/NotoSans-Bold.ttf similarity index 100% rename from quad/quadwriter/fonts/default-fallback/bold/NotoSans-Bold.ttf rename to quad/quadwriter/fonts/fallback/bold/NotoSans-Bold.ttf diff --git a/quad/quadwriter/fonts/default-fallback/italic/NotoSans-Italic.ttf b/quad/quadwriter/fonts/fallback/italic/NotoSans-Italic.ttf similarity index 100% rename from quad/quadwriter/fonts/default-fallback/italic/NotoSans-Italic.ttf rename to quad/quadwriter/fonts/fallback/italic/NotoSans-Italic.ttf diff --git a/quad/quadwriter/fonts/default-fallback/regular/NotoSans-Regular.ttf b/quad/quadwriter/fonts/fallback/regular/NotoSans-Regular.ttf similarity index 100% rename from quad/quadwriter/fonts/default-fallback/regular/NotoSans-Regular.ttf rename to quad/quadwriter/fonts/fallback/regular/NotoSans-Regular.ttf diff --git a/quad/quadwriter/fonts/default-sans/LICENSE.txt b/quad/quadwriter/fonts/heading/LICENSE.txt similarity index 100% rename from quad/quadwriter/fonts/default-sans/LICENSE.txt rename to quad/quadwriter/fonts/heading/LICENSE.txt diff --git a/quad/quadwriter/fonts/default-heading/bold-italic/fira-sans-light-bold-italic.otf b/quad/quadwriter/fonts/heading/bold-italic/fira-sans-light-bold-italic.otf similarity index 100% rename from quad/quadwriter/fonts/default-heading/bold-italic/fira-sans-light-bold-italic.otf rename to quad/quadwriter/fonts/heading/bold-italic/fira-sans-light-bold-italic.otf diff --git a/quad/quadwriter/fonts/default-heading/bold/fira-sans-light-bold.otf b/quad/quadwriter/fonts/heading/bold/fira-sans-light-bold.otf similarity index 100% rename from quad/quadwriter/fonts/default-heading/bold/fira-sans-light-bold.otf rename to quad/quadwriter/fonts/heading/bold/fira-sans-light-bold.otf diff --git a/quad/quadwriter/fonts/default-heading/italic/fira-sans-light-italic.otf b/quad/quadwriter/fonts/heading/italic/fira-sans-light-italic.otf similarity index 100% rename from quad/quadwriter/fonts/default-heading/italic/fira-sans-light-italic.otf rename to quad/quadwriter/fonts/heading/italic/fira-sans-light-italic.otf diff --git a/quad/quadwriter/fonts/default-heading/regular/fira-sans-light.otf b/quad/quadwriter/fonts/heading/regular/fira-sans-light.otf similarity index 100% rename from quad/quadwriter/fonts/default-heading/regular/fira-sans-light.otf rename to quad/quadwriter/fonts/heading/regular/fira-sans-light.otf diff --git a/quad/quadwriter/fonts/default-math/LICENSE_OFL.txt b/quad/quadwriter/fonts/math/LICENSE_OFL.txt similarity index 100% rename from quad/quadwriter/fonts/default-math/LICENSE_OFL.txt rename to quad/quadwriter/fonts/math/LICENSE_OFL.txt diff --git a/quad/quadwriter/fonts/default-math/NotoSansMath-Regular.ttf b/quad/quadwriter/fonts/math/NotoSansMath-Regular.ttf similarity index 100% rename from quad/quadwriter/fonts/default-math/NotoSansMath-Regular.ttf rename to quad/quadwriter/fonts/math/NotoSansMath-Regular.ttf diff --git a/quad/quadwriter/fonts/default-serif/LICENSE.md b/quad/quadwriter/fonts/text/LICENSE.md similarity index 100% rename from quad/quadwriter/fonts/default-serif/LICENSE.md rename to quad/quadwriter/fonts/text/LICENSE.md diff --git a/quad/quadwriter/fonts/default-serif/bold-italic/SourceSerifPro-BoldIt.otf b/quad/quadwriter/fonts/text/bold-italic/SourceSerifPro-BoldIt.otf similarity index 100% rename from quad/quadwriter/fonts/default-serif/bold-italic/SourceSerifPro-BoldIt.otf rename to quad/quadwriter/fonts/text/bold-italic/SourceSerifPro-BoldIt.otf diff --git a/quad/quadwriter/fonts/default-serif/bold/SourceSerifPro-Bold.otf b/quad/quadwriter/fonts/text/bold/SourceSerifPro-Bold.otf similarity index 100% rename from quad/quadwriter/fonts/default-serif/bold/SourceSerifPro-Bold.otf rename to quad/quadwriter/fonts/text/bold/SourceSerifPro-Bold.otf diff --git a/quad/quadwriter/fonts/default-serif/italic/SourceSerifPro-It.otf b/quad/quadwriter/fonts/text/italic/SourceSerifPro-It.otf similarity index 100% rename from quad/quadwriter/fonts/default-serif/italic/SourceSerifPro-It.otf rename to quad/quadwriter/fonts/text/italic/SourceSerifPro-It.otf diff --git a/quad/quadwriter/fonts/default-serif/regular/SourceSerifPro-Regular.otf b/quad/quadwriter/fonts/text/regular/SourceSerifPro-Regular.otf similarity index 100% rename from quad/quadwriter/fonts/default-serif/regular/SourceSerifPro-Regular.otf rename to quad/quadwriter/fonts/text/regular/SourceSerifPro-Regular.otf diff --git a/quad/quadwriter/tags.rkt b/quad/quadwriter/tags.rkt index 4caf2723..76b0144f 100644 --- a/quad/quadwriter/tags.rkt +++ b/quad/quadwriter/tags.rkt @@ -27,7 +27,7 @@ (first-line-indent "0") (background-color "#eee") (clip "true") - (font-family "default-sans") (font-size "10") (line-height "14") + (font-family "blockquote") (font-size "10") (line-height "14") (border-width-top "0.5") (border-color-top "gray") (border-inset-top "8") (border-width-left "3") (border-color-left "gray") (border-inset-left "20") (border-width-bottom "0.5") (border-color-bottom "gray") (border-inset-bottom "-2") @@ -53,7 +53,7 @@ (define-syntax-rule (attr-list . attrs) 'attrs) (define (heading-base font-size attrs exprs) - (qexpr (append `((font-family "default-heading") (first-line-indent "0") (display "block") (font-size ,(number->string font-size))(line-height ,(number->string (* 1.2 font-size))) (border-width-top "0.5")(border-inset-top "9") (inset-bottom "-3") (inset-top "6") (keep-with-next "true")) attrs) exprs)) + (qexpr (append `((font-family "heading") (first-line-indent "0") (display "block") (font-size ,(number->string font-size))(line-height ,(number->string (* 1.2 font-size))) (border-width-top "0.5")(border-inset-top "9") (inset-bottom "-3") (inset-top "6") (keep-with-next "true")) attrs) exprs)) (define-tag-function (h1 attrs exprs) (heading-base 20 (append '() attrs) exprs)) @@ -66,7 +66,7 @@ (define h6 h3) (define-tag-function (code attrs exprs) - (qexpr (append '((font-family "default-mono")#;(line-align "right")(font-size "10")(bg "aliceblue")) attrs) exprs)) + (qexpr (append '((font-family "code")#;(line-align "right")(font-size "10")(bg "aliceblue")) attrs) exprs)) (define-tag-function (pre attrs exprs) ;; pre needs to convert white space to equivalent layout elements @@ -78,7 +78,7 @@ (qexpr (list* '(display "block") '(background-color "aliceblue") '(first-line-indent "0") '(clip "true") - '(font-family "default-mono") '(font-size "11") '(line-height "14") + '(font-family "code") '(font-size "11") '(line-height "14") '(border-inset-top "10") '(border-width-left "2") '(border-color-left "#669") '(border-inset-left "0") '(border-inset-bottom "-4")