diff options
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/xfakebold/xfakebold.sty | 105 |
1 files changed, 73 insertions, 32 deletions
diff --git a/Master/texmf-dist/tex/latex/xfakebold/xfakebold.sty b/Master/texmf-dist/tex/latex/xfakebold/xfakebold.sty index 51d030dedf6..db10f5096ab 100644 --- a/Master/texmf-dist/tex/latex/xfakebold/xfakebold.sty +++ b/Master/texmf-dist/tex/latex/xfakebold/xfakebold.sty @@ -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@bold{0.4}% +\@ifpackagelater{iftex}{2019/10/24}{% + \RequirePackage{ifxetex,ifluatex,ifpdf} +}{% + \RequirePackage{iftex} +} -\DeclareOptionX{bold}{% - \def\fake@bold{#1}% - \ifdim\fake@bold pt > 0pt +\def\fkbld@bold{0.3 }% + +\def\fkbld@checkboldness#1{% + \ifdim#1pt > \z@ + \def\fkbld@bold{#1 }% \else - \PackageWarning{fakebold}{The value must be greater than 0. Will chooose 0.3}% - \def\fake@bold{0.3}% - \fi} + \PackageWarning{fakebold}{The value must be greater than 0. Will choose 0.3 instead!}% + \def\fkbld@bold{0.3 }% + \fi +} + +\DeclareOptionX{bold}{\fkbld@checkboldness{#1}} + +\ProcessOptionsX* -\ProcessOptionsX -\typeout{We use fakebold with factor \fake@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@bold{-1}}% -\else - \ifluatex - \def\setBold{\pdfextension literal direct { 2 Tr \fake@bold\space w }\relax} - \def\unsetBold{\pdfextension literal direct { 0 Tr 0 w }\relax} - \typeout{We have LuaTeX}% +\newcommand\setBold[1][]{% + \begingroup + \if$#1$\else + \fkbld@checkboldness{#1}% + \fi + \ifxetex + \special{pdf:literal direct 2 Tr \fkbld@bold w }\relax + \else + \ifluatex + \pdfextension literal direct { 2 Tr \fkbld@bold w }\relax + \else + \ifpdftex + \ifnum\pdfoutput=\@ne + \pdfliteral direct { 2 Tr #1 w }\relax + \else + \special{pdf:literal direct 2 Tr \fkbld@bold w }\relax + \fi + \else + \ifpdf + \PackageWarning{fakebold}{!Unsupported engine! fakebold is disabled.} + \else + \special{pdf:literal direct 2 Tr \fkbld@bold w }\relax + \fi + \fi + \fi + \fi + \endgroup + \ignorespaces +} +\newcommand\unsetBold{% + \ifxetex + \special{pdf:literal direct 0 Tr 0 w }\relax \else - \ifdim\fake@bold pt < \z@ \else - \def\setBold{\pdfliteral direct { 2 Tr \fake@bold\space w }\relax} - \def\unsetBold{\pdfliteral direct { 0 Tr 0 w }\relax} - \typeout{We have pdfTeX}% + \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 -\fi + \ignorespaces +} -\endinput
\ No newline at end of file +\endinput |