Debian Codegraph @

texmf-dist/source/latex/tuda-ci/tudafonts.dtx

raw
1 % \iffalse meta-comment
2 %
3 % TUDa-CI -- Corporate Design for TU Darmstadt
4 % ----------------------------------------------------------------------------
5 %
6 % Copyright (C) 2018--2025 by Marei Peischl <[email protected]>
7 %
8 % ============================================================================
9 % This work may be distributed and/or modified under the
10 % conditions of the LaTeX Project Public License, either version 1.3c
11 % of this license or (at your option) any later version.
12 % The latest version of this license is in
13 % http://www.latex-project.org/lppl.txt
14 % and version 1.3c or later is part of all distributions of LaTeX
15 % version 2008/05/04 or later.
16 %
17 % This work has the LPPL maintenance status `maintained'.
18 %
19 % The Current Maintainer of this work is
20 % Marei Peischl <[email protected]>
21 %
22 % The development repository can be found at
23 % https://github.com/tudace/tuda_latex_templates
24 % Please use the issue tracker for feedback!
25 %
26 % ============================================================================
27 %
28 % \fi
29 %
30 % \iffalse% no documentation on this
31 % \iffalse^^A Preparation for real docstrip documentation
32 %<driver>\ProvidesFile{tudafonts.dtx}
33 %<*package>
34 %<@@=ptxcd>
35 \NeedsTeXFormat{LaTeX2e}[2022/06/01]
36 \ProvidesPackage{tudafonts}
37 %</package>
38 %<*driver|package>
39 [2025-11-13 4.05
40 font setup for TUDa-CI, TU Darmstadt's Corporate Design]
41 %</driver|package>
42 %<*driver>
43 \typeout{***********************************************************}
44 \typeout{No documentation included in this file! Please see tuda-ci.pdf for more information.}
45 \typeout{***********************************************************}
46 \stop
47 %</driver>
48 %<*driver>^^A Preparation for real docstrip documentation
49 \providecommand*{\TUDaDocDTXfiles}{tudafonts.dtx}
50 \input{tuda-ci.dtx}
51 %</driver>
52 % \fi
53 %
54 % \changes{v4.00}{2025-01-26}{Converted to DTX file}
55 %
56 % \DoNotIndex{\newcommand,\newenvironment}
57 %
58 % \GetFileInfo{tudafonts.dtx}
59 % \title{The \textsf{tudafonts} package}
60 % \author{Marei Peischl\thanks{Email: \href{mailto:[email protected]}{[email protected]}}}
61 % \date{\fileversion~from \filedate}
62 %
63 % \maketitle
64 %
65 %
66 % \MaybeStop{}
67 %
68 % \section{Implementation}
69 %
70 % \iffalse
71 %<*package>
72 % \fi
73 % \begin{macrocode}
74 \expandafter\newif\csname if@ptxcd@T1\endcsname
75 \DeclareOption{T1}{\csname @ptxcd@T1true\endcsname}
76 \ProcessOptions\relax
77 \RequirePackage{iftex}
78 \RequirePackage{anyfontsize}
79 \ifPDFTeX
80 \csname @ptxcd@T1true\endcsname
81 %Fallback for older versions
82 \expandafter\ifx\csname DeclareUnicodeCharacter\endcsname\relax
83 \RequirePackage[utf8]{inputenc}
84 \fi
85 \expandafter\ifx\csname texteuro\endcsname\relax
86 \RequirePackage{textcomp}
87 \fi
88 \DeclareUnicodeCharacter{20AC}{\texteuro}
89 \fi
90 \csname if@ptxcd@T1\endcsname
91 \ifLuaTeX
92 \RequirePackage[utf8]{luainputenc}
93 \fi
94 \RequirePackage{XCharter}%activates T1
95 \PassOptionsToPackage{type1}{roboto}
96 \PassOptionsToPackage{type1}{roboto-mono}
97 % Workaround for missing ligature replacements with roboto in T1
98 \ifXeTeX
99 \else
100 \RequirePackage{microtype}
101 \DisableLigatures{encoding = *, family=\sfdefault,shape = sc }
102 \fi
103 \else
104 \RequirePackage{fontspec}
105 \setmainfont{XCharter}
106 \fi
107 \RequirePackage{roboto}
108 \csname if@ptxcd@T1\endcsname
109 \newcommand\robotoblackspaced{%
110 \robotoblack
111 \lsstyle
112 }
113 \else
114 \newfontfamily\robotoblackspaced
115 [ Numbers = {\roboto@figurealign,\roboto@figurestyle},
116 UprightFont = *-Black ,
117 ItalicFont = *-BlackItalic,
118 LetterSpace=26,
119 WordSpace=2.2
120 ]
121 {Roboto}
122 \fi
123 \IfFileExists{roboto-mono.sty}{
124 \RequirePackage{roboto-mono}
125 }{
126 \PackageWarningNoLine{tudafonts}{%
127 The font package roboto-mono.sty could not be found.
128 Probably your TeX-distribution is outdated.\MessageBreak
129 For correct font setup either install it manually or update you distribution}
130 }
131 % \end{macrocode}
132 %
133 % \begin{macro}{\ptxcd@sffamily@lining}
134 % \begin{macrocode}
135 \def\ptxcd@sffamily@lining{\robototlf}
136 % \end{macrocode}
137 % \end{macro}
138 %
139 % \begin{macrocode}
140 \let\accentfont\robotoslab
141 \DeclareTextFontCommand{\textaccent}{\accentfont}
142 % \end{macrocode}
143 % adjust LaTeX Logo kerning to font
144 % \begin{macrocode}
145 \DeclareRobustCommand{\LaTeX}{%
146 {L\setbox\z@\hbox{\check@mathfonts \fontsize\sf@size\z@
147 \math@fontsfalse\selectfont A}\kern-.57\wd\z@
148 \sbox\tw@ T\vbox to \ht\tw@{\copy\z@ \vss}\kern-.2\wd\z@}%
149 {%
150 \ifdim\fontdimen1\font=\z@ \else \count\z@=\fontdimen5\font
151 \multiply\count\z@ by 64\relax\divide\count\z@ by\p@
152 \count\tw@=\fontdimen1\font \multiply\count\tw@ by\count\z@
153 \divide\count\tw@ by 64\relax\divide\count\tw@ by\tw@
154 \kern-\the\count\tw@ sp\relax\fi}%
155 \TeX}
156 % \end{macrocode}
157 %
158 % \iffalse
159 %</package>
160 % \fi
161 %
162 % \Finale
163 % \fi^^A No documentation on this
164 \endinput