Tag Archives: Ubuntu/Linux HowTo

Install working version of FontForge on Ubuntu 11.10

The version of FontForge currently available from the Ubuntu repositories is unusable with Ubuntu 11.10. The bug and the solution is described here. It seems that FontForge has been fixed to work with 11.10, but that the Ubuntu repositories have not been updated. Version 20110225 works; the older version 20100429 in the repository doesn’t.

Aleksandr’s solution works:

  1. Uninstall the old FontForge package (using Synpatic or whatever).
  2. Install git and python-dev if they are not already installed.
  3. Download and compile FontForge from source:
    Open a terminal screen, and enter the following lines:
    git clone git://fontforge.git.sourceforge.net/gitroot/fontforge/fontforge.
    That downloads the source code for the latest version.
    cd fontforge
    That moves you into the directory where the FontForge files have just landed.
    sudo make install
    That compiles FontForge. The executable was at ~/fontforge/fontforge/fontforge. Change the permissions to run it without sudo.

Convert collection of JPEGs to single PDF file

Install ImageMagick.

  1. place all JPEG files to be converted into a single directory
  2. convert *.jpg my_pdf_file.pdf

The order of the pages will match the order of the original file-names. Conversion can be slow and resource-intensive if the number of JPEG files is large (ca. 100). The resulting PDF file is typically about the same size as the sum of the original file sizes.

Chinese OCR on Ubuntu Linux

Convert scanned images of Chinese documents to real, searchable, editable text.

There is some information for OCR options on Ubuntu/Linux, but it doesn’t explain the set up for Chinese text very well.  OCRFeeder can be installed from the Ubuntu Software Center (Applications > Ubuntu Software Center – click on Office). OCRFeeder works as a graphical front end for OCR engines like Tesseract that do the actual optical character recognition. Tesseract provides files for language specific OCR on their downloads page. For Chinese, these are chi_tra.traineddata.gz and chi_sim.traineddata.gz for traditional and simplified Chinese respectively.

  1. Download the files and gunzip them.
  2. Move them to the tessdata directory. For me the path is /usr/local/share/tessdata/.
  3. Start OCRFeeder.
  4. Open the OCR Engines dialog ( Tools > OCR Engines).
  5. Click “Add”, and fill in the fields as follows:
    • Name: Tesseract – Traditional Chinese
    • Image format: TIFF
    • Failure string: (leave blank)
    • Engine path: /usr/local/bin/tesseract (or whatever the path is for your tesseract installation)
    • Engine arguments: $IMAGE $FILE -l chi_tra; cat $FILE.txt; rm $FILE
  6. That was for traditional Chinese. For simplified Chinese, add another engine. The following fields will be different:
    • Name: Tesseract – Simplified Chinese
    • Engine arguments: $IMAGE $FILE -l chi_sim; cat $FILE.txt; rm $FILE

It should now be possible to select either form of Chinese when performing OCR.