• Tidak ada hasil yang ditemukan

Contents L TEXSupportforMicrosoftGeorgiaandITCFranklinGothicInTextandMath

N/A
N/A
Protected

Academic year: 2023

Membagikan "Contents L TEXSupportforMicrosoftGeorgiaandITCFranklinGothicInTextandMath"

Copied!
12
0
0

Teks penuh

(1)

L A TEX Support for Microsoft Georgia and ITC Franklin Gothic In Text and Math

Boris Veytsman

2009/07/08, v0.4

Abstract

This package provides LATEX support for Microsoft Georgia and ITC Franklin Gothic fonts, supplied, for example, with Microsoft Windows. You need to convert the fonts to Type 1 format to use this package. The package provides full support for text and math.

Contents

1 Introduction 2

2 Installation 2

3 Implementation 4

3.1 Identification . . . 4

3.2 Fontinst Driver . . . 4

3.3 Fontmap Generation . . . 7

3.4 Style File . . . 7

3.5 Metrics Files . . . 8

3.6 Encoding Files . . . 8

[email protected], [email protected]

(2)

1 Introduction

Georgia is a baroque serif typeface designed by Matthew Carter in 1993 and dis- tributed by Microsoft Corporation. Franklin Gothic is a realist sans-serif typeface designed by Morris Fuller Benton in 1902. ITC Franklin Gothic, designed by David Berlow, are distributed by Microsoft. In this package we add LATEX support files for both packages.

An alternative support for these fonts is provided by winfonts [1] package.

However, there are several reasons why we chose to re-implement the LATEX sup- port:

1. winfonts package uses True Type fonts, and these fonts do not work well with dvips. The present package uses Postscript Type 1 versions of these fonts, which work nicely with both pdftex and dvips.

2. winfonts package does not provide a number of fonts such as Franklin Gothic Demi and Franklin Gothic Heavy variants.

3. The most important reason for the reimplementation is that we want to use text fonts with matching math fonts.

Since winfonts may be installed on a number of computers, we took care not to clash with it. For this we were forced to slightly deviate from the conventions of the fontname scheme [2]. Namely, according to this scheme the font families should be called jgi and ifg. To make unique names, we choose our text fonts to be called xjgi and xifg, and our math fonts to be called zjgi and zifg correspondingly.

This package is released under BSD license to make updating the fonts metrics easier.

The support of text fonts is limited to T1 and TS1 encoding. No VTeX support files are included.

The math support is very preliminary: there is a lot of work to do on individual kerning and glyph placement!

2 Installation

First, you need to transform the fonts to the Type 1. Actually, pdflatex can use fonts in TTF format too, but to use the fonts when making PostScript output we need Type 1. Due to legal constraints we do not include Type 1 fonts in the distribution; you need either to buy them, or to create them yourself if you have the fonts in the TrueType (TTF) formats. In the first case you need to rename them accordingly to Table 1. In the second case you need the TTF files, named similarly to the ones in Table 1, and the conversion program, for example, ttf2pt1 (http://ttf2pt1.sourceforge.net/)1. Convert the files to Type 1 format with the commands like

1This program is a part of many Linux distributions.

(3)

Table 1: PFB Files

File Font NFSS Code

georgia.pfb Georgia m

georgiai.pfb Georgia Italic mi

georgiab.pfb Georgia Bold b

georgiaz.pfb Georgia Bold Italic bi

frabk.pfb Franklin Gothic Book Regular k frabkit.pfb Franklin Gothic Book Italic ki framd.pfb Franklin Gothic Medium Regular m framdit.pfb Franklin Gothic Medium Italic mi framdcn.pfb Franklin Gothic Medium Cond Regular mc fradm.pfb Franklin Gothic Demi Regular d fradmit.pfb Franklin Gothic Demi Italic di fradmcn.pfb Franklin Gothic Demi Cond Regular dc frahv.pfb Franklin Gothic Heavy Regular h frahvit.pfb Franklin Gothic Heavy Italic hi

ttf2pt1 -a -b georgia.ttf ttf2pt1 -a -b georgiai.ttf ...

It is important to use the option -a in the call to this program, since we need all glyphs in the resulting files!

People often ask the question whether such translation is legal provided that you own the fonts. I am not in the position to give a legal advice on this mat- ter. Perhaps you may want to purchase a separate font license from Ascender Corporation, http://www.ascenderfonts.com.

Now install Georgia PFB files in $TEXMF/fonts/type1/microsoft/georgia.

Install Franklin Gothic files in $TEXMF/fonts/type1/itc/franklingothic. Then download http://ctan.tug.org/install/fonts/psfonts/mathgifg.tds.zip.

Unzip the file in $TEXMF. Add +mathgifg.map to the configuration files of dvips, pdftex and your dvi previewer.

Run updmap and texhash programs to update the configuration files and file names database.

To use the fonts in LATEX add \usepackage{mathgifg} to your preamble.

(4)

3 Implementation

3.1 Identification

We start with the declaration who we are. Most .dtx files put driver code in a separate driver file .drv. We roll this code into the main file, and use the pseudo-guard <gobble> for it.

1hstylei\NeedsTeXFormat{LaTeX2e}

2h∗gobblei

3\ProvidesFile{mathgifg.dtx}

4h/gobblei

5hstylei\ProvidesClass{mathgifg}

6hdrvi\ProvidesFile{drv.tex}

7hmapi\ProvidesFile{map.tex}

8h∗style | drv | mapi

9[2009/07/08 v0.4 Using Georgia and Franklin Gothic in LaTeX]

10h/style | drv | mapi And the driver code:

11h∗gobblei

12\documentclass{ltxdoc}

13\usepackage{booktabs}

14\usepackage{url}

15\usepackage[breaklinks,colorlinks,linkcolor=black,citecolor=black,

16 pagecolor=black,urlcolor=black,hyperindex=false]{hyperref}

17\PageIndex

18\CodelineIndex

19\RecordChanges

20\EnableCrossrefs

21\begin{document}

22 \DocInput{mathgifg.dtx}

23\end{document}

24h/gobblei

3.2 Fontinst Driver

This follows [3].

First, the preamble

25h∗drvi

26\input fontinst.sty

27\substitutesilent{bx}{b}

28\substitutesilent{b}{d}

29\substitutesilent{l}{k}

Starting recording transforms:

30\recordtransforms{rec.tex}

Text fonts are in 8r encoding:

31\transformfont{xjgim8r}{\reencodefont{8r}{\fromafm{georgia}}}

32\transformfont{xjgimi8r}{\reencodefont{8r}{\fromafm{georgiai}}}

(5)

33\transformfont{xjgib8r}{\reencodefont{8r}{\fromafm{georgiab}}}

34\transformfont{xjgibi8r}{\reencodefont{8r}{\fromafm{georgiaz}}}

35\transformfont{xifgk8r}{\reencodefont{8r}{\fromafm{frabk}}}

36\transformfont{xifgki8r}{\reencodefont{8r}{\fromafm{frabkit}}}

37\transformfont{xifgm8r}{\reencodefont{8r}{\fromafm{framd}}}

38\transformfont{xifgmi8r}{\reencodefont{8r}{\fromafm{framdit}}}

39\transformfont{xifgm8rc}{\reencodefont{8r}{\fromafm{framdcn}}}

40\transformfont{xifgd8r}{\reencodefont{8r}{\fromafm{fradm}}}

41\transformfont{xifgdi8r}{\reencodefont{8r}{\fromafm{fradmit}}}

42\transformfont{xifgd8rc}{\reencodefont{8r}{\fromafm{fradmcn}}}

43\transformfont{xifgh8r}{\reencodefont{8r}{\fromafm{frahv}}}

44\transformfont{xifghi8r}{\reencodefont{8r}{\fromafm{frahvit}}}

The interesting thing about Georgia and Franklin Gothic is the rich set of Greek letters and symbols. We can actually try to use them in math.

Math fonts in OT1 encoding. o means “original”. To avoid conflict with ot1.enc, we rename these encodings.

45\transformfont{zjgimo7t}{\reencodefont{gifgot1}{\fromafm{georgia}}}

46\transformfont{zifgko7t}{\reencodefont{gifgot1}{\fromafm{frabk}}}

47\transformfont{zifgdo7t}{\reencodefont{gifgot1}{\fromafm{fradm}}}

In OML encoding:

48\transformfont{zjgimio7m}{\reencodefont{gifgoml}{\fromafm{georgiai}}}

49\transformfont{zifgko7m}{\reencodefont{gifgoml}{\fromafm{frabk}}}

50\transformfont{zifgdo7m}{\reencodefont{gifgoml}{\fromafm{fradm}}}

In OMS and OMX encoding

51\transformfont{zjgimo7y}{\reencodefont{gifgoms}{\fromafm{georgia}}}

52\transformfont{zjgimo7v}{\reencodefont{gifgomx}{\fromafm{georgia}}}

Now we install the fonts. First T1.

53\installfonts

54\installfamily{T1}{xjgi}{}

55\installfont{xjgim8t}{xjgim8r,newlatin}{t1}{T1}{xjgi}{m}{n}{}

56\installfont{xjgimi8t}{xjgimi8r,newlatin}{t1}{T1}{xjgi}{m}{it}{}

57\installfont{xjgib8t}{xjgib8r,newlatin}{t1}{T1}{xjgi}{b}{n}{}

58\installfont{xjgibi8t}{xjgibi8r,newlatin}{t1}{T1}{xjgi}{b}{it}{}

59\endinstallfonts

60\installfonts

61\installfamily{T1}{xifg}{}

62\installfont{xifgk8t}{xifgk8r,newlatin}{t1}{T1}{xifg}{k}{n}{}

63\installfont{xifgki8t}{xifgki8r,newlatin}{t1}{T1}{xifg}{k}{it}{}

64\installfont{xifgm8t}{xifgm8r,newlatin}{t1}{T1}{xifg}{m}{n}{}

65\installfont{xifgmi8t}{xifgmi8r,newlatin}{t1}{T1}{xifg}{m}{it}{}

66\installfont{xifgm8tc}{xifgm8rc,newlatin}{t1}{T1}{xifg}{mc}{n}{}

67\installfont{xifgd8t}{xifgd8r,newlatin}{t1}{T1}{xifg}{d}{n}{}

68\installfont{xifgdi8t}{xifgdi8r,newlatin}{t1}{T1}{xifg}{d}{it}{}

69\installfont{xifgd8tc}{xifgd8rc,newlatin}{t1}{T1}{xifg}{dc}{n}{}

70\installfont{xifgh8t}{xifgh8r,newlatin}{t1}{T1}{xifg}{h}{n}{}

71\installfont{xifghi8t}{xifghi8r,newlatin}{t1}{T1}{xifg}{h}{it}{}

72\endinstallfonts

(6)

And then TS1

73\installfonts

74\installfamily{TS1}{xjgi}{}

75\installfont{xjgim8c}{xjgim8r,textcomp}{ts1}{TS1}{xjgi}{m}{n}{}

76\installfont{xjgimi8c}{xjgimi8r,textcomp}{ts1}{TS1}{xjgi}{m}{it}{}

77\installfont{xjgib8c}{xjgib8r,textcomp}{ts1}{TS1}{xjgi}{b}{n}{}

78\installfont{xjgibi8c}{xjgibi8r,textcomp}{ts1}{TS1}{xjgi}{b}{it}{}

79\endinstallfonts

80\installfonts

81\installfamily{TS1}{xifg}{}

82\installfont{xifgk8c}{xifgk8r,textcomp}{ts1}{TS1}{xifg}{k}{n}{}

83\installfont{xifgki8c}{xifgki8r,textcomp}{ts1}{TS1}{xifg}{k}{it}{}

84\installfont{xifgm8c}{xifgm8r,textcomp}{ts1}{TS1}{xifg}{m}{n}{}

85\installfont{xifgmi8c}{xifgmi8r,textcomp}{ts1}{TS1}{xifg}{m}{it}{}

86\installfont{xifgm8cc}{xifgm8rc,textcomp}{ts1}{TS1}{xifg}{mc}{n}{}

87\installfont{xifgd8c}{xifgd8r,textcomp}{ts1}{TS1}{xifg}{d}{n}{}

88\installfont{xifgdi8c}{xifgdi8r,textcomp}{ts1}{TS1}{xifg}{d}{it}{}

89\installfont{xifgd8cc}{xifgd8rc,textcomp}{ts1}{TS1}{xifg}{dc}{n}{}

90\installfont{xifgh8c}{xifgh8r,textcomp}{ts1}{TS1}{xifg}{h}{n}{}

91\installfont{xifghi8c}{xifghi8r,textcomp}{ts1}{TS1}{xifg}{h}{it}{}

92\endinstallfonts

Math fonts are different. Here we basically follow the recommendations of [4]

and [5].

First, we need text fonts for “operators” and “letters”:

93\installfonts

94\installfamily{OT1}{zjgi}{}

95\installfont{zjgim7t}{zjgimo7t,resetdigits,calcmetrics,xifgk8r,%

96 latin}{ot1}{OT1}{zjgi}{m}{n}{}

97\endinstallfonts Now “letters”

98\installfonts

99\installfamily{OML}{zjgi}{\skewchar\font=127}

100\installfont{zjgimi7m}{zjgimio7m,calcmetrics,xjgimi8r,%

101 kernoff,cmmi10,kernon,mathit}{oml}{OML}{zjgi}{m}{it}{}

102\endinstallfonts

103\installfonts

104\installfamily{OML}{zifg}{\skewchar\font=127}

105\installfont{zifgk7m}{zifgko7m,calcmetrics,zifgko7t,kernoff,cmmi10,kernon,%

106 mathit}{oml}{OML}{zifg}{k}{n}{}

107\installfont{zifgd7m}{zifgdo7m,calcmetrics,zifgdo7t,kernoff,cmmib10,kernon,%

108 mathit}{oml}{OML}{zifg}{d}{n}{}

109\endinstallfonts

Symbols. We take everything we do not have from CM:

110\installfonts

111\installfamily{OMS}{zjgi}{\skewchar\font=48}

112\installfont{zjgim7y}{zjgimo7y,zjgimo7t,calcmetrics,%

113 kernoff,cmsy10,kernon,mathsy}{oms}{OMS}{zjgi}{m}{n}{}

114\endinstallfonts

(7)

Same for big symbols Symbols. We take everything we do not have from CM:

115\installfonts

116\installfamily{OMX}{zjgi}{}

117\installfont{zjgim7v}{zjgimo7v,zjgimo7t,calcmetrics,%

118 kernoff,cmex10,kernon}{omx}{OMX}{zjgi}{m}{n}{}

119\endinstallfonts And the end:

120\endrecordtransforms

121\bye

122h/drvi

3.3 Fontmap Generation

This is a standard procedure [3]

123h∗mapi

124\input finstmsc.sty

125\resetstr{PSfontsuffix}{.pfb}

126\adddriver{dvips}{mathgifg.map}

127\input rec.tex

128\donedrivers

129\bye

130h/mapi

3.4 Style File

We again use the ideas from [5].

131h∗stylei

132\RequirePackage[T1]{fontenc}

133\RequirePackage{textcomp}

134\RequirePackage{keyval}

135\renewcommand{\sfdefault}{xifg}

136\renewcommand{\rmdefault}{xjgi}

137\DeclareSymbolFont{operators}{OT1}{zjgi}{m}{n}

138\DeclareSymbolFont{letters}{OML}{zjgi}{m}{it}

139\DeclareSymbolFont{symbols}{OMS}{zjgi}{m}{n}

140\DeclareSymbolFont{largesymbols}{OMX}{zjgi}{m}{n}

141\DeclareSymbolFont{sfletters}{OML}{zifg}{k}{n}

142\DeclareSymbolFont{bfletters}{OML}{zifg}{d}{n}

143\SetSymbolFont{letters}{bold}{OML}{zifg}{d}{n}

144\DeclareSymbolFontAlphabet{\mathsf}{sfletters}

145\DeclareSymbolFontAlphabet{\mathbf}{bfletters}

146\DeclareRobustCommand\hbar{{%

147 \[email protected]%

148 \[email protected]%

149 \def\@tempa##1##2{{%

150 \lower##1\dimen@\rlap{\kern##1\dimen@ii\the##2 0\char22}}}%

151 \mathchoice\@tempa\@ne\textfont

152 \@tempa\@ne\textfont

(8)

153 \@tempa\defaultscriptratio\scriptfont

154 \@tempa\defaultscriptscriptratio\scriptscriptfont

155 h}}

156\let\s@vedhbar\hbar

157\AtBeginDocument{%

158 \@ifpackageloaded{amsfonts}{\let\hbar\s@vedhbar}{}}

159h/stylei

3.5 Metrics Files

A simple mtx file resets digits. We need it to substitute Franklin Gothic numbers for Georgia numbers in math:

160h∗resetdigitsi

161\relax

162Reset all digits

163\metrics

164\unsetglyph{zero}

165\unsetglyph{one}

166\unsetglyph{two}

167\unsetglyph{three}

168\unsetglyph{four}

169\unsetglyph{five}

170\unsetglyph{six}

171\unsetglyph{seven}

172\unsetglyph{eight}

173\unsetglyph{nine}

174\endmetrics

175h/resetdigitsi

Another mtx file to calculate metrics for badly defined fonts. See [4].

176h∗calcmetricsi

177\relax

178Calculate missing metrics

179\metrics

180\resetint{xheight}{\height{x}}

181\endmetrics

182h/calcmetricsi

3.6 Encoding Files

This is a copy of ot1.etx from [5]. We rename it to avoid conflict with other ot1.enc in the result.

183h∗gifgot1i

184\input ot1.etx

185h/gifgot1i

Same with OML:

186h∗gifgomli

187\input oml.etx

188h/gifgomli

(9)

And OMS:

189h∗gifgomsi

190\input oms.etx

191h/gifgomsi

And, finally, OMX

192h∗gifgomxi

193\input omx.etx

194h/gifgomxi

(10)

References

[1] Paul Pichaureau. Winfonts & Windingbats. Two Packages to Use Win- dows Core Fonts, January 2006. http://www.ctan.org/tex-archive/fonts/

winfonts/.

[2] Karl Berry. Fontname. Filenames For TEX Fonts, September 2005. http:

//www.ctan.tug.org/tex-archive/info/fontname.

[3] Philipp Lehman. The Font Installation Guide, December 2004. http://www.

ctan.org/tex-archive/info/Type1fonts/fontinstallationguide.

[4] Alan Hoenig. TEX Unbound: LATEX and TEX Strategies for Fonts, Graphics, and More. Oxford University Press, USA, 1998.

[5] Walter Schmidt. Using Common PostScript Fonts With LATEX. PSNFSS Version 9.2, September 2004. http://ctan.tug.org/tex-archive/macros/

latex/required/psnfss.

(11)

Change History

v0.1

General: First fully functional ver- sion . . . 1 v0.2

General: Changed bold default for

Franklin Gothic . . . 1 v0.3

General: Math changes . . . 1 v0.4

General: Renamed encoding files . 1

(12)

Index

Numbers written in italic refer to the page where the corresponding entry is de- scribed; numbers underlined refer to the code line of the definition; numbers in roman refer to the code lines where the entry is used.

Symbols

\@ifpackageloaded . 158

\@ne . . . 151, 152

\@tempa . . . 149, 151–154 A

\adddriver . . . 126

\AtBeginDocument . . 157

B \begin . . . 21

\bye . . . 121, 129 C \char . . . 150

\CodelineIndex . . . . 18

D \DeclareRobustCommand . . . 146

\DeclareSymbolFont . . . . 137–142 \DeclareSymbolFontAlphabet . . . 144, 145 \def . . . 149

\defaultscriptratio 153 \defaultscriptscriptratio . . . 154

\dimen@ . . . 147, 150 \dimen@ii . . . . 148, 150 \DocInput . . . 22

\documentclass . . . . 12

\donedrivers . . . 128

E \EnableCrossrefs . . 20

\end . . . 23

\endinstallfonts 59, 72, 79, 92, 97, 102, 109, 114, 119 \endmetrics . . . 174, 181 \endrecordtransforms . . . 120

F \font . . . 99, 104, 111 \fromafm . . . 31–52 H \hbar . . . 146, 156, 158 \height . . . 180

I \input . 26, 124, 127, 184, 187, 190, 193 \installfamily . . . . . 54, 61, 74, 81, 94, 99, 104, 111, 116 \installfont . 55–58, 62–71, 75–78, 82–91, 95, 100, 105, 107, 112, 117 \installfonts . . . . . . 53, 60, 73, 80, 93, 98, 103, 110, 115 K \kern . . . 150

L \let . . . 156, 158 \lower . . . 150

M \mathbf . . . 145

\mathchoice . . . 151

\mathsf . . . 144

\metrics . . . 163, 179 N \NeedsTeXFormat . . . . 1

P \PageIndex . . . 17

\ProvidesClass . . . 5

\ProvidesFile . . . 3, 6, 7 R \RecordChanges . . . . 19

\recordtransforms . 30 \reencodefont . . . 31–52 \relax . . . 161, 177 \renewcommand . 135, 136 \RequirePackage 132–134 \resetint . . . 180

\resetstr . . . 125

\rlap . . . 150

\rmdefault . . . 136

S \s@vedhbar . . . 156, 158 \scriptfont . . . 153

\scriptscriptfont . 154 \SetSymbolFont . . . . 143

\sfdefault . . . 135

\skewchar . 99, 104, 111 \substitutesilent . . . . 27–29 T \textfont . . . . 151, 152 \the . . . 150

\transformfont . . 31–52 U

\unsetglyph . . . 164–173

\usepackage . . . 13–15

Referensi

Dokumen terkait

Untuk lebih memperjelas pembahasan mengenai WAP, WML dan PHP, pada bagian berikutnya penulis memberikan sebuah contoh aplikasi pemesanan tiket bioskop berbasis WAP yang pada

Dalam PKMM biasanya merupakan kondisi di masyarakat yang menjadi lebih baik yang akan dicapai sesuai tujuan.

Dengan disusunnya program kerja ini dapat dijadikan pedoman dalam pengelolaan SMK Muhamadiyah Kawali khususnya dalam bidang Hubungan Masyarakat, dan Hubung

Data sekunder adalah data yang bersumber dari hasil penelitian kepustakaan, baik itu literatur, dokumen informasi media cetak serta kajian perundang-undangan

Puji syukur penulis panjatkan kehadirat Allah SWT yang telah memberikan rahmat, anugerah, serta karunia-Nya, sehingga penulis dapat menyelesaikan Tugas Akhir serta

Satu koloni dari stok bakteri pada media agar diambil dan dikulturkan dalam media LB + kanamisin 50 µg/mL dan diinkubasi pada suhu 28°C dalam shaker dengan kecepatan 150 rpm

Keadaan tersebut dijadikan sebagai dasar pemikiran untuk penulisan skripsi tentang “Alat Evaluasi Pembelajaran Pembuatan Pola Peplum Pada Busana Pesta Wanita ”

Tujuan umum dari penelitian ini adalah untuk mempelajari pola asuh makan serta kaitannya dengan status gizi anak balita pada berbagai tingkat ketahanan pangan