diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/xfakebold/latex/xfakebold.sty |
Initial commit
Diffstat (limited to 'macros/latex/contrib/xfakebold/latex/xfakebold.sty')
-rw-r--r-- | macros/latex/contrib/xfakebold/latex/xfakebold.sty | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/macros/latex/contrib/xfakebold/latex/xfakebold.sty b/macros/latex/contrib/xfakebold/latex/xfakebold.sty new file mode 100644 index 0000000000..70dc0e678c --- /dev/null +++ b/macros/latex/contrib/xfakebold/latex/xfakebold.sty @@ -0,0 +1,52 @@ +% $Id: xfakebold.sty 793 2018-08-06 16:39:25Z herbert $ +%% +%% This is file `xfakebold.sty', +%% +%% Copyright (C) 2018 Herbert Voss +%% +%% 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. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3c or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% +\ProvidesPackage{xfakebold}[2018/08/21 v0.04 using bold characters] +\RequirePackage{ifluatex,ifxetex,xkeyval} + +\def\setBold{} +\def\unsetBold{} +\def\fake@bold{0.3}% + +\DeclareOptionX{bold}{% + \def\fake@bold{#1}% + \ifdim\fake@bold pt > \p@ + \else + \PackageWarning{fakebold}{The value must be greater than 0. Will chooose 0.3}% + \def\fake@bold{0.3}% + \fi} + +\ProcessOptionsX + +\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}}% +\fi + +\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}% +\else + \ifdim\fake@bold pt < \p@ \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}% + \fi +\fi + |