0
votes

I am writing a PowerShell script to install TrueType and OpenType fonts in Windows. The script is adding a registry entry in Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts and copies the font-file to C:\Windows\Fonts. If I don't do it like this and only copy the file to the font directory Windows automatically installs the font in the user space instead (C:\Users\UserName\AppData\Local\Microsoft\Windows\Fonts).

I can see that the few OpenType fonts that I have on my computer and that have been installed by Windows have a string name like "FontName (TrueType)" in the registry, even though they are OpenType fonts?? Wouldn't it make more sense if the name was "FontName (OpenType)"?

Is there a standard around this?

1
OpenType supersedes Microsoft's TrueType Open extensions to the TrueType format. OpenType fonts can contain either PostScript or TrueType outlines in a common wrapper. Read more about that here - Theo
Thanks. Is it possible to see on/in an OTF-file which type of outline that is used? - Quist
The type property on the file only says "OpenType font file", at least for the OTF file that I am trying. I have not found any free OTF with a PS outline inside. - Quist
The convention is to use .ttf extension for OpenType-with-TrueType-outlines, and .otf for OpenType-with-CFF-data, but ultimately this distinction is entirely irrelevant because the important part is that it's an OpenType font. Which flavour for glyph outlines is used (TT, CFF, CFF2, SVG, there's a lot of choice by now) is an implementation detail. If you want more detailed font information, there are many tools that let you inspect font files, both free and paid. - Mike 'Pomax' Kamermans
@Theo on a technical note, OpenType does not support Postscript, it supports CFF, which uses Type2 Charstrings, which are like postscript in the same way that C++ is like C: inspired by, at best. There is a postscript table, but that's a universal table independent of the glyph outline language used. - Mike 'Pomax' Kamermans

1 Answers

1
votes

For purposes of getting a font registered and enumerated in the system, the strings used for entry names have no significance. An entry named "spam" would work just as well as "Arial Regular (TrueType)" or "Arial Regular (OpenType)". All that matters is uniqueness within that key.

However, for maintenance of the registry — installation or removal of fonts, and migration during an upgrade or to a new system — there are parts of the OS that expect the entry names to be of a particular format. So, even if a font can be considered an OpenType font, you should use the template " (TrueType)" for the entry names.

As noted by others in comments, the TrueType vs. OpenType distinction is fuzzy. Most fonts that might be considered TrueType fonts would qualify as OpenType fonts, but not all; in particular, some fonts for MacOS use extensions defined in Apple's TrueType Reference Manual but not in the OpenType spec. And the OpenType spec has several extensions not included in Apple's TrueType reference manual.

But for your purposes, the TT vs. OT distinction isn't relevant. Always use "(TrueType)" in the registry.