DSIG table -- looking for clarifications

agisaak's picture

Hi all,

I don't have access to a windows machine, and need some clarifications on the need for digital signatures for fonts to work correctly in some versions of windows.

My understanding is that it is necessary for a DSIG table to be present for windows to recognise OpenType fonts. However, some sites have suggested that this is only necessary for .ttf files. If I am generating CFF-flavoured fonts with an .otf extension, can I safely dispense with this table and still have the font work in a windows environment?

If the answer to the above question is 'no', will inserting a zero-length DSIG table using TTX suffice, or do I need to include some dummy data in the table?

Also, does anyone know why microsoft imposes this weird restriction on opentype fonts?

TIA,
André

JanekZ's picture

"If I am generating CFF-flavoured fonts with an .otf extension, can I safely dispense with this table and still have the font work in a windows environment?"
It looks like font works. Font can be installed, works in Corel 12, WordPad and ID5. Not sure about "safely".
win XP sp3

Té Rowan's picture

WinXP (dunno about later) will accept the TrueType flavour as OpenType only if there is a DSIG. It can be a dummy (null) DSIG, but it's gotta be there. The CFF flavour is accepted without question.

Khaled Hosny's picture

Some MS apps (Word IIRC) will not allow using OpenType features for Latin script in TTF-flavoured fonts if they don't contain a DSIG table, also Windows explorer will show the font with an OpenType icon if it has such table. This was not needed for CFF-flavoured fonts last time I checked.

Janic's picture

>WinXP (dunno about later) will accept the TrueType flavour as OpenType only if there is a DSIG.

Where is this documented in the spec? We make and test TT flavour OTF's without DSIG constantly in XP and 7 without problems.

Té Rowan's picture

What spec? MSWindows has specs? *blink* *blink* Wot yeh ge' ter hear ere yer ears fall off.

I saw this mentioned on the web. I tested it. On TT-flavoured fonts, the OT icon appeared only on fonts with a DSIG. To me, this indicated that what I stated above. If they didn't have a DSIG, WinXP showed them to be plain old TrueType.

As it happens, the difference between a TrueType font and a TT-flavoured OpenType font is pretty damn small. The OT font has some OT tables and a different version setting, and that's about it. So why would WinXP latch onto the DSIG as an indicator? Beats all hell outta me.

Michel Boyer's picture

Here is a paragraph from the link http://www.microsoft.com/typography/developers/opentype/detail.htm

At the beginning of this section, I referred to the DSIG table as a 'required' table. In fact, a digital signature is not required in the same sense that the CMAP and many other tables are required simply for the font to work. A font without a DSIG table will work, but it will not be recognized as an OpenType font by the Windows operating system. Because the OpenType format is an extension of the TrueType format, and most of the new tables are optional, Windows makes a distinction between the two formats based solely on the presence or absence of a DSIG table. A font with a DSIG table will be recorded in the Windows font folder as an OpenType font and presented with the OpenType icon.

Ok, it is old, 2001, but still there.

Michel Boyer's picture

Concerning the dummy DSIG table, FontForge can be asked to produce one. If I do that and apply ttx on the resulting font file, here is what it looks like (after removing a comment)

<DSIG>
  <hexdata>
    00000001 00000000  
  </hexdata>
</DSIG>
Michel Boyer's picture

Hmm, maybe I should not have removed the comment, for it says

<!-- note that the Digital Signature will be invalid after recompilation! -->

That does not sound promising. On the other hand, if I apply ttx twice again (to get an otf, and then a ttx), that signature is left unchanged. So, it looks worth trying.

Theunis de Jong's picture

So Windows (by Microsoft) does not check the sfnt header as described in the OTF specs ... by Microsoft?

(citing:)

OpenType fonts that contain TrueType outlines should use the value of 1.0 for the sfnt version. OpenType fonts containing CFF data should use the tag 'OTTO' as the sfnt version number. ("This page was last updated 5 May 2008.")

The 'required tables' listing does not contain DSIG for Truetype, and its full description doesn't mention anything special either.

Michel Boyer's picture

The question of the DSIG table was discussed in this FontLab Forum in relation to ligatures in Word 2010. Puzzling indeed.

Khaled Hosny's picture

@Michel:
I think the comment refers to real DSIG tables which will becomes valid since the checksum will be different (or something similar), but since this is a dummy one it does not matter any way.

Khaled Hosny's picture

@Theunis:
A plain TrueType font (i.e. with no OpenType specific tables) will also have a 1.0 version, so it does not help very much, though if it were me I'd check for a more relevant table(s).

agisaak's picture

Thanks to all who have responded. Your comments along with Michel's link seem to confirm that this won't be a real issue for me since I work in CFF-flavoured OT rather than TrueType. I'm still a bit curious, though, about the underlying rationale for this requirement for TT-flavoured fonts.

André

Mel N. Collie's picture

"I'm still a bit curious, though, about the underlying rationale for this requirement for TT-flavoured fonts."

Well, when it was introduced at a MS / Adobe event in the mid-90s, it was postured as protection for font vendors. Through discussion, however, it was determined to actually be protection for users from dangerous fonts. At the time, MS expressed the desire for all documents, and all other content running on or through windows to have a digital signature, and fonts seemed like the perfect place to start.

John Hudson's picture

That's a general comment about DSIGs, David, regardless of format.

The issue for Windows in determining what constitutes an OpenType font, as distinct from a TrueType font, inititally for cosmetic purposes (icon presentation) and legal purposes (trademark), was confused by the fact that all the OpenType Layout tables are optional, and all the common sfnt tables needed to be backwards compatible. So Microsoft decided to define a TTF-flavour OpenType font as an sfnt with a OT DSIG table. It's an odd decision that has confused people ever since, including, apparently, the Word 2010 programmers.

Té Rowan's picture

"There's nowt as queer as Windows..."

Dipped a bit into both Apple and MS TT/OT specs to brush up on OS2Version. Unless I've branched to Atlantis, 0 is Apple TrueType, 1 is MS TrueType and 2-up are OpenType. And I used to think there was nowt as queer as folk.

Mel N. Collie's picture

JH: "That's a general comment about DSIGs, David, regardless of format."

No idea what you are talking about.
What's a General Comment and how many font formats have a dsig as a format Identifier.

Té Rowan's picture

There are no formats that use DSIG as an identifier, but it's the only OT feature Windows looks for in TT-flavoured OT fonts.

General Comment is a part of the military committee that oversees USA's economic recovery, as is General Failure.

Syndicate content Syndicate content