forked from tzwenn/ubuntu-latex-fonts
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Can choose font by passing option to package, can even toggle inside
- Loading branch information
Showing
1 changed file
with
47 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,55 @@ | ||
\ProvidesPackage{ubuntu} | ||
\RequirePackage{ifpdf} | ||
\RequirePackage{ifthen} | ||
|
||
% For PDF map the TrueType fonts | ||
\ifpdf | ||
\pdfmapfile{+ubuntu.map} | ||
\fi | ||
|
||
\renewcommand{\encodingdefault}{T1} | ||
\renewcommand{\rmdefault}{ubuntu} | ||
% Options represented by boolean - not nice | ||
% TODO: case by value | ||
|
||
\newboolean{ubuntuRegular} | ||
\setboolean{ubuntuRegular}{true} | ||
|
||
\newboolean{ubuntuNone} | ||
\setboolean{ubuntuNone}{false} | ||
|
||
% Parse options | ||
|
||
\DeclareOption*{% | ||
\PackageWarning{ubuntu}{Unknown option ‘\CurrentOption’}% | ||
} | ||
|
||
\DeclareOption{none}{% | ||
\setboolean{ubuntuRegular}{false} | ||
\setboolean{ubuntuNone}{true} | ||
} | ||
|
||
\DeclareOption{regular}{% | ||
\setboolean{ubuntuRegular}{true} | ||
\setboolean{ubuntuNone}{false} | ||
} | ||
\ProcessOptions\relax | ||
|
||
% Commands | ||
|
||
\newcommand{\Ubuntu}{% | ||
\renewcommand{\encodingdefault}{T1}% | ||
\renewcommand{\rmdefault}{ubuntu}% | ||
} | ||
|
||
\newcommand{\fontubuntu}{% | ||
\usefont{T1}{ubuntu}{m}{n} | ||
} | ||
|
||
% Initial font | ||
|
||
\ifthenelse{\boolean{ubuntuRegular}}{% | ||
\Ubuntu{} % | ||
}{\ifthenelse{\boolean{ubuntuNone}}{% | ||
}{% | ||
}} | ||
|
||
\endinput |