Skip to content

Latest commit

 

History

History

ttf-otf-dwrite-loader

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Font loader for Microsoft DirectWrite

The loader is designed to load font files using the DirectWrite interface (the engine used by all major Windows web browsers at the time of this writing), and test its rasterization code against malformed input. The purpose of the program is to stress-test as much font-handling code as possible, and to execute it for all glyphs found in the font file instead of a limited charset such as just the ASCII characters.

The font-related DirectWrite calls made by the loader are listed below:

Building

The application can be compiled with Microsoft Visual Studio after importing ttf-otf-dwrite-loader.cpp and config.h into a new project.

Usage

Using the tool is as simple as passing the path of the tested TTF/OTF font in the first argument, for example:

c:\ttf-otf-dwrite-loader>ttf-otf-dwrite-loader.exe C:\Windows\Fonts\arial.ttf
[+] Input font is supported, with file type 2, face type 1 and number of faces 1
[+] Loaded 140 unicode ranges from the input font
[+] Font processing completed
[+] Font displayed without errors.

c:\ttf-otf-dwrite-loader>

In addition to the standard output, you should also observe the font's glyphs being drawn in the upper left corner of the screen:

Font glyphs displayed on the screen as rasterized by DirectWrite

During fuzzing, we recommend enabling Page Heap for the loader process, for better detection of out-of-bounds and uninitialized memory bugs.