texlive[55654] Master/texmf-dist: xfakebold (24jun20)

commits+karl at tug.org commits+karl at tug.org
Wed Jun 24 23:03:50 CEST 2020


Revision: 55654
          http://tug.org/svn/texlive?view=revision&revision=55654
Author:   karl
Date:     2020-06-24 23:03:49 +0200 (Wed, 24 Jun 2020)
Log Message:
-----------
xfakebold (24jun20)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/xfakebold/Changes
    trunk/Master/texmf-dist/doc/latex/xfakebold/README
    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	2020-06-24 21:03:37 UTC (rev 55653)
+++ trunk/Master/texmf-dist/doc/latex/xfakebold/Changes	2020-06-24 21:03:49 UTC (rev 55654)
@@ -1,5 +1,6 @@
 xfakebold.sty ----------------
 
+v 0.08 2020-06-24  use colorstack to allow a page break
 v 0.07 2020-06-22  fix bug for pdflatex (thanks to Scott Pakin)
 v 0.06 2019-12-29  support for xetex and ptex with (x)dvipdfmx
 v 0.05 2019-09-21  fix pdflatex

Modified: trunk/Master/texmf-dist/doc/latex/xfakebold/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/xfakebold/README	2020-06-24 21:03:37 UTC (rev 55653)
+++ trunk/Master/texmf-dist/doc/latex/xfakebold/README	2020-06-24 21:03:49 UTC (rev 55654)
@@ -1,7 +1,8 @@
 This package allows to use bold characters in text and math mode.
 It works only with vectorfonts which are created by outlines.
+It makes no real sense for XeLaTeX, because you can use the option
+AutoFakeBold from package fontspec.
 
-
 %% It may be distributed and/or modified under the
 %% conditions of the LaTeX Project Public License, either version 1.3c
 %% of this license or (at your option) any later version.

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	2020-06-24 21:03:37 UTC (rev 55653)
+++ trunk/Master/texmf-dist/doc/latex/xfakebold/xfakebold-doc.tex	2020-06-24 21:03:49 UTC (rev 55654)
@@ -1,8 +1,8 @@
-% $Id: xfakebold-doc.tex 9 2020-06-22 07:46:03Z herbert $
+% $Id: xfakebold-doc.tex 11 2020-06-24 06:56:41Z herbert $
 \listfiles
 \documentclass[english]{article}
 \usepackage{dejavu-otf}
-\usepackage{xfp}
+\usepackage{xfp,dtk-logos}
 \ExplSyntaxOn
 \let\PI\c_pi_fp
 \ExplSyntaxOff
@@ -12,7 +12,7 @@
 \usepackage{babel}
 \usepackage[a4paper,tmargin=1cm,bmargin=1.5cm,includeheadfoot]{geometry}
 \usepackage{listings}
-\title{\texttt{xfakebold}, v. 0.07\\ using bold characters with\\ \texttt{pdflatex}, \texttt{lualatex} or \texttt{xelatex}}
+\title{\texttt{xfakebold}, v. 0.08\\ using bold characters with\\ \texttt{pdflatex}, \texttt{lualatex} or \texttt{xelatex}}
 \author{Herbert Voß}
 
 \lstset{basicstyle=\ttfamily\small,language={[LaTeX]TeX},frame=lrtb}
@@ -25,14 +25,17 @@
 \vspace{1cm}
 \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) or \verb|\special| (xelatex). The package defines two macros which can be used in text and in math mode. However, for the text
+It writes directly into the pdf output with \verb|\pdfliteral| and  uses the colorstack package \texttt{pdfrender} to allow
+boldness with a pagebreak inside the bold part.
+%(pdflatex ) or \verb|\pdfextension| \verb|literal| 
+%(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: Scott Pakin, Will Robertson; Yusuke Terada;
+\small Thanks to: Heiko Oberdiek; Scott Pakin, Will Robertson; Yusuke Terada;
 %\meaning\setBold
 
 %\meaning\unsetBold
@@ -39,25 +42,33 @@
 
 \newpage
 
+\section{\TeX-engines}
+With \XeLaTeX\ you do not really need this package, because you can use the optional argument \texttt{AutoFakeBold} from
+package \texttt{fontspec} or \texttt{unicode-math} which does the same internally. For Lua\TeX\ the option \texttt{AutoFakeBold} is only supported
+by \texttt{unicode-math} for math typesetting. For pdf\LaTeX\ this package can be used for text and math.
+
+
 \section{How does it work?}
 PDF knows different text render modes for outline fonts.
 
+\bigskip
 \ifxetex\else% Only for the test run with xelatex
 
-\def\OFF{\pdfextension literal direct { 0 Tr 0 w }\relax}
+\def\OFF{\pdfrender{TextRenderingMode=Fill,LineWidth=0}}
 \def\Verb|#1|{\texttt{\{#1\}}}
 
-\makebox[3cm][l]{Mode 0 \Verb| 0 Tr 0 w |} \tabular{l}\pdfextension literal direct { 0 Tr 0 w }\scalebox{10}{OTTO} OTTO\OFF\endtabular
+\makebox[3cm][l]{Mode 0 \Verb| 0 Tr 0 w |} \tabular{l}\pdfrender{TextRenderingMode=Fill}\scalebox{10}{OTTO} OTTO\OFF\endtabular
 
-\makebox[3cm][l]{Mode 1 \Verb| 1 Tr 0 w |} \tabular{l}\pdfextension literal direct { 1 Tr 0 w }\scalebox{10}{OTTO} OTTO\OFF\endtabular
+\makebox[3cm][l]{Mode 1 \Verb| 1 Tr 0 w |} \tabular{l}\pdfrender{TextRenderingMode=Stroke,LineWidth=0}\scalebox{10}{OTTO} OTTO\OFF\endtabular
 
-\makebox[3cm][l]{Mode 1 \Verb| 1 Tr 0.3 w |} \tabular{l}\pdfextension literal direct { 1 Tr 0.3 w }\scalebox{10}{OTTO} OTTO\OFF\endtabular
+\makebox[3cm][l]{Mode 1 \Verb| 1 Tr 0.3 w |} \tabular{l}\pdfrender{TextRenderingMode=Stroke,LineWidth=0.3}\scalebox{10}{OTTO} OTTO\OFF\endtabular
 
-\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 w |} \tabular{l}\pdfrender{TextRenderingMode=FillStroke,LineWidth=0}\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
+\makebox[3cm][l]{Mode 2 \Verb| 2 Tr 0.3 w |} \tabular{l}\pdfrender{TextRenderingMode=FillStroke,LineWidth=0.3}\scalebox{10}{OTTO} OTTO\OFF\endtabular
 \fi
 
+\bigskip
 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}
@@ -101,7 +112,7 @@
 \subsection{Default setting}
 \begin{lstlisting}
 \documentclass{article}
-\usepackage{xfakebold}
+\usepackage{xfakebold,xfp}
 \begin{document}
 An example: 
 $\pi^{\pi}=\fpeval{\PI^\PI}$ and
@@ -140,6 +151,7 @@
 \begin{lstlisting}
 \documentclass{article}
 \usepackage[bold=1]{xfakebold}
+\usepackage{xfp}
 \begin{document}
 An example: 
 $\pi^{\pi}=\fpeval{\PI^\PI}$ and
@@ -163,7 +175,7 @@
 $\displaystyle\int\limits_1^{\infty}\frac1{x^2}\symup dx=1$
 
 \ifxetex\special{pdf:literal direct 2 Tr 1 w }%
-\else\pdfextension literal direct { 2 Tr 1 w }\relax\fi
+\else\pdfrender{TextRenderingMode=FillStroke,LineWidth=1}\fi
 \noindent 
 An example: 
 $\pi^{\pi}=\fpeval{\PI^\PI}$ and
@@ -170,7 +182,7 @@
 $\displaystyle\int\limits_1^{\infty}\frac1{x^2}\symup dx=1$
 
 \ifxetex\special{pdf:literal direct 0 Tr 0 w }%
-\else\pdfextension literal direct { 0 Tr 0 w }\relax\fi
+\else\pdfrender{TextRenderingMode=Fill,LineWidth=0}\fi
 \noindent
 An example: 
 $\pi^{\pi}=\fpeval{\PI^\PI}$ and
@@ -180,7 +192,7 @@
 
 \begin{lstlisting}
 \documentclass{article}
-\usepackage{xfakebold}
+\usepackage{xfakebold,xfp}
 \begin{document}
 \setBold[0.01]\noindent
 An example: 
@@ -198,7 +210,7 @@
 $\displaystyle\int\limits_1^{\infty}\frac1{x^2}\symup dx=1$
 \unsetBold
 
-\setBold\noindent% Using the deafult value
+\setBold\noindent% Using the default value
 An example: 
 $\pi^{\pi}=\fpeval{\PI^\PI}$ and
 $\displaystyle\int\limits_1^{\infty}\frac1{x^2}\symup dx=1$
@@ -222,7 +234,7 @@
 $\displaystyle\int\limits_1^{\infty}\frac1{x^2}\symup dx=1$
 \unsetBold
 
-\setBold\noindent% Using the deafult value
+\setBold\noindent% Using the default value
 An example: 
 $\pi^{\pi}=\fpeval{\PI^\PI}$ and
 $\displaystyle\int\limits_1^{\infty}\frac1{x^2}\symup dx=1$

Modified: trunk/Master/texmf-dist/tex/latex/xfakebold/xfakebold.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/xfakebold/xfakebold.sty	2020-06-24 21:03:37 UTC (rev 55653)
+++ trunk/Master/texmf-dist/tex/latex/xfakebold/xfakebold.sty	2020-06-24 21:03:49 UTC (rev 55654)
@@ -1,4 +1,4 @@
-% $Id: xfakebold.sty 9 2020-06-22 07:46:03Z herbert $
+% $Id: xfakebold.sty 11 2020-06-24 06:56:41Z herbert $
 %%
 %% This is file `xfakebold.sty', 
 %%
@@ -14,8 +14,9 @@
 %% 
 %%
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{xfakebold}[2020/06/22 v0.07 using bold characters]
+\ProvidesPackage{xfakebold}[2020/06/24 v0.08 using bold characters]
 \RequirePackage{xkeyval}
+\RequirePackage{pdfrender}
 
 \@ifpackagelater{iftex}{2019/10/24}{% 
   \RequirePackage{ifxetex,ifluatex,ifpdf}
@@ -23,14 +24,14 @@
   \RequirePackage{iftex}
 }
 
-\def\fkbld at bold{0.3 }%
+\def\fkbld at bold{0.3}%
 
 \def\fkbld at checkboldness#1{%
   \ifdim#1pt > \z@
-    \def\fkbld at bold{#1 }%
+    \def\fkbld at bold{#1}%
   \else 
     \PackageWarning{fakebold}{The value must be greater than 0. Will choose 0.3 instead!}%
-    \def\fkbld at bold{0.3 }%
+    \def\fkbld at bold{0.3}%
   \fi
 }
 
@@ -39,32 +40,26 @@
 \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
+    \special{pdf:literal direct 2 Tr \fkbld at bold\space w }\relax
   \else
     \ifluatex
-      \pdfextension literal direct { 2 Tr \fkbld at bold w }\relax
+      \pdfrender{TextRenderingMode=FillStroke,LineWidth=\fkbld at bold}%
     \else
       \ifpdftex
-        \ifnum\pdfoutput=\@ne
-          \pdfliteral direct { 2 Tr \fkbld at bold w }\relax
-        \else
-          \special{pdf:literal direct 2 Tr \fkbld at bold w }\relax
-        \fi
+        \pdfrender{TextRenderingMode=FillStroke,LineWidth=\fkbld at bold}%
       \else
         \ifpdf
-          \PackageWarning{fakebold}{!Unsupported engine! fakebold is disabled.}
+          \PackageWarning{fakebold}{!Unsupported engine! fakebold is disabled.}%
         \else
-          \special{pdf:literal direct 2 Tr \fkbld at bold w }\relax
-        \fi                  
+          \pdfrender{TextRenderingMode=FillStroke,LineWidth=\fkbld at bold}%
+        \fi
       \fi
     \fi
   \fi
-  \endgroup
   \ignorespaces
 }
 \newcommand\unsetBold{%
@@ -72,19 +67,18 @@
     \special{pdf:literal direct 0 Tr 0 w }\relax
   \else
     \ifluatex
-      \pdfextension literal direct { 0 Tr 0 w }\relax
+      \pdfrender{TextRenderingMode=Fill,LineWidth=0}%
     \else
       \ifpdftex
         \ifnum\pdfoutput=\@ne
-          \pdfliteral direct { 0 Tr 0 w }\relax
+          \pdfrender{TextRenderingMode=Fill,LineWidth=0}%
         \else
-          \special{pdf:literal direct 0 Tr 0 w }\relax
+          \pdfrender{TextRenderingMode=Fill,LineWidth=0}%
         \fi
       \else
-        \ifpdf
-        \else
-          \special{pdf:literal direct 0 Tr 0 w }\relax
-        \fi                  
+        \ifpdf\else
+          \pdfrender{TextRenderingMode=Fill,LineWidth=0}%
+        \fi
       \fi
     \fi
   \fi



More information about the tex-live-commits mailing list.