diff options
Diffstat (limited to 'Master/texmf-dist/doc/fonts/xcharter/xcharter-doc.tex')
-rw-r--r-- | Master/texmf-dist/doc/fonts/xcharter/xcharter-doc.tex | 156 |
1 files changed, 126 insertions, 30 deletions
diff --git a/Master/texmf-dist/doc/fonts/xcharter/xcharter-doc.tex b/Master/texmf-dist/doc/fonts/xcharter/xcharter-doc.tex index e3e4e0ae482..ebca88246a4 100644 --- a/Master/texmf-dist/doc/fonts/xcharter/xcharter-doc.tex +++ b/Master/texmf-dist/doc/fonts/xcharter/xcharter-doc.tex @@ -1,25 +1,39 @@ -% !TEX TS-program = pdflatexmk +% !TEX TS-program = xelatex \documentclass[11pt]{article} -\pdfcompresslevel=0 -\pdfgentounicode=1 -\input glyphtounicode.tex -\InputIfFileExists{glyphtounicode-cmr.tex}{}{} -\InputIfFileExists{glyphtounicode-ntx.tex}{}{} +%\pdfcompresslevel=0 +%\pdfgentounicode=1 +%\input glyphtounicode.tex +%\InputIfFileExists{glyphtounicode-cmr.tex}{}{} +%\InputIfFileExists{glyphtounicode-ntx.tex}{}{} %\usepackage[a-1b]{pdfx} % version 1.6.4 or higher +\usepackage{trace} \usepackage[margin=1in]{geometry} \usepackage[parfill]{parskip} -\usepackage{graphicx} -\pdfmapfile{=XCharter.map} -%\pdfmapfile{=newtx.map} +\usepackage{graphicx,xcolor} +\ifluatex\else% +\ifxetex\pdfmapfile{+XCharter.map}\pdfmapfile{+newtx.map}% +\else +\pdfmapfile{=XCharter.map}\pdfmapfile{=newtx.map}% +\fi\fi \usepackage[scaled=1.03,varqu,varl]{inconsolata} \usepackage[type1]{cabin} -\usepackage[scaled=.98,osf]{XCharter} \usepackage[OT2,T2A,T1]{fontenc} -\linespread{1.04} -\usepackage[uprightscript,charter,alty,vvarbb,scaled=1.05]{newtxmath} +%\traceon +\usepackage[xcharter,osf,p,mathscale=1.05,textscale=0,uprightscript,vvarbb]{newtx} +\iftutex\setmonofont{lmmono10-regular.otf}[Scale=1.08]\fi +%\usepackage[scaled=.98,osf]{XCharter} +%\linespread{1.04} +%\usepackage[uprightscript,vvarbb,scaled=1.05]{newtxmath} %\usepackage[cal=boondoxo]{mathalfa} -\font\osfIfnt=XCharter-Roman-tosf-t1 at 11pt -\font\osffnt=XCharter1-Roman-tosf-t1 at 11pt +\makeatother +\iftutex + \newfontface\osffnt{XCharter-Roman}[Numbers={Proportional,OldStyle}, CharacterVariant={1:0}]% , Scale = \XCharter@scale] + \newfontface\osfIfnt{XCharter-Roman}[Numbers={Proportional,OldStyle}]%, Scale = \XCharter@scale] +\else + \font\osfIfnt=XCharter-Roman-osf-t1 at 11pt + \font\osffnt=XCharter1-Roman-osf-t1 at 11pt +\fi +\makeatletter \usepackage{fonttable} \usepackage{booktabs} \usepackage{url} @@ -31,8 +45,17 @@ \title{The XCharter Font Package} \author{Michael Sharpe} %\date{} -\usepackage{trace} \begin{document} +%%\traceon +%{\addfontfeatures{RawFeature=+lnum;+tnum}0123456789}\\ +%{\addfontfeatures{RawFeature=+lnum;+pnum}0123456789}\\ +%{\addfontfeatures{RawFeature=+tnum}0123456789}\\ +%0123456789\\ +%{\addfontfeatures{Numbers={Lining,Tabular}}0123456789}\\ +%{\addfontfeatures{Numbers={Lining,Proportional}}0123456789}\\ +%{\addfontfeatures{Numbers={OldStyle,Monospaced}}0123456789}\\ +%%\traceoff +%\end{document} \maketitle %\expandafter\show\csname oldstylenums \endcsname %\traceon\oldstylenums{1}\traceoff @@ -48,36 +71,96 @@ Support files are provided for T$1$, TS$1$, LY$1$, T$2$A and OT$2$ encodings, th \item {\tt scaled=.98}, for example, scales all text to 98\% of specified size; \item {\tt lining} (or just {\tt lf}) makes lining figures ($0123456789$) the default for text---this is set automatically and does not need to be entered explicitly; -\item {\tt oldstyle} (or {\tt osf}) sets the figure style in text mode to oldstyle (\textosf{0123456789}) with numeral one like a shortened $1$, but math mode will always use lining figures; -\item {\tt oldstyleI} (or {\tt osfI}) sets the figure style in text mode to oldstyle (\textosfI{0123456789}) with numeral one like a shortened I, but math mode will always use lining figures; +\item {\tt oldstyle} (or {\tt osf}) sets the figure style in text mode to oldstyle ({\osffnt 0123456789}) with numeral one like a shortened $1$, but math mode will always use lining figures; +\item {\tt oldstyleI} (or {\tt osfI}) sets the figure style in text mode to oldstyle ({\osfIfnt0123456789}) with numeral one like a shortened I, but math mode will always use lining figures; \item {\tt sups} sets the style for superscript figures (e.g., footnote markers) to XCharter's superior figures rather than using the default text inserts in mathematical superscripts. This option has no effect if a KOMA class is in force. \item {\tt scosf} makes oldstyle figures the default in small cap text, no matter what the global figure setting may be. \item {\tt serbianc} is useful only with the T$2$A encoding. It modifies one slot in upright and slanted shapes and five slots in italic shapes, as expected in Serbian Cyrillic. See the last section for examples. -\item As of version 1.22, there is a theorem font option similar to those in newtx and newpx. A new font family, {\tt XCharterTH}, is made from the italic and bold italic faces of {\tt XCharter}, but having upright figures and punctuation that, IMO, look better than slanted ones in theorem statements and the like. For details, consult the brief descriptions below and the more discursive version in the documentation to {\tt newtx}. There is a {\tt theoremfont} option to {\tt XCharter} that works exactly the same as in {\tt newtx}. \end{itemize} +\subsection*{Changes in version 1.23} +There are some substantial additions in version 1.23, some requiring {\tt newtx}, version 1.71 or higher: +\begin{itemize} +\item +{\tt XCharter.sty} now works with all flavors of LaTeX---unicode and non-unicode---but there may be some small differences in output. Essentially all previous options and macros are supported a\and there are new ones available, some of which are limited to unicode engines. +\item Previous versions of {\tt XCharter} had only two normal figure styles: {\tt tabular lining} (the default) and {\tt proportional oldstyle}. Version 1.23 adds two more so there are separate {\tt TLF (tabular lining figures)}, {\tt LF (proportional lining figures)}, {\tt TOsF (tabular oldstyle figures)} and {\tt OsF (proportional oldstyle figures)}. Two new options have been added to globally select the default figures style. Option {\tt p} (or {\tt proportional}) and {\tt t} (or {\tt tabular}). A new command\verb|\useproportional| (preamble only) has the same effect as option {\tt proportional}. +\item With the new figures came new macros to select them, no matter what the defaults may be. There are two forms, one that switches the figures until further notice and the other a macro with an argument. +\begin{center} + \begin{tabular}{@{} cccc @{}} + \toprule + Switch& Command & Effect & Example \\ + \midrule + \verb|\tlfstyle| &\verb|\texttlf| & TLF & \verb|{\tlfstyle123}, \texttlf{123}| \\ + \verb|\lfstyle| &\verb|\textlf| & LF & \verb|{\lfstyle123},\textlf{123}| \\ + \verb|\tosfstyle| &\verb|\texttosf| & TOsF & \verb|{\tosfstyle123},\texttosf{123}| \\ + \verb|\osfstyle| &\verb|\textosf| & OsF & \verb|{\osfstyle123}, \textosf{123}| \\ + \bottomrule + \end{tabular} +\end{center} +There are also the text font switches \verb|\liningnums|, \verb|\tabularnums|, \verb|\oldstylenums| and \verb|\proportionalnums|, each of which changes only one attribute of the figure style and alignment. For example, \verb|\liningnums| changes the style to {\tt lining} and \verb|\tabularnums| changes the figure alignment to {\tt tabular}. +\item +There is a theorem font option similar to those in newtx and newpx. A new font family, {\tt XCharterTH}, is made from the italic and bold italic faces of {\tt XCharter}, but having upright figures and punctuation that, IMO, look better than slanted ones in theorem statements and the like. For details, consult the brief descriptions below and the more discursive version in the documentation to {\tt newtx}. There is a {\tt theoremfont} option to {\tt XCharter} that works exactly the same as in {\tt newtx}. +\item The figure style in {\tt theoremfont} will by default be the same as your chosen figure style. Option {\tt thmlining} will ensure that lining figures are always used. +\item {\tt oldSS} specifies the preference for the old Capital Sharp S rather than the newer form, {\tt U+1E9E}\iftutex, \SS\fi. +\item There are new options that affect only unicode engines: +\begin{itemize} +\item +{\tt nofontspec} prevents {\tt XCharter.sty} from loading {\tt fontspec}. +\item {\tt type1text} (or {\tt type1}) specifies processing the text font using {\tt type1} mode. This does not prevent {\tt fontspec} from loading. +\item {\tt defaultfeatures=} gives you a place to set the default text font features for {\tt fontspac}. +\end{itemize} +\end{itemize} + \textsc{Special Macros:} \begin{itemize} +\item \verb|\useproportional| (usable only in the preamble) may be used for changing the text figure alignment to {\tt proportional} though math mode will use tabular lining figures. (New in 1.23.) \item \verb|\useosf| (usable only in the preamble) may be used for changing the text figure style to {\tt osf} though math mode will use lining figures. \item \verb|\useosfI| (usable only in the preamble) may be used for changing the text figure style to {\tt osfI} though math mode will use lining figures. \item \verb|\textsu| prints its argument in superior figures, e.g., \verb|\textsu{12}| results in \textsu{12}. The effect is the same with \verb|{\sustyle 12}|. \item \verb|\textinf| prints its argument in inferior figures, e.g., \verb|\textinf{12}| results in \textinf{12}. The effect is the same with \verb|{\instyle 12}|. (In versions of {\tt XCharter} prior to $1.221$, \verb|\textinf| was named \verb|\textin|, but the latter conflicts with {\tt hyperref} which redefines it to point to U+2208.) \item \verb|\textlf| prints its argument in lining figures, e.g., \verb|\textlf{12}| results in \textlf{12}. The effect is the same with \verb|{\lfstyle 12}|. -\item \verb|{\osfstyle 23}| prints \textosf{23} using whatever oldstyle option is in force. -\item \verb|\textosf| prints its argument in oldstyle figures using, in effect, the {\tt osf} option---e.g., \verb|\textosf{12}| results in \textosf{12}. -\item \verb|\textosfI| prints its argument in oldstyle figures using, in effect, the {\tt osfI} option---e.g., \verb|\textosfI{12}| results in \textosfI{12}. +\item \verb|{\osfstyle 23}| prints \textosf{23} ({\tt OldStyle,Proportional}) while \verb|{\liningnums 23}| prints {\liningnums 23}, {\tt Lining} with whatever figure alignment is in force. There are also macros \verb|\tabularnums|, \verb|\proportionalnums|, \verb|\oldstylenums|, \verb|\tosfstyle| and \verb|\tlfstyle| with the expected behaviors. +%\item \verb|\textosf| prints its argument in oldstyle figures using, in effect, the {\tt osf} option---e.g., \verb|\textosf{12}| results in \textosf{12}. +%\item \verb|\textosfI| prints its argument in oldstyle figures using, in effect, the {\tt osfI} option---e.g., \verb|\textosfI{12}| results in \textosfI{12}. \item Numerators and denominators are normally used only for constructing fractions, but may if needed be called using \verb|\textnumerator| and \verb|\textdenominator|. They are about 7\% smaller than superiors and inferiors. You may use \verb|\textde| and \verb|\textnu| as abbreviations, though the latter will not be available if {\tt babel} is loaded with {\tt greek} option. \item The \verb|\textfrac| macro allows you to write, e.g., \verb|\textfrac{31}{32}| to get the simple fraction \textfrac{31}{32}, and \verb|\textfrac[2]{31}{32}| to get \textfrac[2]{31}{32}. (The optional argument, $2$ in the latter case, is always typeset in lining figures.) -\item \verb|\textcircled| renders its argument in raised and reduced small caps encircled by the {\tt bigcircle} glyph. E.g., \verb|\textcircled{X}| or \verb|\textcircled{x}| render as \textcircled{x}. The macro works also for numerals: \verb|\textcircled{2}| renders as \textcircled{2}. +\item The \verb|\textsfrac| macro, available only when you use the {\tt newtx} package with option {\tt xcharter} to load {\tt XCharter} with {\tt newtxmath}, allows you to write, e.g., \verb|\textsfrac{31}{32}| to get the simple stacked fraction +\iftutex +\textsfrac{31}{32},\fi + and \verb|\textsfrac[2]{31}{32}| + \iftutex + to get \textsfrac[2]{31}{32}\fi% + . (The optional argument, $2$ in the latter case, is always typeset in lining figures.) + +\item \verb|\textcircled| renders its argument in raised and reduced small caps encircled by the {\tt bigcircle} glyph. E.g., \verb|\textcircled{M}| and \verb|\textcircled{m}| both render as \textcircled{M}. The macro works also for numerals: \verb|\textcircled{2}| renders as \textcircled{2}. \item \verb|\textth| (and also \verb|\textthit|) render their arguments using the theorem fonts. For example:\\ -\verb|\textth{Theorem font (01234):!}| renders as \textth{Theorem font (01234):!} (note the upright figures and punctuation) and \verb|\textbf{\textth{Theorem font (01234):!}}| as \textbf{\textth{Theorem font (01234):!}}. The related font switch \verb|\thfamily| is defined so that, in essence, \verb|{\thfamily A12!}| and \verb|\textth{A12!}| are equivalent. In opentype processing, the {\tt StylisticSet 05} controls whether figures and punctuation are upright in italic shaped faces. +\verb|\textth{Theorem font (01234):!}| renders as \textth{Theorem font (01234):!}---note the upright figures and punctuation. (There is no Bold theorem font---\verb|\textbf{\textth{Theorem font (01234):!}}| renders as \textbf{\textth{Theorem font (01234):!}}.) The related font switch \verb|\thfamily| is defined so that \verb|{\thfamily A12!}| and \verb|\textth{A12!}| are equivalent. In opentype processing, the {\tt StylisticSet 05} controls whether figures and punctuation are upright in italic shaped faces. \end{itemize} +\subsection*{Math package choices:} -Three math packages seem to provide reasonable companions for \textsf{XCharter}. The first example uses Charter italics as math italics, but doesn't provide arbitrary scaling and doesn't sufficiently distinguish math italic v from mathematical Greek \verb|\nu|. Moreover, it is not easy to redefine \verb|\mathcal| to get a better math calligraphic alphabet---e.g., the {\tt mathalfa} package fails. The second uses \textsf{libertine} italics and Greek in math mode, which is a good match to Charter in style and weight after scaling up, is arbitrarily scalable, has distinct math italic v and mathematical Greek \verb|\nu|, and is completely compatible with {\tt mathalfa}. The third is a new revision of {\tt newtxmath} with option {\tt charter} (or, equivalently, {\tt xcharter}), which substitutes Charter italics as math italics and, as of version 1.11, uses a newly developed family of Greek symbols in \{regular, bold\} $\times$ \{upright, italic\} to match the style and italic angle of XCharter. This version is scalable and has a math italic v (plus a matching w) distinct from \verb|\nu|. (The option {\tt noxchvw} to {\tt newtxmath} changes the v and w to be the original Charter italic glyphs, which may lead to issues with \verb|\nu|. The option {\tt alty} to {\tt newtxmath/charter}, new as of version {\tt 1.203}, substitutes $y$ for the default \emph{y} which, IMO, works better in combination with other math symbols because it lacks the problematic tail of \emph{y}.) +There is now a unicode math package, {\tt xcharter-math} that may be run with a simple preamble containing +\begin{verbatim} +\usepackage{fontspec} +\setmainfont{xcharter} +\usepackage{unicode-math} +\setmathfont{XCharter-Math.otf} +\end{verbatim} +or, as described in the documentation for {\tt xcharter-math}, +\begin{verbatim} +\\usepackage{xcharter-otf} +\end{verbatim} +but in order to get the options and macros described in this documentation, you could use instead +\begin{verbatim} +\usepackage{XCharter} % loads fontspec +\usepackage{unicode-math} +\setmathfont{XCharter-Math.otf} +\end{verbatim} + +Three non-unicode math packages seem to provide reasonable companions for \textsf{XCharter}. The first example uses Charter italics as math italics, but doesn't provide arbitrary scaling and doesn't sufficiently distinguish math italic v from mathematical Greek \verb|\nu|. Moreover, it is not easy to redefine \verb|\mathcal| to get a better math calligraphic alphabet---e.g., the {\tt mathalpha} package fails. The second uses \textsf{libertine} italics and Greek in math mode, which is a good match to Charter in style and weight after scaling up, is arbitrarily scalable, has distinct math italic v and mathematical Greek \verb|\nu|, and is completely compatible with {\tt mathalfa}. The third is a new revision of {\tt newtxmath} with option {\tt charter} (or, equivalently, {\tt xcharter}), which substitutes Charter italics as math italics and, as of version 1.11, uses a newly developed family of Greek symbols in \{regular, bold\} $\times$ \{upright, italic\} to match the style and italic angle of XCharter. This version is scalable and has a math italic v (plus a matching w) distinct from \verb|\nu|. (The option {\tt noxchvw} to {\tt newtxmath} changes the v and w to be the original Charter italic glyphs, which may lead to issues with \verb|\nu|. The option {\tt alty} to {\tt newtxmath/charter}, new as of version {\tt 1.203}, substitutes $y$ for the default \emph{y} which, IMO, works better in combination with other math symbols because it lacks the problematic tail of \emph{y}.) %\newpage \textsc{Example 1:} @@ -116,10 +199,24 @@ Three math packages seem to provide reasonable companions for \textsf{XCharter}. \textsc{Example 5:} \begin{verbatim} +% an example using newtx.sty, works with all latex engines +\usepackage[<specify babel languages>]{babel}% load before newtx +\usepackage[scaled=1.04,varqu,varl]{inconsolata}% inconsolata tt +\usepackage[type1]{cabin}% sans serif for math +\usepackage[T1]{fontenc} % encodiing to use for mathtt, etc +\usepackage[xcharter,osf,p,mathscale=1.05,textscale=0,uprightscript,vvarbb]{newtx}% loads newtxmath +% newtx loads fontspec with unicode engines +\setmonofont{lmmono10-regular.otf}[Scale=1.08] % typewriter for text +\linespread{1.04} +% load polyglossia after newtx, if using +\end{verbatim} + +\textsc{Example 6:} +\begin{verbatim} % Adds instructions to produce a pdf conforming to PDF/A-1b -\pdfcompresslevel=0 -\pdfgentounicode=1 -\input glyphtounicode.tex +%\pdfcompresslevel=0 % uncomment for debugging the pdf +%\pdfgentounicode=1 +%\input glyphtounicode.tex % now part of latex \InputIfFileExists{glyphtounicode-cmr.tex}{}{} \InputIfFileExists{glyphtounicode-ntx.tex}{}{} \usepackage[a-1b]{pdfx} % version 1.6.4 or higher @@ -131,7 +228,6 @@ Three math packages seem to provide reasonable companions for \textsf{XCharter}. \\linespread{1.04} \end{verbatim} - Here is a short sample based on the preamble of \textsc{Example 3}:\\[4pt] \def\Pr{\ensuremath{\mathbb{P}}} \def\rmd{\mathrm{d}} @@ -330,11 +426,11 @@ It may be be possible to work out a scheme that would allow multiple scripts and %\textsc{Example 2: \section*{Opentype processing and German orthography} -Prior to version {\tt1.12}, {\tt XCharter} offered only basic support for German orthography, having all required accented glyphs and the lower case \ss, as well as a small caps \textsc{\ss}. Under LaTeX, the T$1$ encoding contained \verb|S_S|. With unicode tex processing: +Prior to version {\tt1.12}, {\tt XCharter} offered only basic support for German orthography, having all required accented glyphs and the lower case \ss, as well as a small caps \textsc{\ss}. Under non-unicode LaTeX, the T$1$ encoding contained \verb|S_S|. With unicode tex processing: \begin{verbatim} {\addfontfeature{StylisticSet=1}\ss\ \textsc{\ss}} \end{verbatim} -typesets, as in LaTeX processing, to +typesets, as in non-unicode LaTeX processing, to \ss\ \textsc{\ss} |