> -----Original Message----- > From: Goldstein, Seth > Sent: Wednesday, March 18, 2009 8:26 AM > To: [email protected] > Subject: RE: [Swftools-common] missing characters in generated swf > > > > > -----Original Message----- > > From: [email protected] > > [mailto:swftools-common- > > [email protected]] On Behalf Of > > Goldstein, Seth > > Sent: Tuesday, March 17, 2009 9:09 AM > > To: [email protected] > > Subject: RE: [Swftools-common] missing characters in generated swf > > > > > > > > Very interesting. Learning more about PDFs than I probably ever > > wanted > > > to. :) > > > > > > FYI - the PDF does render "correctly" with Ghostscript, so I'm > > sifting > > > through their source code right now to see how they handle that > > glyph. > > > But, there is a lot of code here, so if someone wants to lend > another > > > pair of eyes, I'd love the assistance! > > > > > > > > > > So in the Ghostscript source code, we have this function here: > > > > <code> > > bool > > gs_font_glyph_is_notdef(gs_font_base *bfont, gs_glyph glyph) > > { > > gs_const_string gnstr; > > > > if (glyph == gs_no_glyph) > > return false; > > if (glyph >= gs_min_cid_glyph) > > return (glyph == gs_min_cid_glyph); > > return (bfont->procs.glyph_name((gs_font *)bfont, glyph, &gnstr) > >= > > 0 && > > gnstr.size == 7 && !memcmp(gnstr.data, ".notdef", 7)); > > } > > </code> > > > > Along with these #defines: > > > > <code> > > #define GS_NO_GLYPH ((gs_glyph)0x7fffffff) > > #if arch_sizeof_long > 4 > > # define GS_MIN_CID_GLYPH ((gs_glyph)0x80000000L) > > #else > > /* Avoid compiler warnings about signed/unsigned constants. */ > > # define GS_MIN_CID_GLYPH ((gs_glyph)~0x7fffffff) > > #endif > > #define GS_MIN_GLYPH_INDEX (GS_MIN_CID_GLYPH | (GS_MIN_CID_GLYPH >> > 1)) > > #define GS_GLYPH_TAG (gs_glyph)(GS_MIN_CID_GLYPH | > GS_MIN_GLYPH_INDEX) > > #define GS_MAX_GLYPH max_ulong > > /* Backward compatibility */ > > #define gs_no_glyph GS_NO_GLYPH > > #define gs_min_cid_glyph GS_MIN_CID_GLYPH > > #define gs_max_glyph GS_MAX_GLYPH > > </code> > > > > Perhaps this is the appropriate test for notdef? > > > > > > Still not sure about this one, but just wanted to let you know that I > forwarded the PDF onto the XPDF folks and I did receive a response from > them: > > "That's a known problem related to using glyph ID 0 in TrueType fonts. > It will be fixed in the next release of Xpdf. > > - Derek"
Still working on this one. Hoping to find a solution. Still would love to hear any input if anyone has any ideas. The latest research has revealed this: With a normal working document, the characters get glyph ids that make sense. E.g.: FT_Get_Glyph_Name = T gid = 152 FT_Get_Glyph_Name = h gid = 173 FT_Get_Glyph_Name = i gid = 174 FT_Get_Glyph_Name = s gid = 184 FT_Get_Glyph_Name = n gid = 179 FT_Get_Glyph_Name = o gid = 180 FT_Get_Glyph_Name = t gid = 185 FT_Get_Glyph_Name = a gid = 166 FT_Get_Glyph_Name = k gid = 176 FT_Get_Glyph_Name = e gid = 170 But with my problem document, regardless of the actual characters used, the 1st character gets glyph id of 0, the 2nd character get a glyph id of 1... E.g.: FT_Get_Glyph_Name = .notdef gid = 0 FT_Get_Glyph_Name = .null gid = 1 FT_Get_Glyph_Name = nonmarkingreturn gid = 2 FT_Get_Glyph_Name = space gid = 3 FT_Get_Glyph_Name = exclam gid = 4 FT_Get_Glyph_Name = quotedbl gid = 5 FT_Get_Glyph_Name = numbersign gid = 6 FT_Get_Glyph_Name = dollar gid = 7 But the document still renders correctly mostly. Other than that first character because it gets a glyph id of 0 and therefore does not render. So why would the document get glyph ids of 0, 1, 2? And how does it still render correctly with the wrong glyph ids?
