Yahoo Answers is shutting down on 4 May 2021 (Eastern Time) and, as of 20 April 2021 (Eastern Time), the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

Does someone know where I can find how True Type Fonts are structured in binary notation I can't seem to find it?

I want to be able to draw different sizes and styles of text to a graphical representation and bitmaps are not efficient enough for this kind of work.  

Update:

Actually what I need more than how it is done is how the font file is structured

2 Answers

Relevance
  • 1 month ago

    I think you'll find that most or all ".ttf" files (on Windows, at least) are actually "OpenType" fonts.  TrueType is an older version of that standard, and the '.ttf' suffix now usually means "OpenType with TTF-style outlines". 

    There's an ISO standard that parallels OpenType, called OFF, but for just info about the format you can read the Microsoft docs for free.  (ISO charges pretty hefty fees for copies of "open" standards documents.)

    See: docs.microsoft.com/en-us/typography/opentype/spec/

    Also, if you're looking for something to rasterize TTF outlines, the FreeFont project might have something useful.  That's a free, open-source rasterizer for TrueType, OpenType and Adobe Type 1 fonts.  The source code may give you clues as to what differences exist between classical TTF files and OpenType-with-TTF-outlines.

    See: www.freetype.org/

    This might not be a wheel you need to re-invent, though.  Have you looked at FontForge?  That's a free, open-source system for creating and editing fonts.

    See: www.freetype.org

  • i + i
    Lv 7
    1 month ago

    From Wikipedia: 

    File formats

    Basic

    A basic font is composed of multiple tables specified in its header. A table name can have up to 4 letters.

    A TrueType Collection file begins with a ttcf table that allows access to the fonts within the collection by pointing to individual headers for each included font. The fonts within a collection share the same glyph-outline table, though each font can refer to subsets within those outlines in its own manner, through its 'cmap', 'name' and 'loca' tables.

    A .ttf extension indicates a regular TrueType font or an OpenType font with TrueType outlines, while a .ttc extension is reserved for TTCs. Windows end user defined character editor (EUDCEDIT.EXE) creates TrueType font with name EUDC.TTE.[13] An OpenType font with PostScript outlines must have an .otf extension. In principle an OpenType font with TrueType outlines may have an .otf extension, but this has rarely been done in practice.

    In classic Mac OS and macOS, OpenType is one of several formats referred to as data-fork fonts, as they lack the classic Mac resource fork.

    Suitcase

    The suitcase format for TrueType is used on classic Mac OS and macOS. It adds additional Apple-specific information.

    Like TTC, it can handle multiple fonts within a single file. But unlike TTC, those fonts need not be within the same family.

    Suitcases come in resource-fork and data-fork formats. The resource-fork version was the original suitcase format. Data-fork-only suitcases, which place the resource fork contents into the data fork, were first supported in macOS. A suitcase packed into the data-fork-only format has the extension dfont.

Still have questions? Get answers by asking now.