From e367d38c20990967be56583da7e8e57db5b98cf0 Mon Sep 17 00:00:00 2001 From: Ben Webber Date: Sun, 1 Oct 2017 16:04:59 +0000 Subject: [PATCH 1/9] Extract title font definitions --- dnd.sty | 1 + lib/dndfonts.sty | 1 + lib/dndsections.sty | 10 +++++----- 3 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 lib/dndfonts.sty diff --git a/dnd.sty b/dnd.sty index d322cac1..5a63ada7 100644 --- a/dnd.sty +++ b/dnd.sty @@ -37,6 +37,7 @@ % Load other modules of this package \RequirePackage{lib/dndcolors} % color definitions +\RequirePackage{lib/dndfonts} % font definitions \RequirePackage{lib/dndcomment} % \commentbox definition \RequirePackage{lib/dndheader} % fancy headers and footers \RequirePackage{lib/dndmonster} % \monsterbox definition diff --git a/lib/dndfonts.sty b/lib/dndfonts.sty new file mode 100644 index 00000000..deae4a4a --- /dev/null +++ b/lib/dndfonts.sty @@ -0,0 +1 @@ +\newcommand{\dnd@TitleFont}{\fontfamily{pbk}\selectfont\scshape} diff --git a/lib/dndsections.sty b/lib/dndsections.sty index 35a5cbe5..f650fcbc 100644 --- a/lib/dndsections.sty +++ b/lib/dndsections.sty @@ -7,24 +7,24 @@ % Chapter \titleformat{\chapter} -{\color{titlered}\normalfont\scshape\Huge}{\thechapter\quad}{0pt}{} +{\color{titlered}\dnd@TitleFont\Huge}{\thechapter\quad}{0pt}{} \titlespacing*{\chapter}{0pt}{0pt}{20pt} -\renewcommand\cftchapfont{\color{titlered}\bfseries\scshape} +\renewcommand\cftchapfont{\color{titlered}\dnd@TitleFont\bfseries} % Section \titleformat{\section} -{\color{titlered}\normalfont\scshape\LARGE}{\thesection\quad}{0pt}{} +{\color{titlered}\dnd@TitleFont\LARGE}{\thesection\quad}{0pt}{} % Subsection \titleformat{\subsection} -{\color{titlered}\normalfont\scshape\Large}{\thesubsection\quad}{0pt}{} +{\color{titlered}\dnd@TitleFont\Large}{\thesubsection\quad}{0pt}{} [\titleline{\color{titlegold}\titlerule[1pt]}] % Subsubsection \titleformat{\subsubsection} -{\color{titlered}\normalfont\scshape\large}{\thesubsubsection\quad}{0pt}{}[] +{\color{titlered}\dnd@TitleFont\large}{\thesubsubsection\quad}{0pt}{}[] % Paragraph \titleformat{\paragraph}[runin] From 6aa6f238151e7b6be513a5029d006b610ef0dd7a Mon Sep 17 00:00:00 2001 From: Ben Webber Date: Sun, 1 Oct 2017 16:13:42 +0000 Subject: [PATCH 2/9] Extract table font definitions --- lib/dndfonts.sty | 3 +++ lib/dndtable.sty | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/dndfonts.sty b/lib/dndfonts.sty index deae4a4a..485618e2 100644 --- a/lib/dndfonts.sty +++ b/lib/dndfonts.sty @@ -1 +1,4 @@ \newcommand{\dnd@TitleFont}{\fontfamily{pbk}\selectfont\scshape} + +\newcommand{\dnd@TableTitleFont}{\fontfamily{fosj}\selectfont\bfseries\scshape} +\newcommand{\dnd@TableBodyFont}{\fontfamily{lmss}\selectfont} diff --git a/lib/dndtable.sty b/lib/dndtable.sty index 3461fd2f..d8426175 100644 --- a/lib/dndtable.sty +++ b/lib/dndtable.sty @@ -2,7 +2,7 @@ \newcommand{\header}[1]{{ \par\vspace*{8pt} \noindent - \sffamily\bfseries\scshape + \dnd@TableTitleFont #1}} % Centered Column @@ -12,7 +12,7 @@ \NewDocumentEnvironment{dndtable}{O{XX} O{tablecolor}}{% \par\vspace*{8pt} \noindent - \fontfamily{lmss}\selectfont + \dnd@TableBodyFont \rowcolors{1}{}{#2} \tabularx{\linewidth}{#1} }{% @@ -25,7 +25,7 @@ \dnd@deprecate{dnditemtable}{0.7}[Set tablecolor and use dndtable instead.] \par\vspace*{8pt} \noindent - \fontfamily{lmss}\selectfont + \dnd@TableBodyFont \rowcolors{1}{}{DmgCoral} \tabularx{\linewidth}{#1} }{% From 5d6c6fd0a9ee801e486e40af026cbef71ec365c1 Mon Sep 17 00:00:00 2001 From: Ben Webber Date: Sun, 1 Oct 2017 16:18:40 +0000 Subject: [PATCH 3/9] Extract box font definitions --- lib/dndcomment.sty | 4 ++-- lib/dndfonts.sty | 3 +++ lib/dndpaperbox.sty | 4 ++-- lib/dndquote.sty | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/dndcomment.sty b/lib/dndcomment.sty index ab9cf1f3..f7bed503 100644 --- a/lib/dndcomment.sty +++ b/lib/dndcomment.sty @@ -11,8 +11,8 @@ left=8pt, right=8pt, arc=0mm, - fonttitle=\fontfamily{fosj}\selectfont\scshape\bfseries\color{black}, - fontupper=\fontfamily{lmss}\selectfont, + fonttitle=\dnd@BoxTitleFont\color{black}, + fontupper=\dnd@BoxBodyFont, title={#2}, parbox=false, colback={#3}, diff --git a/lib/dndfonts.sty b/lib/dndfonts.sty index 485618e2..572db532 100644 --- a/lib/dndfonts.sty +++ b/lib/dndfonts.sty @@ -2,3 +2,6 @@ \newcommand{\dnd@TableTitleFont}{\fontfamily{fosj}\selectfont\bfseries\scshape} \newcommand{\dnd@TableBodyFont}{\fontfamily{lmss}\selectfont} + +\newcommand{\dnd@BoxTitleFont}{\fontfamily{fosj}\selectfont\bfseries\scshape} +\newcommand{\dnd@BoxBodyFont}{\fontfamily{lmss}\selectfont} diff --git a/lib/dndpaperbox.sty b/lib/dndpaperbox.sty index bc66f423..83ec330f 100644 --- a/lib/dndpaperbox.sty +++ b/lib/dndpaperbox.sty @@ -9,8 +9,8 @@ boxsep=0.25ex, left=8pt, right=8pt, - fonttitle=\fontfamily{fosj}\selectfont\scshape\bfseries\color{black}, - fontupper=\fontfamily{lmss}\selectfont, + fonttitle=\dnd@BoxTitleFont\color{black}, + fontupper=\dnd@BoxBodyFont, title={#2}, arc=0mm, parbox=false, diff --git a/lib/dndquote.sty b/lib/dndquote.sty index 6b07c743..85b8b9fc 100644 --- a/lib/dndquote.sty +++ b/lib/dndquote.sty @@ -16,7 +16,7 @@ parbox=false, borderline west={1pt}{-0.5pt}{titlered}, borderline east={1pt}{-0.5pt}{titlered}, - fontupper=\fontfamily{lmss}\selectfont, + fontupper=\dnd@BoxBodyFont, overlay={% \foreach\n in {north east,north west,south east,south west} {\draw[titlered, fill=titlered] (frame.\n) circle (2pt); }; }, From 0acca8bc164c5ae2b0abe1493c677757357a1a4f Mon Sep 17 00:00:00 2001 From: Ben Webber Date: Sun, 1 Oct 2017 16:31:21 +0000 Subject: [PATCH 4/9] Extract stat block font definitions Fixes `monstersection` font family: the books use Scala Sans for the "Actions" header. --- lib/dndfonts.sty | 4 ++++ lib/dndmonster.sty | 13 +++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/dndfonts.sty b/lib/dndfonts.sty index 572db532..a8c5d3cf 100644 --- a/lib/dndfonts.sty +++ b/lib/dndfonts.sty @@ -5,3 +5,7 @@ \newcommand{\dnd@BoxTitleFont}{\fontfamily{fosj}\selectfont\bfseries\scshape} \newcommand{\dnd@BoxBodyFont}{\fontfamily{lmss}\selectfont} + +\newcommand{\dnd@StatBlockTitleFont}{\fontfamily{pbk}\selectfont\bfseries\scshape} +\newcommand{\dnd@StatBlockSubtitleFont}{\fontfamily{fosj}\selectfont\scshape} +\newcommand{\dnd@StatBlockBodyFont}{\fontfamily{lmss}\selectfont} diff --git a/lib/dndmonster.sty b/lib/dndmonster.sty index d62f393c..6ec372d1 100644 --- a/lib/dndmonster.sty +++ b/lib/dndmonster.sty @@ -50,8 +50,8 @@ arc=0mm, opacityback=0, colframe=titlered, - fonttitle=\scshape\bfseries\color{titlered}\Large, - fontupper=\fontfamily{lmss}\selectfont, + fonttitle=\dnd@StatBlockTitleFont\color{titlered}\Large, + fontupper=\dnd@StatBlockBodyFont, title=#2, after={\vspace{7pt plus 1pt}\noindent}, #1 @@ -76,8 +76,8 @@ colback=statblockbg, colbacktitle=statblockbg, colframe=titlered, - fonttitle=\scshape\bfseries\color{titlered}\Large, - fontupper=\fontfamily{lmss}\selectfont, + fonttitle=\dnd@StatBlockTitleFont\color{titlered}\Large, + fontupper=\dnd@StatBlockBodyFont, title=#2, after={\vspace{7pt plus 1pt}\noindent}, #1 @@ -88,13 +88,10 @@ %\newcommand{\monstersection}[1]{\subsubsection*{#1}} \newcommand{\monstersection}[1]{ {\par - \color{titlered}\normalfont\scshape\Large #1 \vspace{3pt} + \color{titlered}\dnd@StatBlockSubtitleFont\large #1 \vspace{3pt} \titleline{\color{titlered}\titlerule[0.6pt]} \par\medskip} } -%\titlespacing*{\subsubsection}{0pt}{*0.5}{5pt} -%\titleformat{\subsubsection} -%{\color{titlered}\normalfont\scshape\Large}{\thesubsection}{1em}{}[{\color{titlered}\titlerule[0.5pt]\color{black}}] \newenvironment{monsteraction}[1][\unskip]{\emph{\textbf{#1.}}}{\vspace{0.5em}} From bc6f0f57eeccba65541360de12af3c2e4d49fccf Mon Sep 17 00:00:00 2001 From: Ben Webber Date: Sun, 1 Oct 2017 16:47:36 +0000 Subject: [PATCH 5/9] Extract footer font definitions --- lib/dndfonts.sty | 3 +++ lib/dndheader.sty | 12 ++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/dndfonts.sty b/lib/dndfonts.sty index a8c5d3cf..bebb3ff7 100644 --- a/lib/dndfonts.sty +++ b/lib/dndfonts.sty @@ -9,3 +9,6 @@ \newcommand{\dnd@StatBlockTitleFont}{\fontfamily{pbk}\selectfont\bfseries\scshape} \newcommand{\dnd@StatBlockSubtitleFont}{\fontfamily{fosj}\selectfont\scshape} \newcommand{\dnd@StatBlockBodyFont}{\fontfamily{lmss}\selectfont} + +\newcommand{\dnd@FooterFont}{\fontfamily{pbk}\selectfont\scshape} +\newcommand{\dnd@PageNumberFont}{\fontfamily{pbk}\selectfont} diff --git a/lib/dndheader.sty b/lib/dndheader.sty index 55de7bbc..8865c960 100644 --- a/lib/dndheader.sty +++ b/lib/dndheader.sty @@ -29,12 +29,12 @@ \iftoggle{bool-footer-scroll}{ \begin{tikzpicture}[remember picture,overlay] \node[xscale=-1,inner sep=0pt,anchor=south,nearly opaque] at (current page.south) {\includegraphics[width=\paperwidth,height=43pt]{img/footerscroll}}; - \node[xshift=20pt,yshift=30pt] at (current page.south west) {\textcolor{pagegold}{\thepage}}; - \node[anchor=south west,xshift=\marginparwidth+\marginparpush,yshift=27pt] at (current page.south west) {\textsc{\textcolor{pagegold}{\nouppercase\leftmark}}}; + \node[xshift=20pt,yshift=30pt] at (current page.south west) {\dnd@PageNumberFont\textcolor{pagegold}{\thepage}}; + \node[anchor=south west,xshift=\marginparwidth+\marginparpush,yshift=27pt] at (current page.south west) {\dnd@FooterFont{\textcolor{pagegold}{\nouppercase\leftmark}}}; \end{tikzpicture} }{ \begin{tikzpicture}[remember picture,overlay] - \node[anchor=south west,xshift=\marginparwidth-\marginparpush,yshift=\nobgfooterheight+2pt] at (current page.south west) {\textbf{\thepage}}; + \node[anchor=south west,xshift=\marginparwidth-\marginparpush,yshift=\nobgfooterheight+2pt] at (current page.south west) {\dnd@PageNumberFont{\thepage}}; \node[anchor=south west,xshift=\marginparwidth+\marginparpush,yshift=\nobgfooterheight] at (current page.south west) {\leftmark}; \end{tikzpicture} } @@ -44,12 +44,12 @@ \iftoggle{bool-footer-scroll}{ \begin{tikzpicture}[remember picture,overlay] \node[inner sep=0pt,anchor=south,nearly opaque] at (current page.south) {\includegraphics[width=\paperwidth,height=43pt]{img/footerscroll}}; - \node[xshift=-20pt,yshift=30pt] at (current page.south east) {\textcolor{pagegold}{\thepage}}; - \node[anchor=south east,xshift=-\marginparwidth-\marginparpush,yshift=27pt] at (current page.south east) {\textsc{\textcolor{pagegold}{\nouppercase\leftmark}}}; + \node[xshift=-20pt,yshift=30pt] at (current page.south east) {\dnd@PageNumberFont\textcolor{pagegold}{\thepage}}; + \node[anchor=south east,xshift=-\marginparwidth-\marginparpush,yshift=27pt] at (current page.south east) {\dnd@FooterFont{\textcolor{pagegold}{\nouppercase\leftmark}}}; \end{tikzpicture} }{ \begin{tikzpicture}[remember picture,overlay] - \node[anchor=south east,xshift=-\marginparwidth+2\marginparpush,yshift=\nobgfooterheight+2pt] at (current page.south east) {\textbf{\thepage}}; + \node[anchor=south east,xshift=-\marginparwidth+2\marginparpush,yshift=\nobgfooterheight+2pt] at (current page.south east) {\dnd@PageNumberFont{\thepage}}; \node[anchor=south east,xshift=-\marginparwidth,yshift=\nobgfooterheight] at (current page.south east) {\leftmark}; \end{tikzpicture} } From 74bcd20c0fdbc61cdb12a63bd5d829fd4e4d5816 Mon Sep 17 00:00:00 2001 From: Ben Webber Date: Sun, 1 Oct 2017 17:16:47 +0000 Subject: [PATCH 6/9] Reduce repetition in font definitions --- dnd.sty | 2 -- lib/dndfonts.sty | 19 ++++++++++++------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/dnd.sty b/dnd.sty index 5a63ada7..0c0cb225 100644 --- a/dnd.sty +++ b/dnd.sty @@ -16,8 +16,6 @@ bottom=50pt, % .7in footskip=30pt, % makes the footer text line up with the graphic ]{geometry} -\RequirePackage{bookman} % Closest built-in font I could find -\RequirePackage[T1]{fontenc} \RequirePackage[table]{xcolor} \RequirePackage{array} \RequirePackage{tabularx} diff --git a/lib/dndfonts.sty b/lib/dndfonts.sty index bebb3ff7..247456c5 100644 --- a/lib/dndfonts.sty +++ b/lib/dndfonts.sty @@ -1,14 +1,19 @@ -\newcommand{\dnd@TitleFont}{\fontfamily{pbk}\selectfont\scshape} +\RequirePackage{bookman} +\RequirePackage[T1]{fontenc} + +\renewcommand{\sfdefault}{lmss} + +\newcommand{\dnd@TitleFont}{\normalfont\scshape} \newcommand{\dnd@TableTitleFont}{\fontfamily{fosj}\selectfont\bfseries\scshape} -\newcommand{\dnd@TableBodyFont}{\fontfamily{lmss}\selectfont} +\newcommand{\dnd@TableBodyFont}{\sffamily} \newcommand{\dnd@BoxTitleFont}{\fontfamily{fosj}\selectfont\bfseries\scshape} -\newcommand{\dnd@BoxBodyFont}{\fontfamily{lmss}\selectfont} +\newcommand{\dnd@BoxBodyFont}{\sffamily} -\newcommand{\dnd@StatBlockTitleFont}{\fontfamily{pbk}\selectfont\bfseries\scshape} +\newcommand{\dnd@StatBlockTitleFont}{\normalfont\bfseries\scshape} \newcommand{\dnd@StatBlockSubtitleFont}{\fontfamily{fosj}\selectfont\scshape} -\newcommand{\dnd@StatBlockBodyFont}{\fontfamily{lmss}\selectfont} +\newcommand{\dnd@StatBlockBodyFont}{\sffamily} -\newcommand{\dnd@FooterFont}{\fontfamily{pbk}\selectfont\scshape} -\newcommand{\dnd@PageNumberFont}{\fontfamily{pbk}\selectfont} +\newcommand{\dnd@FooterFont}{\normalfont\scshape} +\newcommand{\dnd@PageNumberFont}{\normalfont} From e2b1efbfc376bf0747e79d97eb4f026abe464945 Mon Sep 17 00:00:00 2001 From: Ben Webber Date: Wed, 4 Oct 2017 06:44:39 +0000 Subject: [PATCH 7/9] Deprecate unused lmss environment --- CHANGELOG.md | 1 + dnd.sty | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d78ef0c7..61580d0e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -49,6 +49,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. * Deprecated `dnditemtable`. * Deprecated `bg-a4` and `bg-letter` package options. +* Deprecated `lmss` environment. ## [0.5] - 2016-03-24 diff --git a/dnd.sty b/dnd.sty index 0c0cb225..ad054c01 100644 --- a/dnd.sty +++ b/dnd.sty @@ -85,7 +85,10 @@ \setlength{\parskip}{0pt} % Font environment -\newenvironment{lmss}{\fontfamily{lmss}\selectfont}{} +\newenvironment{lmss}{% + \dnd@deprecate{lmss}{0.7} + \fontfamily{lmss}\selectfont + }{} % Columns setup \setlength{\columnsep}{25pt} % .35in From 8f3eb0a9e59544447e0c96a7cd326e2d6a4e0747 Mon Sep 17 00:00:00 2001 From: Ben Webber Date: Wed, 4 Oct 2017 06:51:43 +0000 Subject: [PATCH 8/9] Document deprecated package options in README --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 3a5e05a8..5d13e7de 100644 --- a/README.md +++ b/README.md @@ -76,13 +76,13 @@ Load the template in your preamble: ### Package options -| Option | Description | Default | -|-------------|-------------------------------------------------------------------|:-------:| -| `bg-letter` | Loads a letter-sized background image | ✓ | -| `bg-a4` | Loads an A4-sized background image | | -| `bg-print` | Loads a printer-friendly background-image (only the footer image) | | -| `bg-full` | Loads the full background image | ✓ | -| `justified` | Justifies column copy | | +| Option | Description | Default | +|--------------------------|-------------------------------------------------------------------|:-------:| +| `bg-a4` (deprecated) | Loads an A4-sized background image | | +| `bg-full` | Loads the full background image | ✓ | +| `bg-letter` (deprecated) | Loads a letter-sized background image | | +| `bg-print` | Loads a printer-friendly background-image (only the footer image) | | +| `justified` | Justifies column copy | | ## Dependencies From d6956fa4e0bde2e5f5263f28120fe9a48d94030b Mon Sep 17 00:00:00 2001 From: Ben Webber Date: Wed, 4 Oct 2017 17:27:43 +0000 Subject: [PATCH 9/9] Update package option summary in README * Remove deprecated package options. * Add `bg-none` description. * Update `bg-full` and `bg-print` descriptions. --- README.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 5d13e7de..8edee3e4 100644 --- a/README.md +++ b/README.md @@ -76,13 +76,12 @@ Load the template in your preamble: ### Package options -| Option | Description | Default | -|--------------------------|-------------------------------------------------------------------|:-------:| -| `bg-a4` (deprecated) | Loads an A4-sized background image | | -| `bg-full` | Loads the full background image | ✓ | -| `bg-letter` (deprecated) | Loads a letter-sized background image | | -| `bg-print` | Loads a printer-friendly background-image (only the footer image) | | -| `justified` | Justifies column copy | | +| Option | Description | Default | +|-------------|-------------------------------------------|:-------:| +| `bg-full` | Loads both background and footer images | ✓ | +| `bg-none` | Removes both background and footer images | | +| `bg-print` | Loads only the footer image | | +| `justified` | Justifies column copy | | ## Dependencies