Search code examples
directwrite

When can an IDWriteFontFace have more than one file?


IDWriteFontFace.GetFiles() returns a collection of font files. This puzzles me because I don't know of any font format which can split a single font face across multiple files. (The reverse is not the case; a font collection file can hold multiple font faces.)

Indeed, testing against the installed fonts on my computer I observed that this method always returns a collection containing exactly one file.

Question: are there cases where IDWriteFontFace.GetFiles() returns more than one file?


Solution

  • This is the case for example for Type 1 fonts, that have .pfa/.pfb file for font data, and .afm file for metrics. DirectWrite does not support Type 1 format, but is able to tell you that font file is of such format, see IDWriteFontFile::Analyze(). Latest Win10 update however supposedly brought some mechanism for third party font engine integration according to MSDN (I don't think it's documented publicly), which means that in theory it's possible in future that GetFiles will return more than one file instance.