From: "Erich E. Hoover" Subject: [PATCH 2/3] wineps.drv: Add support for PostScript Format 2 standard glyph names. Message-Id: Date: Fri, 4 Sep 2015 22:29:33 -0600 This patch adds support for the standard glyph names from PostScript Format 1 when the font uses a PostScript Format 2 glyph name table. With this change OrCAD 16.6 can auto-generate a search-able PDF from a schematic. From 023d0a9956f3a14c3dc918d35bcff5294eb13e00 Mon Sep 17 00:00:00 2001 From: "Erich E. Hoover" Date: Thu, 3 Sep 2015 16:16:31 -0600 Subject: wineps.drv: Add support for PostScript Format 2 standard glyph names. --- dlls/wineps.drv/download.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/dlls/wineps.drv/download.c b/dlls/wineps.drv/download.c index 59c542c..febb9dd 100644 --- a/dlls/wineps.drv/download.c +++ b/dlls/wineps.drv/download.c @@ -631,6 +631,19 @@ void get_standard_glyph_name(WORD index, char *name) snprintf(name, MAX_G_NAME + 1, "%s", glyph_table[index]->sz); } +WORD get_post2_name_index(BYTE *post2header, DWORD size, WORD index) +{ + USHORT numberOfGlyphs = GET_BE_WORD(post2header); + DWORD offset = (1 + index) * sizeof(USHORT); + + if(offset + sizeof(USHORT) > size || index >= numberOfGlyphs) + { + FIXME("Index '%d' exceeds PostScript Format 2 table size (%d)\n", index, numberOfGlyphs); + return 0; /* .notdef */ + } + return GET_BE_WORD(post2header + offset); +} + void get_glyph_name(HDC hdc, WORD index, char *name) { struct @@ -673,6 +686,16 @@ void get_glyph_name(HDC hdc, WORD index, char *name) else WARN("Font uses PostScript Format 1, but non-standard glyph (%d) requested.\n", index); } + else if(post_header->format == MAKELONG(0, 2)) + { + BYTE *post2header = post + sizeof(*post_header); + WORD glyphNameIndex = get_post2_name_index(post2header, size - sizeof(*post_header), index); + + if(glyphNameIndex < 258) + get_standard_glyph_name(glyphNameIndex, name); + else + FIXME("PostScript Format 2 custom glyphs are currently unsupported.\n"); + } else FIXME("PostScript Format %d.%d glyph names are currently unsupported.\n", HIWORD(post_header->format), LOWORD(post_header->format)); -- 1.9.1