0

I'm looking over the EMF file spec and the LogFontPanose object never seems to be used.

EMF Specification: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-emf/91c257d7-c39d-4a36-9b1f-63e3f73d30ca

There are a few types of font objects that are avaialabe: LogFont, LogFontEx, LogFontExDv, and LogFontPanose.

In section 2.3.7.8 they give the algorithm for determining which type of font object is created by the ExtCreateFontIndirectW record by examining the size of the elw field.

If the size of the elw field is equal to or less than the size of a LogFontPanose object (section 2.2.16), elw MUST be treated as a fixed-length LogFont object. Bytes beyond the extent of the LogFont object, up to the end of the elw field, MUST be ignored.

If the size of the elw field is greater than the size of a LogFontPanose object, then elw MUST be treated as a variable-length LogFontExDv object.

Going by this algorithm, a logFontPanose object can never created. If the elw is a LogFontPanose length, it has to be a LogFont object with the all the bytes from the panose object being ignored. Is this a mistake in their spec?

kiwiwings
  • 3,386
  • 1
  • 21
  • 57
MechaMarinara
  • 620
  • 1
  • 7
  • 22
  • I'd guess probably not. It sounds like something that might have been tentatively considered in very early Windows or OS/2, but GDI does not have a LOGFONTPANOSE structure. (See GDI [Font and Text Structures](https://learn.microsoft.com/en-us/windows/win32/gdi/font-and-text-structures) – Peter Constable Nov 04 '21 at 15:50
  • I'm not sure, if I got the implementation right, but [this](https://svn.apache.org/viewvc/poi/trunk/poi-scratchpad/src/main/java/org/apache/poi/hemf/record/emf/HemfFont.java) is the way I've parsed it. – kiwiwings Nov 04 '21 at 23:44
  • @PeterConstable: Did you Ctrl+F "Panose" in your link? – kiwiwings Nov 28 '21 at 01:04
  • @kiwiwings Yes, I searched in that page. Moreover, I searched through the Windows source code (I work at Microsoft): there is a PANOSE structure, but there is no LOGFONTPANOSE. – Peter Constable Nov 28 '21 at 19:47

0 Answers0