LaTeX forum ⇒ GeneralTTF font installation on texlive (Xubuntu)

LaTeX specific issues not fitting into one of the other forums of this category.
surrogatelight
Posts: 4
Joined: Thu Aug 07, 2008 2:50 pm

TTF font installation on texlive (Xubuntu)

Postby surrogatelight » Thu Aug 07, 2008 3:29 pm

Update: I could at last figure out a solution. See post 5 for details.

Hello everyone,

I hope this is the right place for my question.

I want to install the Verdana font (TTF) for my tex distribution. I'm using Xubuntu with the appropriate packages (tex-common and all texlive-blabla) and I'm still quite new to linux.

The good thing is that there are some very detailed and specific guides out there for embedding TTFs in Latex. Unfortunately, none of them worked for me. Most are tailored for MikTex or some MacOS distribution. Those few for Linux fiddle with the font mapping and require a great sum of background knowledge about the files that texlive uses. I suspect they did not work because I either put the converted Verdana files into the wrong directories or I gave them the wrong "Latex name".

So, what I would like to know: Can anyone give me a really thorough step-by-step guide for the installation, concerning directories and the Latex name for Verdana in particular?

What I already have/know of:
-4 Verdana TTF files (and converted *.afm and *.pfb, probably with the wrong name)
-ttf2pt1 converter
-some hope

Thanks in advance,

SL
Last edited by surrogatelight on Mon Aug 18, 2008 1:49 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics
surrogatelight
Posts: 4
Joined: Thu Aug 07, 2008 2:50 pm

Re: TTF font installation on texlive (Xubuntu)

Postby surrogatelight » Mon Aug 11, 2008 3:04 pm

Hello again,

I tried some new things since my first post.

I downloaded the Winfonts.zip Package from CTAN and copied the unzipped directory tree to /usr/share/temxf-texlive. Then I used the following commands:

$sudo texhash
$kpsewhich winfonts.map
/usr/share/texmf-texlive/fonts/map/pdftex/winfonts/winfonts.map
$sudo update-updmap
$sudo updmap --enable MixedMap winfonts.map[/color]

Updmap references winfonts.map in the MixedMap section of its output and closes without error. However, when I try to embed the Verdana font in my documents via \fontfamily{verdana}\selectfont or \fontfamily{rjvn}\selectfont, I get the following warning messages:

PDFLaTeX] test.tex => test.pdf (pdflatex)
./test.tex:0:No file OT1verdana.fd. on input line 4.
./test.tex:4: Font shape `OT1/verdana/m/n' undefined(Font) using `OT1/cmr/m/n' instead on input line 4. Font shape `OT1/verdana/m/n' undefined(Font) using `OT1/cmr/m/n' instead
./test.tex:0: Some font shapes were not available, defaults substituted.
[PDFLaTeX] 0 errors, 3 warnings, 0 badboxes
[PDFLaTeX] Done!

So at the end, I'm again using the standard font and I don't know why. The file OT1verdana.fd cannot be located via kpsewhich, but it finds a file named ts1verdana.fd in /usr/share/texmf-texlive/tex/latex/winfonts/ts1verdana.fd. Are these synonymous files for different encodings?

I am grateful for any suggestion!

SL

linuxspice
Posts: 2
Joined: Mon Aug 11, 2008 7:32 pm

Re: TTF font installation on texlive (Xubuntu)

Postby linuxspice » Mon Aug 11, 2008 9:37 pm

Hi SL,

I'm working on figuring out the same thing... I've used LaTeX for a few years under Linux, so I'm familiar with most of the basics, but haven't ventured far outside the Computer Modern / AMS font domain until now. I think I've managed to get Verdana showing up in my document, but it looks much heavier than it does in other programs so there's probably still something wrong. I'll post back here once I have it figured out.

I can think of many possible things that could be going wrong. Would you be willing to post a skeletal version of your source document here, particularly the preamble and any font-changing commands you're using within the document? (You can leave out the juicy bits, of course. :-) ) That would help for the purposes of diagnosis.

surrogatelight
Posts: 4
Joined: Thu Aug 07, 2008 2:50 pm

TTF font installation on texlive (Xubuntu)

Postby surrogatelight » Tue Aug 12, 2008 10:12 am

Thanks for your reply, linuxspice. I don't know if my source code will help much since the scaffold looks like this:
\documentclass[12pt]{book}
\usepackage{graphicx}
\usepackage{winfonts}
\fontfamily{verdana}\selectfont
\begin{document} ... \end{document}


Then I use pdflatex in Kile and it tells me:
[PDFLaTeX] test.tex => test.pdf (pdflatex)
[PDFLaTeX] finished with exit status 1
./test.tex:0:No file OT1verdana.fd. on input line 6.
./test.tex:6: Font shape `OT1/verdana/m/n' undefined(Font) using `OT1/cmr/m/n' instead on input line 6. Font shape `OT1/verdana/m/n' undefined(Font) using `OT1/cmr/m/n' instead
./test.tex:8:Font T1/cmr/m/n/12=ecrm1200 at 12.0pt not loadable: Metric (TFM) file not found.\begin{document}
./test.tex:0: Some font shapes were not available, defaults substituted.
[PDFLaTeX] 1 error, 3 warnings, 0 badboxes


Mostly the message from yesterday but I haven't seen the bold part till now, I think. I also tried to include T1 encoding with \usepackage[T1]{fontenc} but then the source code for fontenc.sty appeared together with an error message reading
[PDFLaTeX] test.tex => test.pdf (pdflatex)
[PDFLaTeX] finished with exit status 1
/usr/share/texmf-texlive/tex/latex/base/fontenc.sty:100:Font T1/cmr/m/n/12=ecrm1200 at 12.0pt not loadable: Metric (TFM) file not found. \fontencoding\encodingdefault\selectfont
[PDFLaTeX] 1 error, 0 warnings, 0 badboxes


And now I am really scared! :shock:

SL

surrogatelight
Posts: 4
Joined: Thu Aug 07, 2008 2:50 pm

TTF font installation on texlive (Xubuntu)

Postby surrogatelight » Mon Aug 18, 2008 1:43 pm

In the meantime, I managed to get it working. I'm going to post what I did in a step-by-step way, starting from scratch without any tex-related packages installed. Maybe it will help some of you out there.

This worked for me on Xubuntu 8.04 (hardy).

  1. Via your favourite Package Manager: Install Kile (automatically installs some texlive packages)
  2. Via your favourite Package Manager: Install cm-super and texlive-font-utils
    The following steps are taken from a presentation in German. You can find it here.
  3. Make a new directory and copy all Verdana ttf-files into it
  4. Rename ttf-files according to Karl Berry (font family begins with jvn for Verdana)
    verdana.ttf to jvnr8a.ttf
    verdanai.ttf to jvnri8a.ttf
    verdanab.ttf to jvnb8a.ttf
    verdanaz.ttf to jvnbi8a.ttf
  5. Create a file named "driver.tex" in the same directory with the following content:
    \input fontinst.sty
    \latinfamily{jvn}{}
    \bye
    
  6. Create a new file named "verdana.map" with the following content:
    	jvnr8r Verdana "TeXBase1Encoding ReEncodeFont" <8r.enc <jvnr8a.pfb
    	jvnri8r Verdana-Italic "TeXBase1Encoding ReEncodeFont" <8r.enc <jvnri8a.pfb
    	jvnb8r Verdana-Bold "TeXBase1Encoding ReEncodeFont" <8r.enc <jvnb8a.pfb
    	jvnbi8r Verdana-BoldItalic "TeXBase1Encoding ReEncodeFont" <8r.enc <jvnbi8a.pfb
    	jvnro8r Verdana "0.167 SlantFont TeXBase1Encoding ReEncodeFont" <8r.enc <jvnr8a.pfb
    	jvnbo8r Verdana-Bold "0.167 SlantFont TeXBase1Encoding ReEncodeFont" <8r.enc <jvnb8a.pfb
    
  7. Via Terminal: Change into the new directory and run the following commands to get all necessary files:
    for f in *.ttf; do ttftopt1 -a -b $f; done
    tex driver.tex
    for f in *.pl; do pltotf $f; done
    for f in *.vpl; do vptovf $f; done
    
  8. Via Terminal: Run the following commands to introduce the new files to your texlive directory tree (you will have to create all non-existent directories via mkdir previous to the "cp" commands):
    sudo cp *.fd /usr/share/texmf-texlive/tex/latex/verdana
    sudo cp *.tfm /usr/share/texmf-texlive/fonts/tfm/micrsoft/verdana
    sudo cp *.vf /usr/share/texmf-texlive/fonts/vf/micrsoft/verdana
    sudo cp *.pfb /usr/share/texmf-texlive/fonts/type1/micrsoft/verdana
    sudo cp *.map /usr/share/texmf-texlive/fonts/maps/dvips/verdana
    sudo mktexlsr
    sudo updmap-sys --enable Map verdana.map
    
If there were no error messages, you should now be able to use Verdana by including \sffamily\fontfamily{jvn}\selectfont in your tex documents. If you are using pdftex or pdflatex for your builds, however, you may need to insert the lines of step 6 into the file ~/.texmf-var/fonts/map/pdftex/updmap/pdftex.map.

linuxspice
Posts: 2
Joined: Mon Aug 11, 2008 7:32 pm

TTF font installation on texlive (Xubuntu)

Postby linuxspice » Mon Aug 18, 2008 4:19 pm

Hi SL,

I'm glad you found a solution! I'm sorry I hadn't got back to you yet, but I never managed to figure out myself how to do this in regular LaTeX (after saying earlier that I had Verdana displaying, it turned out I was wrong - it was LaTeX's default sans serif font, which explains the apparent "heaviness"). Thanks for putting up this information.

Another approach I learned about in the interim, and which I was going to suggest, is to use XeTeX / XeLaTeX (Wikipedia article: XeTeX), which is one of the TeX Live packages (Ubuntu package: texlive-xetex). This is basically TeX / LaTeX updated to add support for Unicode and newer font technologies such as TrueType, OpenType, and Apple's AAT without needing to go through a tedious font installation process. It was originally written for Apple's OS X, so the documentation is highly OS-X-centric, but it works fine on Linux as well. I've tried it, and it seems to work very well. It does add a few "extra" commands, which might be a problem if you need to exchange TeX / LaTeX source files with people who don't have XeTeX installed, but if this isn't an issue then you may wish to consider it.

I'm glad you found a solution in any event!

-linuxspice

hearton965
Posts: 1
Joined: Sun Jan 24, 2010 8:01 am

TTF font installation on texlive (Xubuntu)

Postby hearton965 » Sun Jan 24, 2010 8:33 am

Using winfonts package may be easier than surrogatelight's solution. With this, we don't have to work on each font. I could configure it under Slackware 13 with tetex 3.0 that comes with it. I think it will also work with texlive, though I didn't try.

Here's how to install:
1. download winfonts.zip from http://www.ctan.org/tex-archive/fonts/winfonts/
2. unzip it to your local texmf tree (mine being ~/texmf):
unzip winfonts.zip -d ~/texmf
.
3. make font files recognized by TeX. I just made a link:
mkdir -p ~/texmf/fonts/TTF && cd ~/texmf/fonts/TTF && ln -s /usr/share/fonts/TTF

(assuming the font files such as verdana.ttf are under /usr/share/fonts/TTF)
3. run
mktexlsr

4. run
updmap --enable Map winfonts.map


You can test with this file:
\documentclass[]{article}
\usepackage[T1]{fontenc}
\usepackage{winfonts}
\renewcommand{\rmdefault}{georgia}
\renewcommand{\sfdefault}{verdana}
\renewcommand{\ttdefault}{courier-ttf}
%\renewcommand*\familydefault{\sfdefault}
\begin{document}
dark \textsf{star} \texttt{13}
\end{document}


Enjoy
-hearton965


Return to “General”

Who is online

Users browsing this forum: No registered users and 8 guests