blob: b4c2dff90f5d0cd6231d3deb8b9061a364360455 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
% $Id: xfakebold.sty 11 2020-06-24 06:56:41Z herbert $
%%
%% This is file `xfakebold.sty',
%%
%% Copyright (C) 2019, 2020 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.
%%
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{xfakebold}[2020/06/24 v0.08 using bold characters]
\RequirePackage{xkeyval}
\RequirePackage{pdfrender}
\@ifpackagelater{iftex}{2019/10/24}{%
\RequirePackage{ifxetex,ifluatex,ifpdf}
}{%
\RequirePackage{iftex}
}
\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 choose 0.3 instead!}%
\def\fkbld@bold{0.3}%
\fi
}
\DeclareOptionX{bold}{\fkbld@checkboldness{#1}}
\ProcessOptionsX*
\newcommand\setBold[1][]{%
\if$#1$\else
\fkbld@checkboldness{#1}%
\fi
\ifxetex
\special{pdf:literal direct 2 Tr \fkbld@bold\space w }\relax
\else
\ifluatex
\pdfrender{TextRenderingMode=FillStroke,LineWidth=\fkbld@bold}%
\else
\ifpdftex
\pdfrender{TextRenderingMode=FillStroke,LineWidth=\fkbld@bold}%
\else
\ifpdf
\PackageWarning{fakebold}{!Unsupported engine! fakebold is disabled.}%
\else
\pdfrender{TextRenderingMode=FillStroke,LineWidth=\fkbld@bold}%
\fi
\fi
\fi
\fi
\ignorespaces
}
\newcommand\unsetBold{%
\ifxetex
\special{pdf:literal direct 0 Tr 0 w }\relax
\else
\ifluatex
\pdfrender{TextRenderingMode=Fill,LineWidth=0}%
\else
\ifpdftex
\ifnum\pdfoutput=\@ne
\pdfrender{TextRenderingMode=Fill,LineWidth=0}%
\else
\pdfrender{TextRenderingMode=Fill,LineWidth=0}%
\fi
\else
\ifpdf\else
\pdfrender{TextRenderingMode=Fill,LineWidth=0}%
\fi
\fi
\fi
\fi
\ignorespaces
}
\endinput
|