Hi,

Recently, Alex gave me an idea to improve FT_Get_CID_From_Glyph_Index() API for 
CID-keyed font Type 0 (FontType 9, the most traditional CID-keyed font using 
PostScript Type1 CharStrings) by adding a fallback to CID=0 for the cases that 
the requested GID points to a broken entry providing no glyph data. 
cid_load_glyph() can catch such an error but cannot stop the Type1 CharString 
rendering after successful loading. Therefore, using cid_load_glyph() for 
validating CID is too expensive; FT_Get_CID_From_Glyph_Index() is interested in 
the presence of the glyph data but has little interest in its rasterization 
result. For simple checking of the presence of the glyph data, I propose to 
separate the glyph data loading part of cid_load_glyph() as 2 helper functions; 
one is for incremental loading, another is a traditional disk-resident font 
file. I drafted a few patches:

https://gitlab.freedesktop.org/mpsuzuki/freetype-mps-wip/-/compare/master...wip-t1cid-separate-loaders-of-fd-offsets?from_project_id=11053&straight=false

But I need a good testing tool to check the possible regression for the 
incremental loading. One of the most straightforward ideas would be using 
GhostScript and some PostScript data generated by legacy printer drivers (which 
can emit the per-glyph Type1 CharString and embed it to the output but cannot 
make a self-standing CID-keyed font like that in PDF). But it is too big 
software. I wish there were smaller - no need to render seriously - testing 
tools. I tried to find something in the mailing list archive around 2002 
Jun-Jul (when the main trunk merged the incremental loading feature, 22 years 
ago!), but I could not find anything. Please let me know if anybody can 
remember how the developers tested in those days.

Nothing to say; I've already tried GhostScript. But GhostScript uses 
t1_load_glyph instead of cid_load_glyph.

The client of FreeType's incremental loading feature.
https://git.ghostscript.com/?p=ghostpdl.git;a=blob;f=base/fapi_ft.c;hb=HEAD

The emitter of the font stream for the FreeType.
https://git.ghostscript.com/?p=ghostpdl.git;a=blob;f=base/write_t1.c;hb=HEAD

There is an emitter of the incremental downloading font dictionary for 
PostScript Type1 font, write_t1.c written by Graham Asher himself), but there 
is no emitter for Type9 font (CIDFontType0 font).

Regards,
mpsuzuki

Reply via email to