Random Wisdom

Tag: fonts

Embedding fonts in a PDF document

by on Oct.03, 2008, under How To ..., LaTeX, Linux, Software

It is often a good idea (or a requirement) to embed the used font faces in a PDF document. This is easily accomplished using ps2pdf during the final stage of conversion of a document from PS to PDF:

$ ps2pdf -sPAPERSIZE=a4 -dPDFSETTINGS=/printer -dCompatibilityLevel=1.3 \
         -dMaxSubsetPct=100 -dSubsetFonts=true -dEmbedAllFonts=true \
         'input_file.ps' 'output_file.pdf'

An explanation of the command options can be found in the Ps2pdf.htm file in the Ghostscript documentations (or here).


Leave a Comment :, , , , more...

Installing MS TrueType core fonts on Linux

by on May.31, 2006, under How To ..., Linux, Software

Instructions obtained from:

  1. Install cabextract and fedora-rpmdevtools:
    $ sudo yum install cabextract fedora-rpmdevtools
  2. Create the build tree:
     $ fedora-buildrpmtree 
  3. Get the SPEC file:
    $ cd ~/rpmbuild/SPEC && \
      wget http://corefonts.sourceforge.net/msttcorefonts-2.0-1.spec
  4. Get the fonts and create the RPM package:
     $ rpmbuild -bb msttcorefonts-2.0-1.spec 
  5. Install the fonts package:
     $ sudo rpm -ivh ../RPMS/noarch/msttcorefonts-2.0-1.noarch.rpm 

Restart any running application to use the new fonts.

Leave a Comment :, , more...

Firefox and MathML on Linux

by on Sep.26, 2005, under How To ..., Linux, Software

While it’s a little more work compared to Windows, getting MathML to work on Firefox isn’t that hard. Now, it’s easier than ever thanks to the *.spec files created by Michael A. Peters:


(Copies of the files are also available here)

Before we can start building RPMs as a regular user, we need to install the fedora-rpmdevtools package from the Fedora Extras repo:

[darkknight@darkworld ~]$ sudo yum install fedora-rpmdevtools

Once that’s installed, we need to create the directory tree and RPM macros needed by rpmbuild:

[darkknight@darkworld ~]$ fedora-buildrpmtree

Now that we’re ready to build RPMs, we download and save the SPEC files under the ~/rpmbuild/SPECS/ tree:

[darkknight@darkworld SPECS]$ wget http://mpeters.us/fc_extras/mathematica_ttf.spec \

Once we have the spec files, we need to get the sources. We can get them from the URLs specified in the respective spec files:


(We need the Mathematica 4.1 Fonts)

We need to save the downloaded fonts under ~/rpmbuild/SOURCES/

Next, we need to install the cabextract package to satisfy build requirements:

[darkknight@darkworld ~]$ sudo yum install cabextract

Now, to build the font RPMs, switch to the ~/rpmbuild/SPECS directory and run:

[darkknight@darkworld SPECS]$ rpmbuild -bb mathtype_ttf.spec

[darkknight@darkworld SPECS]$ rpmbuild -bb mathematica_ttf.spec

In both cases, the long messeges should end in:

+ exit 0

If not, then you need to hunt down the problem and solve it. Assuming they both ended with the exit status ‘0’, we can go ahead and install our freshly baked RPMs:

[darkknight@darkworld ~]$ sudo yum localinstall ~/rpmbuild/RPMS/noarch/math*

In addition to those packages, we also need the mathml-fonts package:

[darkknight@darkworld ~]$ sudo yum install mathml-fonts

Once we have all the required fonts, we have disble PANGO for firefox. In order to do this, we need to uncomment the following lines from /usr/bin/firefox :


One that’s done, we’re good to go! We can test the new MathML rendering capabilities at:


Leave a Comment :, , , more...