[PATCH 2/3] wineps.drv: Add support for PostScript Format 2 standard glyph names (try 3).

Huw Davies huw at codeweavers.com
Wed Sep 9 02:46:53 CDT 2015


On 8 Sep 2015, at 18:30, Erich E. Hoover wrote:
> +WORD get_post2_name_index(BYTE *post2header, DWORD size, WORD index)
> +{
> +    USHORT numberOfGlyphs = GET_BE_WORD(post2header);
> +    DWORD offset = (1 + index) * sizeof(USHORT);
> +
> +    if((1 + numberOfGlyphs) * sizeof(USHORT) > size)
> +    {
> +        FIXME("Total number of glyphs (%d) exceeds PostScript Format 2 table size (%d)\n",
> +              numberOfGlyphs, size);
> +        return 0; /* .notdef */
> +    }

Personally, I'd remove this check, you only added it because you misunderstood something I suggested.
What we actually care about is covered by the check below.

> +    if(offset + sizeof(USHORT) > size || index >= numberOfGlyphs)
> +    {
> +        FIXME("Index '%d' exceeds PostScript Format 2 table size (%d)\n", index, numberOfGlyphs);
> +        return 0; /* .notdef */
> +    }

In the failure case we need to not return 0 (.notdef), but should end up using the existing "gxxxx" glyph name.
This is because glyphs are shown using the glyphshow PostScript operator, so we need unique names for every
glyph.  Note though that zero should be returned if the glyph's name really is .notdef.  I guess returning 0xffff on failure
would work, or something like that.

Otherwise, the rest of the series looks good to me.

Huw.




More information about the wine-devel mailing list