texlive[53272] Master/texmf-dist: xfakebold (30dec19)

commits+karl at tug.org commits+karl at tug.org
Mon Dec 30 23:18:02 CET 2019


Revision: 53272
          http://tug.org/svn/texlive?view=revision&revision=53272
Author:   karl
Date:     2019-12-30 23:18:02 +0100 (Mon, 30 Dec 2019)
Log Message:
-----------
xfakebold (30dec19)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/xfakebold/Changes
    trunk/Master/texmf-dist/doc/latex/xfakebold/xfakebold-doc.pdf
    trunk/Master/texmf-dist/doc/latex/xfakebold/xfakebold-doc.tex
    trunk/Master/texmf-dist/tex/latex/xfakebold/xfakebold.sty

Modified: trunk/Master/texmf-dist/doc/latex/xfakebold/Changes
===================================================================
--- trunk/Master/texmf-dist/doc/latex/xfakebold/Changes	2019-12-30 22:17:36 UTC (rev 53271)
+++ trunk/Master/texmf-dist/doc/latex/xfakebold/Changes	2019-12-30 22:18:02 UTC (rev 53272)
@@ -1,5 +1,6 @@
 xfakebold.sty ----------------
 
+v 0.06 2019-12-29  support for xetex and ptex with (x)dvipdfmx
 v 0.05 2019-09-21  fix pdflatex
 v 0.04 2018-08-21  typo in \fake at bold
 v 0.03 2018-08-07  small fixes and typos in the documentation

Modified: trunk/Master/texmf-dist/doc/latex/xfakebold/xfakebold-doc.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/xfakebold/xfakebold-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/xfakebold/xfakebold-doc.tex	2019-12-30 22:17:36 UTC (rev 53271)
+++ trunk/Master/texmf-dist/doc/latex/xfakebold/xfakebold-doc.tex	2019-12-30 22:18:02 UTC (rev 53272)
@@ -1,7 +1,11 @@
-% $Id: xfakebold-doc.tex 1087 2019-09-21 11:53:40Z herbert $
+% $Id: xfakebold-doc.tex 1125 2019-12-29 21:34:19Z herbert $
 \listfiles
 \documentclass[english]{article}
 \usepackage{dejavu-otf}
+\usepackage{xfp}
+\ExplSyntaxOn
+\let\PI\c_pi_fp
+\ExplSyntaxOff
 \usepackage{xfakebold}
 \usepackage{graphicx}
 %\pdfcompresslevel=0
@@ -8,7 +12,7 @@
 \usepackage{babel}
 \usepackage[a4paper,tmargin=1cm,bmargin=1.5cm,includeheadfoot]{geometry}
 \usepackage{listings}
-\title{\texttt{xfakebold}, v. 0.05\\ using bold characters with \texttt{pdflatex} or \texttt{lualatex}}
+\title{\texttt{xfakebold}, v. 0.06\\ using bold characters with\\ \texttt{pdflatex}, \texttt{lualatex} or \texttt{xelatex}}
 \author{Herbert Voß}
 
 \lstset{basicstyle=\ttfamily\small,language={[LaTeX]TeX},frame=lrtb}
@@ -21,13 +25,13 @@
 \begin{abstract}
 The package fakes a vector font with outline characters by the text render of PDF.
 It writes directly into the pdf output with \verb|\pdfliteral| (pdflatex ) or \verb|\pdfextension| \verb|literal| 
-(lualatex). The package defines two macros which can be used in text and in math mode. However, for the text
+(lualatex) or \verb|\special| (xelatex). The package defines two macros which can be used in text and in math mode. However, for the text
 mode one should use the bold version of the text font which should be available in most cases. This is different to the
 math mode where only some free math fonts provide a bold version.
 \end{abstract}
 
 \vfill
-\small Thanks to: Will Robertson;
+\small Thanks to: Will Robertson; Yusuke Terada;
 %\meaning\setBold
 
 %\meaning\unsetBold
@@ -37,6 +41,8 @@
 \section{How does it work?}
 PDF knows different text render modes for outline fonts.
 
+\ifxetex\else% Only for the test run with xelatex
+
 \def\OFF{\pdfextension literal direct { 0 Tr 0 w }\relax}
 \def\Verb|#1|{\texttt{\{#1\}}}
 
@@ -49,8 +55,8 @@
 \makebox[3cm][l]{Mode 2 \Verb| 2 Tr 0 w |} \tabular{l}\pdfextension literal direct { 2 Tr 0 w }\scalebox{10}{OTTO} OTTO\OFF\endtabular
 
 \makebox[3cm][l]{Mode 2 \Verb| 2 Tr 0.3 w |} \tabular{l}\pdfextension literal direct { 2 Tr 0.3 w }\scalebox{10}{OTTO} OTTO\OFF\endtabular
+\fi
 
-
 In mode 0 the character is filled but without drawing its outline which can be seen when printing in mode 1, where
 the linewidth of the outline is the smallest one which the system allows. Setting the linewidth to 0.3\,bp, which is
 nearly the same as 0.3\,pt, the linewidth of the outline increases. In mode 2 the character is printed with filling \emph{and}
@@ -58,7 +64,7 @@
 makes it more bold.
 
 
-\section{Optional argument}
+\section{Optional package argument}
 The only package option is \verb|bold| which is preset by 0.3, which is the linewidth of
 the outlines of the characters.
 
@@ -68,65 +74,156 @@
 
 makes the characters more bold.
 
+\section{The macros}
+
+\begin{lstlisting}
+\setBold[<optional value>]
+\unsetBold
+\end{lstlisting}
+
+Without using the optional argument the default setting is used.
+
+
+
+
 \section{The example code}
 
+The following examples use the value for $\pi$, defined in \LaTeX3 as \verb|\c_pi_fp|. To get rid of
+the L3-syntax we define a new variable:
+
 \begin{lstlisting}
+\ExplSyntaxOn
+\let\PI\c_pi_fp
+\ExplSyntaxOff
+\end{lstlisting}
+
+\subsection{Default setting}
+\begin{lstlisting}
 \documentclass{article}
 \usepackage{xfakebold}
 \begin{document}
 An example: 
-$\pi^{\pi}=\directlua{tex.print(math.pi^math.pi)}$ and
+$\pi^{\pi}=\fpeval{\PI^\PI}$ and
 $\displaystyle\int\limits_1^{\infty}\frac1{x^2}\symup dx=1$
 
 \setBold\noindent
 An example: 
-$\pi^{\pi}=\directlua{tex.print(math.pi^math.pi)}$ and
+$\pi^{\pi}=\fpeval{\PI^\PI}$ and
 $\displaystyle\int\limits_1^{\infty}\frac1{x^2}\symup dx=1$
 
 \unsetBold\noindent
 An example: 
-$\pi^{\pi}=\directlua{tex.print(math.pi^math.pi)}$ and
+$\pi^{\pi}=\fpeval{\PI^\PI}$ and
 $\displaystyle\int\limits_1^{\infty}\frac1{x^2}\symup dx=1$
 \end{document}
 \end{lstlisting}
 
-\section{The output}
+\noindent
+An example: 
+$\pi^{\pi}=\fpeval{\PI^\PI}$ and
+$\displaystyle\int\limits_1^{\infty}\frac1{x^2}\symup dx=1$
 
+\setBold\noindent
+An example: 
+$\pi^{\pi}=\fpeval{\PI^\PI}$ and
+$\displaystyle\int\limits_1^{\infty}\frac1{x^2}\symup dx=1$
 
+\unsetBold\noindent
 An example: 
-$\pi^{\pi}=\directlua{tex.print(math.pi^math.pi)}$ and
+$\pi^{\pi}=\fpeval{\PI^\PI}$ and
 $\displaystyle\int\limits_1^{\infty}\frac1{x^2}\symup dx=1$
 
+
+\section{Loading the package with  another value}
+
+\begin{lstlisting}
+\documentclass{article}
+\usepackage[bold=1]{xfakebold}
+\begin{document}
+An example: 
+$\pi^{\pi}=\fpeval{\PI^\PI}$ and
+$\displaystyle\int\limits_1^{\infty}\frac1{x^2}\symup dx=1$
+
 \setBold\noindent
 An example: 
-$\pi^{\pi}=\directlua{tex.print(math.pi^math.pi)}$ and
+$\pi^{\pi}=\fpeval{\PI^\PI}$ and
 $\displaystyle\int\limits_1^{\infty}\frac1{x^2}\symup dx=1$
 
 \unsetBold\noindent
 An example: 
-$\pi^{\pi}=\directlua{tex.print(math.pi^math.pi)}$ and
+$\pi^{\pi}=\fpeval{\PI^\PI}$ and
 $\displaystyle\int\limits_1^{\infty}\frac1{x^2}\symup dx=1$
+\end{document}
+\end{lstlisting}
 
+\noindent
+An example: 
+$\pi^{\pi}=\fpeval{\PI^\PI}$ and
+$\displaystyle\int\limits_1^{\infty}\frac1{x^2}\symup dx=1$
 
-\vspace{2cm}\noindent
-The same for \verb|\usepackage[bold=1]{xfakebold}|:
+\ifxetex\special{pdf:literal direct 2 Tr 1 w }%
+\else\pdfextension literal direct { 2 Tr 1 w }\relax\fi
+\noindent 
+An example: 
+$\pi^{\pi}=\fpeval{\PI^\PI}$ and
+$\displaystyle\int\limits_1^{\infty}\frac1{x^2}\symup dx=1$
 
-\gdef\setBold{\pdfextension literal direct { 2 Tr 1 w }\relax}
-\gdef\unsetBold{\pdfextension literal direct { 0 Tr 0 w }\relax}
+\ifxetex\special{pdf:literal direct 0 Tr 0 w }%
+\else\pdfextension literal direct { 0 Tr 0 w }\relax\fi
 \noindent
 An example: 
-$\pi^{\pi}=\directlua{tex.print(math.pi^math.pi)}$ and
+$\pi^{\pi}=\fpeval{\PI^\PI}$ and
 $\displaystyle\int\limits_1^{\infty}\frac1{x^2}\symup dx=1$
 
-\setBold\noindent
+\section{Using the optional argument of the macro}
+
+\begin{lstlisting}
+\documentclass{article}
+\usepackage{xfakebold}
+\begin{document}
+\setBold[0.01]\noindent
 An example: 
-$\pi^{\pi}=\directlua{tex.print(math.pi^math.pi)}$ and
+$\pi^{\pi}=\fpeval{\PI^\PI}$ and
 $\displaystyle\int\limits_1^{\infty}\frac1{x^2}\symup dx=1$
 
-\unsetBold\noindent
+\setBold[0.2]\noindent
 An example: 
-$\pi^{\pi}=\directlua{tex.print(math.pi^math.pi)}$ and
+$\pi^{\pi}=\fpeval{\PI^\PI}$ and
 $\displaystyle\int\limits_1^{\infty}\frac1{x^2}\symup dx=1$
 
+\setBold[0.6]\noindent
+An example: 
+$\pi^{\pi}=\fpeval{\PI^\PI}$ and
+$\displaystyle\int\limits_1^{\infty}\frac1{x^2}\symup dx=1$
+\unsetBold
 
+\setBold\noindent% Using the deafult value
+An example: 
+$\pi^{\pi}=\fpeval{\PI^\PI}$ and
+$\displaystyle\int\limits_1^{\infty}\frac1{x^2}\symup dx=1$
+\unsetBold
+\end{document}
+\end{lstlisting}
+
+\setBold[0.01]\noindent
+An example: 
+$\pi^{\pi}=\fpeval{\PI^\PI}$ and
+$\displaystyle\int\limits_1^{\infty}\frac1{x^2}\symup dx=1$
+
+\setBold[0.2]\noindent
+An example: 
+$\pi^{\pi}=\fpeval{\PI^\PI}$ and
+$\displaystyle\int\limits_1^{\infty}\frac1{x^2}\symup dx=1$
+
+\setBold[0.6]\noindent
+An example: 
+$\pi^{\pi}=\fpeval{\PI^\PI}$ and
+$\displaystyle\int\limits_1^{\infty}\frac1{x^2}\symup dx=1$
+\unsetBold
+
+\setBold\noindent% Using the deafult value
+An example: 
+$\pi^{\pi}=\fpeval{\PI^\PI}$ and
+$\displaystyle\int\limits_1^{\infty}\frac1{x^2}\symup dx=1$
+\unsetBold
 \end{document}
\ No newline at end of file

Modified: trunk/Master/texmf-dist/tex/latex/xfakebold/xfakebold.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/xfakebold/xfakebold.sty	2019-12-30 22:17:36 UTC (rev 53271)
+++ trunk/Master/texmf-dist/tex/latex/xfakebold/xfakebold.sty	2019-12-30 22:18:02 UTC (rev 53272)
@@ -1,8 +1,8 @@
-% $Id: xfakebold.sty 1087 2019-09-21 11:53:40Z herbert $
+% $Id: xfakebold.sty 1125 2019-12-29 21:34:19Z herbert $
 %%
 %% This is file `xfakebold.sty', 
 %%
-%%   Copyright (C) 2019  Herbert Voss
+%%   Copyright (C) 1919, 2020  Herbert Voss
 %% 
 %% It may be distributed and/or modified under the
 %% conditions of the LaTeX Project Public License, either version 1.3c
@@ -13,41 +13,82 @@
 %% version 2005/12/01 or later.
 %% 
 %%
-\ProvidesPackage{xfakebold}[2019/09/21 v0.05 using bold characters]
-\RequirePackage{ifluatex,ifxetex,xkeyval}
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{xfakebold}[1919/12/29 v0.06 using bold characters]
+\RequirePackage{xkeyval}
 
-\def\setBold{}
-\def\unsetBold{}
-\def\fake at bold{0.4}%
+\@ifpackagelater{iftex}{2019/10/24}{% 
+  \RequirePackage{ifxetex,ifluatex,ifpdf}
+}{%
+  \RequirePackage{iftex}
+}
 
-\DeclareOptionX{bold}{%
-  \def\fake at bold{#1}% 
-  \ifdim\fake at bold pt > 0pt
+\def\fkbld at bold{0.3 }%
+
+\def\fkbld at checkboldness#1{%
+  \ifdim#1pt > \z@
+    \def\fkbld at bold{#1 }%
   \else 
-    \PackageWarning{fakebold}{The value must be greater than 0. Will chooose 0.3}%
-    \def\fake at bold{0.3}%
-  \fi}
+    \PackageWarning{fakebold}{The value must be greater than 0. Will choose 0.3 instead!}%
+    \def\fkbld at bold{0.3 }%
+  \fi
+}
 
-\ProcessOptionsX
-\typeout{We use fakebold with factor \fake at bold}%
-\ifxetex
-  \typeout{We have XeTeX}% 
-  \PackageWarning{fakebold}%
-  {^^J    No LuaTeX or PDFTeX running!
-   ^^J    For Xe(La)TeX use the FakeBold option from package fontspec!
-   \def\fake at bold{-1}}%
-\else
-  \ifluatex
-    \def\setBold{\pdfextension literal direct { 2 Tr \fake at bold\space w }\relax}
-    \def\unsetBold{\pdfextension literal direct { 0 Tr 0 w }\relax}
-    \typeout{We have LuaTeX}% 
+\DeclareOptionX{bold}{\fkbld at checkboldness{#1}}
+
+\ProcessOptionsX*
+
+\newcommand\setBold[1][]{%
+  \begingroup
+  \if$#1$\else
+    \fkbld at checkboldness{#1}%
+  \fi
+  \ifxetex
+    \special{pdf:literal direct 2 Tr \fkbld at bold w }\relax
   \else
-    \ifdim\fake at bold pt < \z@ \else
-      \def\setBold{\pdfliteral direct { 2 Tr \fake at bold\space w }\relax}
-      \def\unsetBold{\pdfliteral direct { 0 Tr 0 w }\relax}
-      \typeout{We have pdfTeX}% 
+    \ifluatex
+      \pdfextension literal direct { 2 Tr \fkbld at bold w }\relax
+    \else
+      \ifpdftex
+        \ifnum\pdfoutput=\@ne
+          \pdfliteral direct { 2 Tr #1 w }\relax
+        \else
+          \special{pdf:literal direct 2 Tr \fkbld at bold w }\relax
+        \fi
+      \else
+        \ifpdf
+          \PackageWarning{fakebold}{!Unsupported engine! fakebold is disabled.}
+        \else
+          \special{pdf:literal direct 2 Tr \fkbld at bold w }\relax
+        \fi                  
+      \fi
     \fi
   \fi
-\fi
+  \endgroup
+  \ignorespaces
+}
+\newcommand\unsetBold{%
+  \ifxetex
+    \special{pdf:literal direct 0 Tr 0 w }\relax
+  \else
+    \ifluatex
+      \pdfextension literal direct { 0 Tr 0 w }\relax
+    \else
+      \ifpdftex
+        \ifnum\pdfoutput=\@ne
+          \pdfliteral direct { 0 Tr 0 w }\relax
+        \else
+          \special{pdf:literal direct 0 Tr 0 w }\relax
+        \fi
+      \else
+        \ifpdf
+        \else
+          \special{pdf:literal direct 0 Tr 0 w }\relax
+        \fi                  
+      \fi
+    \fi
+  \fi
+  \ignorespaces
+}
 
-\endinput
\ No newline at end of file
+\endinput



More information about the tex-live-commits mailing list