summaryrefslogtreecommitdiff
path: root/fonts/tex-gyre/latex/tgcursor.sty
blob: 6ce8d3a2dafcb67c6ab651d1a85ca8319b8401e3 (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
%% Begin of file `tgcursor.sty'. 
% This file belongs to the TeX Gyre collection of fonts. The work is released
% under the GUST Font License. See the MANIFEST-TeX-Gyre-Cursor.txt
% and README-TeX-Gyre-Cursor.txt files for the details.
% For the most recent version of this license see
% http://www.gust.org.pl/fonts/licenses/GUST-FONT-LICENSE.txt or
% http://tug.org/fonts/licenses/GUST-FONT-LICENSE.txt
%% ----------------------------------------------------------------------------
%% [EN] LaTeX2e support for Tex Gyre Cursor fonts
%% The declaration `\usepackage{tgcursor}' in the LaTeX preamble
%% will set TeX Gyre Cursor as the default typewriter font for the document. 
%%
%% [PL] Wspomaga stosowanie w LaTeXu kroju Tex Gyre Cursor
%% Umieszczenie linijki `\usepackage{tgcursor}' w preambule spowoduje
%% ustawienie TeX Gyre Cursor jako podstawowego maszynowego kroju
%% dokumenu, czyli kroju skojarzonego z poleceniem \ttfamily.
%% W dokumenach po polsku konieczne jest uaktywnienie kodowania
%% T1, QX lub OT4 (najlepiej przy pomocy pakietu 'polski'). Np.:
%%
%% \usepackage{tgcursor}
%% \usepackage[T1]{polski}
%% ----------------------------------------------------------------------------


\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{tgcursor}
  [2009/09/10 v1.2 TeX Gyre Cursor as default typewriter family]

\def\tg@scale@to@rm#1#2{%
  \begingroup
  \fontsize{10}{0}\usefont{\encodingdefault}{\rmdefault}{m}{n}%
  #1%
  \xdef\qcr@scale{%
    \strip@pt
    \dimexpr  1pt *
    \@tempdima / \dimexpr#2pt\relax 
    \relax}%
  \PackageInfo{tgcursor}{The qcr family is scaled by \qcr@scale}
  \endgroup
}

\RequirePackage{kvoptions}
\SetupKeyvalOptions{prefix=qcr@}
\DeclareStringOption{scale}[1]
\define@key{tgcursor}{matchlowercase}[1]{%
  \tg@scale@to@rm{\@tempdima#1\fontdimen5\font}{4.17}}
\define@key{tgcursor}{matchuppercase}[1]{%
  \tg@scale@to@rm{\setbox0\hbox{XWYZH}\@tempdima#1\ht0}{5.69498}}
\DeclareVoidOption{oldspacing}{}
\ProcessKeyvalOptions*

\renewcommand{\ttdefault}{qcr}
\renewcommand\bfdefault{b}

\endinput
%% 
%% End of file `tgcursor.sty'.