#1 2017-01-30 22:09:22


Drag-and-Drop Tesseract font auto-generator (tessfont)

I recently made a drag-and-drop batch file for easy use of the genfont executable from Red Eclipse, this works well and I am trying to port it to Tesseract. The only issue is that the usage parameters arent very clear:

"Usage: genfont infile outfile supersample border[:border2[:outline:outline2]] radius pad offsetx[:offsety] advance charwidth charheight texwidth texheight [spacewidth spaceheight scale texdir]"

The current batch file is named tessfont.bat, and uses the following code:


set APP_DIR=.
set APP_OPTIONS=-ggenfontlog.txt -r
set APP_FONT="%~n1"
set APP_FONTTYPE=truetype
set APP_FONTPATH=media/interface/font/

IF EXIST tessfont.exe (
    echo Found the tessfont client
    IF EXIST %APP_FONT%.ttf (
        echo Found the %APP_FONT% %APP_FONTTYPE% font
        echo Generating font files
        start tessfont.exe %APP_OPTIONS% %*
        tessfont %APP_FONT%.ttf %APP_FONT% 4 15 1 1 54 54 512 512 0 0 %APP_FONTPATH%
        echo Font files generated for use in dir %APP_FONTPATH%
    ) ELSE (
        echo Unable to find the %APP_FONT% %APP_FONTTYPE% font
) ELSE (
    echo Unable to find the tessfont client

What should be obvious is that the parameters I am passing do not work for tessfont. They work fine for genfont, but not this. Also, APP_OPTIONS may be obsolete here, I am not certain.

So is there a wiki article on the subject? If not can anyone please give an example (preferably the default parameters used, so that the batch can create better Tesseract fonts, and so that more people can use their own custom fonts.

I hope to get this working soon!


#2 2017-02-01 14:25:05


Re: Drag-and-Drop Tesseract font auto-generator (tessfont)

You might want to poke Hirato, pretty sure he remembers how it works


Board footer