%% $Id: dejavu-otf.sty 556 2017-09-18 06:22:29Z herbert $ %% %% This file is distributed under the terms of the LaTeX Project Public %% License from CTAN archives in directory macros/latex/base/lppl.txt. %% Either version 1.3 or, at your option, any later version. %% % Copyright 2017 Herbert Voss hvoss@tug.org %% \ProvidesPackage{dejavu-otf}[% 2024/11/28 v. 0.05 (Herbert Voss) Supports DejaVu OpenType for lualatex/xelatex.] % \RequirePackage{ifxetex,ifluatex,xkeyval,textcomp} \RequirePackage{unicode-math} % support opentype math fonts % loads itself fontspec % \newif\ifDejaVu@usefilenames \DejaVu@usefilenamesfalse \DeclareOptionX{usefilenames}[true]{\@nameuse{DejaVu@usefilenames#1}} \newif\ifDejaVu@mono \DejaVu@monotrue \newif\ifDejaVu@serif \DejaVu@seriftrue \newif\ifDejaVu@sans \DejaVu@sanstrue \newif\ifDejaVu@math \DejaVu@mathtrue \DeclareOptionX{mono}[true]{\@nameuse{DejaVu@mono#1}} \DeclareOptionX{sans}[true]{\@nameuse{DejaVu@sans#1}} \DeclareOptionX{serif}[true]{\@nameuse{DejaVu@serif#1}} \DeclareOptionX{math}[true]{\@nameuse{DejaVu@math#1}} % \providecommand\DejaVuRM@features{Scale=0.92}% Roman \providecommand\DejaVuSS@features{Scale=0.92}% SansSerif \providecommand\DejaVuTT@features{Scale=MatchLowercase,FakeStretch=0.9}% Typewriter \providecommand\DejaVuMM@features{}% Math regular \providecommand\DejaVuMMbold@features{}% Math bold \providecommand\DejaVu@DefaultFeatures{} \DeclareOptionX{RM}{\renewcommand*{\DejaVuRM@features}{#1}} \DeclareOptionX{SS}{\renewcommand*{\DejaVuSS@features}{#1}} \DeclareOptionX{TT}{\renewcommand*{\DejaVuTT@features}{#1}} \DeclareOptionX{MM}{\renewcommand*{\DejaVuMM@features}{#1}} \DeclareOptionX{MMbold}{\renewcommand*{\DejaVuMMbold@features}{#1}} \DeclareOptionX{DefaultFeatures}{\def\DejaVu@DefaultFeatures{#1}} \ProcessOptionsX\relax \defaultfontfeatures{Ligatures=TeX,RawFeature={-smcp},\DejaVu@DefaultFeatures}% default in fontspec % \ifDejaVu@usefilenames % 14. DejaVuSerif-Bold.ttf /usr/local/texlive/2024/texmf-dist/fonts/truetype/public/dejavu/ % 15. DejaVuSerif-BoldItalic.ttf /usr/local/texlive/2024/texmf-dist/fonts/truetype/public/dejavu/ % 16. DejaVuSerif-Italic.ttf /usr/local/texlive/2024/texmf-dist/fonts/truetype/public/dejavu/ % 17. DejaVuSerif.ttf /usr/local/texlive/2024/texmf-dist/fonts/truetype/public/dejavu/ % 18. DejaVuSerifCondensed-Bold.ttf /usr/local/texlive/2024/texmf-dist/fonts/truetype/public/dejavu/ % 19. DejaVuSerifCondensed-BoldItalic.ttf /usr/local/texlive/2024/texmf-dist/fonts/truetype/public/dejavu/ % 20. DejaVuSerifCondensed-Italic.ttf /usr/local/texlive/2024/texmf-dist/fonts/truetype/public/dejavu/ % 21. DejaVuSerifCondensed.ttf /usr/local/texlive/2024/texmf-dist/fonts/truetype/public/dejavu/ % \ifDejaVu@serif \setmainfont{DejaVuSerif}[% main rm \DejaVuRM@features, Extension = .ttf, UprightFont= *, BoldFont = *-Bold, ItalicFont = *-Italic, BoldItalicFont = *-BoldItalic, ] \fi % % 1. DejaVuSans-Bold.ttf /usr/local/texlive/2024/texmf-dist/fonts/truetype/public/dejavu/ % 2. DejaVuSans-BoldOblique.ttf /usr/local/texlive/2024/texmf-dist/fonts/truetype/public/dejavu/ % 3. DejaVuSans-ExtraLight.ttf /usr/local/texlive/2024/texmf-dist/fonts/truetype/public/dejavu/ % 4. DejaVuSans-Oblique.ttf /usr/local/texlive/2024/texmf-dist/fonts/truetype/public/dejavu/ % 5. DejaVuSans.ttf /usr/local/texlive/2024/texmf-dist/fonts/truetype/public/dejavu/ % 6. DejaVuSansCondensed-Bold.ttf /usr/local/texlive/2024/texmf-dist/fonts/truetype/public/dejavu/ % 7. DejaVuSansCondensed-BoldOblique.ttf /usr/local/texlive/2024/texmf-dist/fonts/truetype/public/dejavu/ % 8. DejaVuSansCondensed-Oblique.ttf /usr/local/texlive/2024/texmf-dist/fonts/truetype/public/dejavu/ % 9. DejaVuSansCondensed.ttf /usr/local/texlive/2024/texmf-dist/fonts/truetype/public/dejavu/ % 10. DejaVuSansMono-Bold.ttf /usr/local/texlive/2024/texmf-dist/fonts/truetype/public/dejavu/ % 11. DejaVuSansMono-BoldOblique.ttf /usr/local/texlive/2024/texmf-dist/fonts/truetype/public/dejavu/ % 12. DejaVuSansMono-Oblique.ttf /usr/local/texlive/2024/texmf-dist/fonts/truetype/public/dejavu/ % 13. DejaVuSansMono.ttf /usr/local/texlive/2024/texmf-dist/fonts/truetype/public/dejavu/ % \ifDejaVu@sans \setsansfont{DejaVuSans}[% main sans Extension = .ttf, \DejaVuSS@features, BoldFont = *-Bold, ItalicFont= *-Oblique, BoldItalicFont = *-BoldOblique, ] \fi % \ifDejaVu@mono \setmonofont{DejaVuSansMono}[% main typewriter UprightFont = *, Extension = .ttf, BoldFont = *-Bold, ItalicFont= *-Oblique, BoldItalicFont = *-BoldOblique, \DejaVuTT@features, ] \fi % % Setting math % First we have to expand the feature macros: \ifDejaVu@math \edef\Set@MathNormal{\noexpand\setmathfont{texgyredejavu-math.otf}[AutoFakeBold=1.4,\DejaVuMM@features,version=normal]}% \Set@MathNormal % \ifxetex % \edef\Set@MathBold{\noexpand\setmathfont{texgyredejavu-math.otf}[AutoFakeBold=2,\DejaVuMMbold@features,version=bold]}% % \Set@MathBold % \fi \fi % \newfontfamily\DejaVuSerifCondensed{DejaVuSerifCondensed}[% \DejaVuRM@features, Extension = .ttf, UprightFont= *, BoldFont = *-Bold, ItalicFont = *-Italic, BoldItalicFont = *-BoldItalic, ] \newfontfamily\DejaVuSansCondensed{DejaVuSansCondensed}[% Extension = .ttf, \DejaVuSS@features, UprightFont= *, BoldFont = *-Bold, ItalicFont= *-Oblique, BoldItalicFont = *-BoldOblique, ] \newfontfamily\DejaVuSansLight{DejaVuSans-ExtraLight}[% Extension = .ttf, \DejaVuSS@features, BoldFont = *, BoldFeatures = { RawFeature={embolden=3} }, ItalicFont = *, ItalicFeatures = { FakeSlant = 0.2}, BoldItalicFont = *, BoldItalicFeatures = { RawFeature={embolden=3},FakeSlant=0.2}, ] \else %----------------------------------------- symbolic names ---------------------------- \typeout {Using symbolic names for the DejaVu font}% \ifDejaVu@serif \setmainfont{DejaVu Serif}[% main rm \DejaVuRM@features, UprightFont= *, BoldFont = * Bold, ItalicFont = * Italic, BoldItalicFont = * Bold Italic, SmallCapsFont = *, % % SmallCapsFeatures={Letters=SmallCaps}, % UprightFeatures = { SmallCapsFont={ }}, % BoldFeatures = { SmallCapsFont={ }}, % ItalicFeatures = { SmallCapsFont={ }}, % BoldItalicFeatures = { SmallCapsFont={ }}, ] \fi % \ifDejaVu@sans \setsansfont{DejaVu Sans}[% main sans \DejaVuSS@features, UprightFont= *, BoldFont = * Bold, ItalicFont= * Oblique, BoldItalicFont = * Bold Oblique, % SmallCapsFont = *, % % SmallCapsFeatures={Letters=SmallCaps}, ] \fi % \ifDejaVu@mono \setmonofont{DejaVu Sans Mono}[ UprightFont= *, \DejaVuTT@features, BoldFont = * Bold, ItalicFont= * Oblique, BoldItalicFont = * Bold Oblique, ] \fi % % Setting math % First we have to expand the feature macros: \ifDejaVu@math \ifxetex \edef\Set@MathNormal{\noexpand\setmathfont{texgyredejavu-math.otf}[AutoFakeBold=1,\DejaVuMMbold@features]}% \else \edef\Set@MathNormal{\noexpand\setmathfont{TeXGyreDejaVuMath-Regular}[\DejaVuMM@features]% \noexpand\setmathfont{TeXGyreDejaVuMath-Regular}[\DejaVuMM@features,version=bold]% }% \fi \Set@MathNormal \fi \newfontfamily\DejaVuSerifCondensed{DejaVu Serif Condensed}[% \DejaVuRM@features, UprightFont= *, BoldFont = * Bold, ItalicFont = * Italic, BoldItalicFont = * Bold Italic, ] \newfontfamily\DejaVuSansCondensed{DejaVu Sans Condensed}[% \DejaVuSS@features, UprightFont= *, BoldFont = * Bold, ItalicFont= * Oblique, BoldItalicFont = * Bold Oblique, ] \newfontfamily\DejaVuSansLight{DejaVu Sans ExtraLight}[% UprightFont = *, \DejaVuSS@features, BoldFont = *, BoldFeatures = { RawFeature={embolden=3} }, ItalicFont= *, ItalicFeatures = { FakeSlant = 0.2}, BoldItalicFont = *, BoldItalicFeatures = { RawFeature={embolden=3},FakeSlant=0.2}, ] \fi \endinput