From e0c6872cf40896c7be36b11dcc744620f10adf1d Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 2 Sep 2019 13:46:59 +0900 Subject: Initial commit --- info/TrueType/ttf-tetex.tex | 444 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 444 insertions(+) create mode 100644 info/TrueType/ttf-tetex.tex (limited to 'info/TrueType/ttf-tetex.tex') diff --git a/info/TrueType/ttf-tetex.tex b/info/TrueType/ttf-tetex.tex new file mode 100644 index 0000000000..5dc72e131e --- /dev/null +++ b/info/TrueType/ttf-tetex.tex @@ -0,0 +1,444 @@ +\documentclass[a4paper,fleqn,11pt]{article} +\usepackage[T1]{fontenc} % use T1 fonts +\usepackage{graphicx} % graphic inclusion commands +\usepackage{url} % internet addresses +\newcommand*{\orgurl}{} +\let\orgurl=\url % save original url command in orgurl +\usepackage{html} % make compilable for latex2html + % hint by Heiko Oberdiek, oberdiek@ruf.uni-freiburg.de +\usepackage{hyperref} % hyper references +\usepackage{thumbpdf} % pdf thumbnails + +% setup for pdf file format +\hypersetup{% + pdftitle={Using TrueType fonts with \TeX\ via Postscript Type\,1 format}, + pdfsubject={Using TrueType fonts with \TeX\ via Postscript Type\,1 format}, + pdfkeywords={truetype, pdftex, pdflatex, dvips, type1, postscript, + font, tex, latex}, + pdfauthor={Harald Harders (mailto:h.harders@tu-bs.de)}, + pdfcreator={\LaTeX}, + pdfproducer={pdf\LaTeX}, + bookmarksopen=true, + bookmarksnumbered=true, + pdfstartview={FitH 1000}, +% pdfview={Fit H 1000} +} +% use color links only in pdf file (because ps file does not have +% active links) +\makeatletter +\ifx\pdftexversion\undefined +\else + \hypersetup{colorlinks=true} +\fi +%\@ifundefined{pdfoutput}{}{\hypersetup{colorlinks=true}} +\makeatother + +% one command for references in both pdf and html output +\latexhtml{% + \newcommand{\hypref}[2]{\href{#2}{\texttt{#1}}} +}{% + \newcommand{\hypref}[2]{\htmladdnormallink{\texttt{#1}}{#2}} +} +%\newcommand{\hypref}[2]{\latexhtml{\href{#2}{\texttt{#1}}} +% {\htmladdnormallink{\texttt{#1}}{#2}}} + +% data for the title page +\title{Using TrueType fonts with \TeX\ via Postscript Type\,1 format} +\author{Harald Harders + (\hypref{\orgurl{h.harders@tu-bs.de}}{mailto:h.harders@tu-bs.de})} +\date{2003-10-31} + +% ----------------------------------------------------------------------- +\begin{document} +% ----------------------------------------------------------------------- + +% titlepage +\maketitle + +\begin{abstract} +\noindent This document describes how I have managed to use TrueType +fonts with te\TeX\ 1.0 under SuSE Linux 6.2.\footnote{The updmap + section has been updated to te\TeX\ 2.0.} The way described in +``Using TrueType fonts with \TeX\ (\LaTeX) and pdf\TeX\ (pdf\LaTeX)'' +\cite{rakityansky} did work with MiK\TeX, but I did not manage to use +the fonts with te\TeX. + +Strictly speaking this document doesn't describe how to use TrueType +fonts with te\TeX\ but how to convert TrueType fonts to PostScript +Type\,1 format which can be used with \TeX. + +The shown shell commands are unix style. +Similar commands should also work under Windows. +Please try yourself to find the according commands. + +If I have made any errors or if you have a suggestion please mail it +to me. + +\latexhtml{% + This document can be downloaded from + \url{ftp://ftp.dante.de/tex-archive/info/TrueType/} + (PDF and html available).% +}{% + A \hypref{PDF version% + }{ftp://ftp.dante.de/tex-archive/info/TrueType/ttf-tetex.pdf} + is also available.% +} +\end{abstract} + +\tableofcontents + +% the document itself +\section{Disclaimer} + +This document is provides as is. +I will not guarantee that the described conversion works and that it +doesn't course any damage. +I also will not give any support for problems doing the conversion. +Please refer to the newsgroups, e.g., \orgurl{comp.text.tex} or +\orgurl{de.comp.text.tex}. +My email address is given to give feedback (suggestions, error +reports), not for support. + +I don't know if the shown conversion violates any copyrights. + + + +\section{Preparing the conversion} + +As an example I will show how to convert the font ``VAG Rounded BT'' which +is part of Microsoft Windows 98 (\verb|tt0756m_.TTF|). + +First copy the fonts you want to convert into a temporary directory +(e.g., a Windows disk is mounted on /dos/c): +\begin{quote} +\verb|$ mkdir ~/ttf|\\ %$ +% The comment in the line above is a workaround for the corrupted +% xemacs syntax highlightning which does not recognize that the $ sign +% is within the argument of the \verb command. +\verb|$ cp /dos/c/windows/fonts/tt0756m_.TTF ~/ttf| %$ +\end{quote} +Then rename the files to a name conforming the fontname scheme by K.~Berry +\cite{berry1999a}. In this case the supplier is ``Bitstream'' (Filename +\verb|b*******.ttf|)\footnote{You can find this out by viewing the + file with less.}. The Shortcut for the typeface is ``vr'' (Filename +\verb|*vr*****.ttf|) taken from \cite{berry1999a}. The weight is +``regular'' (Filename \verb|***r****.ttf|). The variant is omitted +because itself and the width are normal. The encoding is set to ``8a'' +which means Adobe standard encoding\footnote{Maybe the TrueType font + is in Windows encoding, but the approach using ``8a'' worked fine, + so I won't change it.} (Filename \verb|****8a**.ttf|). Because the +width is standard and the font is linearly scaled, these parts of the +filename are omitted. Finally the filename results in \verb|bvrr8a.ttf|. Move +the original file to this filename: +\begin{quote} +\verb|$ mv tt0756m_.TTF bvrr8a.ttf| %$ +\end{quote} +A more detailed description on the naming conventions can be found in +\cite{berry1999a}. + +\section{Generating the Postscript Type\,1 fonts} + +To convert the TrueType font to Postscript Type\,1 format I used the program +\verb|ttf2pt1| by Andrew Weeks et~al. +(\url{http://ttf2pt1.sourceforge.net/}). Generate the font files +\verb|bvrr8a.afm|, \verb|bvrr8a.pfa|, and \verb|bvrr8a.pfb| by using +these commands: +\begin{quote} +\verb|$ ttf2pt1 -a -e bvrr8a.ttf bvrr8a|\\ +\verb|$ ttf2pt1 -a -b bvrr8a.ttf bvrr8a| +\end{quote} +The switch \verb|-a| switches the conversion of some ligatures +(e.g., fi) on (thanks to Hume Smith for that hint). +In one of the last lines of the output the fontname is noted: +\begin{quote} +\verb|FontName VAGRoundedBT_Regular| +\end{quote} +Note the name on a sheet of paper---You will need it later again. + +The script +\hypref{ttf2type1}{ftp://ftp.dante.de/tex-archive/info/TrueType/ttf2type1} +does these conversion automaticaly for all files with +the extension \verb|ttf| in the present working directory. To get the +font names you should start it as follows: +\begin{quote} +\verb_$ ./ttf2type1 2>&1 | grep FontName_ %$ +\end{quote} + +\section{Generating the \TeX\ related font files} + +Use ``fontinst'' by Alan Jeffrey and Rowland McDonnell +(\url{ftp://ftp.tex.ac.uk/tex-archive/fonts/utilities/fontinst}) to +generate the files that \TeX\ needs to use the fonts: +\begin{quote} +\verb|$ tex fontinst.sty|\\ +\verb|* \latinfamily{bvr}{} \bye| %$ +\end{quote} +If you use fonts with different variants you have to append the letter of +the variant to the family name of the font (e.g., VAGRoundedBT\_Condensed +would be bvrc). +This automatic conversion only works if you are using a text font and +if you have used file names according to the fontname scheme by +K.~Berry~\cite{berry1999a}. +Otherwise, you will get some nearly empty \verb|.fd| files and nothing +more. + +Now use pltotf on every file with the extension \verb|.pl| and +vptovf on all files with the extension \verb|.vpl|: +\begin{quote} +\verb|$ for a in *.pl; do pltotf $a; done|\\ +\verb|$ for a in *.vpl; do vptovf $a; done| +\end{quote} +Now you may delete all files that are not used anymore: +\begin{quote} +\verb|$ rm *.pl *.vpl *.mtx| %$ +\end{quote} +The manual of the fontinst package includes a better description. + +\section{Move the files to the right places} + +Now all files have to be moved to a position where \TeX\ can find them. I +suggest to put them in the \verb|TEXMFLOCAL| tree. +One possibility to get its location is to view the file \verb|texmf.cnf|. +You can locate it by using \verb|kpsewhich|: +\begin{quote} +\verb|$ kpsewhich texmf.cnf| %$ +\end{quote} +e.g., on SuSE~6.2 and te\TeX~1.0 \verb|texmf.cnf| is located in the directory +\verb|/etc/texmf/|. +Another possibility to get \verb|TEXMFLOCAL| is to use \verb|kpsexpand|: +\begin{quote} +\verb|$ kpsexpand '$TEXMFLOCAL'| +\end{quote} +On my computer the \verb|TEXMFLOCAL| tree starts at +\verb|/usr/local/teTeX/share/texmf.local|. The \verb|TEXMFMAIN| tree starts at +\verb|/usr/local/teTeX/share/texmf|. +In order to have less work I set the shell variable \verb|TMF| to the +local \TeX\ tree by typing: +\begin{quote} +\verb|$ export TMF=`kpsexpand '$TEXMFLOCAL'`|%$ +\end{quote} + + +The files of each file type are installed in an own directory tree +which has this structure: +\begin{quote} +\verb|$TMF/fonts/|\verb|/|<% +supplier>\verb|/|\verb|/| +\end{quote} +In this case: +\begin{quote} +\verb|$TMF/fonts/|\verb|/bitstream/vagrounded/| +\end{quote} +The extensions are: \verb|tfm|, \verb|vf|, \verb|pfa|, +\verb|afm|, and \verb|ttf|. +The extension \verb|pfb| is an exception, its files have to be copied +to the subdirectory \dots\verb|/type1/|\dots. +Copy the files by typing: +\begin{quote} +\verb|$ for a in tfm vf pfa afm ttf; do|\\ %$ +\verb|> mkdirhier $TMF/fonts/$a/bitstream/vagrounded;|\\ +\verb|> mv *.$a $TMF/fonts/$a/bitstream/vagrounded;|\\ %$ +\verb|> done|\\ +\verb|$ mkdirhier $TMF/fonts/type1/bitstream/vagrounded;|\\ %$ +\verb|$ mv *.pfb $TMF/fonts/type1/bitstream/vagrounded;|\\ %$ +\end{quote} +You do not really need to copy the \verb|ttf| and \verb|pfa| files +into the directory because \TeX\ does not use them. +I just did it to save them at a special place where I surely find +them, if I need them for other purposes later. + +Move the \verb|*.fd| files to the directory +\verb|$TMF/tex/latex/psnfss/|: %$ +\begin{quote} +\verb|$ mkdirhier $TMF/tex/latex/psnfss|\\ +\verb|$ mv *.fd $TMF/tex/latex/psnfss|\\ +\end{quote} + +\section{Make dvips find the new font}\label{sec:mapping} + +There are at least two possibilities to make dvips find the new font. +The first has a simple installation but it' usage is a little bit more +complicated and it does not enable xdvi to use the font. The second +possibility has a more complicated installation +and may leed to problems when updating \LaTeX\ later. But it enables +xdvi to use the new fonts. + +\subsection{Use an additional map file} + +Create the file +\hypref{\$TMF/dvips/vagrounded/config.vagrounded} +{ftp://ftp.dante.de/tex-archive/info/TrueType/config.vagrounded} +with these contents: +\begin{quote} +\verb|o|\\ +\verb|p +vagrounded.map| +\end{quote} +Create the file \hypref{\$TMF/dvips/vagrounded/vagrounded.map} +{ftp://ftp.dante.de/tex-archive/info/TrueType/vagrounded.map} +with these contents (\emph{Each font definition is in one single + line.} So in this example each line starts with \verb|bvr| and ends +with \verb|