Beginner's guide

From DejaVu

Jump to: navigation, search


Installing FontForge

Download FontForge for your platform. Follow the instructions given.


The guide for Linux users.


Windows users have to install Cygwin. There is i separate guide for that on FontForges page. There is also a useful guide for selecting the necessary packages. Also be sure to select the following packages while installing Cygwin:

  • libxml2
  • libz
  • libpng
  • libiconv
  • libintl
  • Subversion
  • Perl

If you don’t want to instal Cygwin, you can instead use the unofficial Fontforge Mingw.

Setting up the environment

  • Get the source once from SVN: svn co dejavu
    • Run the command above in your home directory or any other convenient place where you want to put your files. The command will create a folder dejavu and a subfolder dejavu-fonts and some other stuff too.
      • For Linux users: /home/username/
      • Windows users: ?:\path\to\cygwin\home\username\. Run the command in cygwin where the path will be the same as for linux users!
    • Now create a copy of dejavu-fonts folder with its contents. Rename the copied folder to something else for easier identification, e.g., dejavu-fonts-underwork. This will be the copy that you will be working on with FontForge. Optionally
  • In the future synchronize your local copy with SVN: svn up dejavu
    • Copy the fresh sfd files to your working directory for possible editing.

Getting started with FontForge

  1. Start FontForge
    • Windows users see FontForges page for instructions for how to start Cygwin first.
  2. Open the font files that you want to edit from the dejavu-fonts-underwork folder.
  3. By double clicking open up a glyph for editing. Make the wanted changes. Close the glyph. (File->Close)
    • Some glyphs are highlighted with colors. green: requested, yellow: reserved, blue: lack hinting instructions. Black stands for unsaved.
  4. Repeat step 3. on other glyphs. Then save the file. (File->Save)
  5. Avoiding Problems (in the future):
    1. Open up any glyph in FontForge, select View->Number Points->None (even if it is already checked) and save. This will remove a usual problem found by (point numbers missing).
    2. Select the glyphs you've made and press Ctrl+Shift+D (Element->Correct Direction). Save. This will correct the direction of the outlines. Outer outlines should go clockwise, inner outlines counter-clockwise.
    3. Glyph contours must have extremas : Ctrl+Shift+X (Element->Add extrema)
    4. Glyph contours or references, round points to Integers. Ctrl+Shift+_ (Element->Round->To Int)

An extensive tutorial can be found on the FontForge page here. The complete manual can be found here.

Things to know about how DejaVu works

  • The font sfd files (i.e. the font sources) can be found in the "src" directory
  • We make use of a Makefile to make life easier for our developers. Run the Makefile commands from the directory with this Makefile and the "src" subdirectory that has the fonts you are editing.
  • Building the fonts can be done with make full-ttf (or one of its friends) and the generated ttf font files can be found in the "build" directory.

Making the patch

  1. Checking for problems
    • make check: This will "normalize" the font files, and check them for problems. Look at the output of this command to see if there are any problems. There should only be lines like Checking tmp/DejaVu###.sfd.norm at the end of the output.
    • A usual problem found is 'point numbers missing', just go to any glyph in FontForge, open it up and select View->Number Points->None. Then save, exit and rerun make check.
  2. Preparing for making the patch
    • make pre-patch: this overwrites the sfd font files in your src directory with the normalized files.
  3. Copy the edited sfd-files from the working directory (/home/username/dejavu-fonts-underwork/src) to the svn directory (/home/username/dejavu/dejavu-fonts/src). Existing ones will be overwritten. cp src/FONT.sfd ../dejavu/dejavu-fonts/src
  4. Make patch against copy on server: svn diff > patchname.patch
  5. Problems you could get encounter:
    • Your patch is very big (size 1 megabyte or greater): you probably forgot the make pre-patch step. Run this command and copy the files to your svn directory again.
  6. Extra problem checking:
    • Make sure you didn't remove TTF Instructions by mistake, grep for "-TTFInstr" in your patch. grep -- -TTFInstr patchname.patch
      If you changed instructions on purpose, the number of "+TTFInstr" lines should be equal to the number of "-TTFInstr" ones.
    • Your patch should not change the lines starting with "OS2", sometimes FontForge changes them for unknown reasons. grep OS2 patchname.patch

Submitting the patch

  1. zip/gzip/bzip2 the patch; e.g. gzip patchname.patch
  2. E-mail the patch to the Dejavu-fonts mailing list.

Making the next patch

  1. Synchronize your local copy with SVN: svn up dejavu
  2. Copy the fresh sfd files from the syncronized svn folder (e.g. /home/username/dejavu/dejavu-fonts/src) to your working directory (e.g. /home/username/dejavu-fonts-underwork/src) for editing.
  3. Make the patch, submit the patch. (See above for instructions.)

Committing the patch

If you have SVN write access you can commit the patch yourself

  1. Follow the steps from Making the patch, the patch file is only useful for validation purposes.
  2. Commit the patch to the SVN server: svn commit
  3. Write a description of the changes the patch provides, save the description and svn will upload the changes.

See also

Personal tools