Bug 687780

Summary: optimize nobbox_draw
Product: Ghostscript Reporter: Igor Melichev <igor.melichev>
Component: Graphics LibraryAssignee: Chris Liddell (chrisl) <chris.liddell>
Status: RESOLVED FIXED    
Severity: enhancement CC: christinedelight.top85, shailesh.mistry
Priority: P3 Keywords: bountiable
Version: master   
Hardware: PC   
OS: Windows XP   
Customer: Word Size: ---
Attachments: gsbug-2.ps

Description Igor Melichev 2004-10-27 23:51:50 UTC
First we generate a character outline andapply the grid fitting. Then 
nobbox_draw computes the path bbox and checks rect_within(bbox, pbfont-
>FontBBox). If not (it is so with cxs.present == metricsSideBearingAndWidth),
it enhances FontBBox and restarts all again. Thus zchar_set_cache, the type 1 
interpreter and the type 1 hinter are called 2 times, and type1_exec_init is 
called 4 times due to the sbw callout. Also zchar_get_metrics2 may be called 
with no reason when there is no CDevProc.

Actually we could do all in a single pass if set up the cache device after we 
compute the grid-fitted outline. As a consequence possibly we could drop 
gs_text_retry.
Comment 1 Igor Melichev 2004-10-27 23:53:51 UTC
Created attachment 1003 [details]
gsbug-2.ps

A test file with a single glyph to reproduce the problem. It is made form the
test file of the bug 687614. The original test file of the bug 687614 is useful
for debugging Metrics with the optimized algorithm.
Comment 2 Shailesh Mistry 2011-07-11 20:47:50 UTC
Fixed in Ghostscript 9.03
Comment 3 Chris Liddell (chrisl) 2011-07-13 08:46:35 UTC
Effectively, this is fixed with the FAPI/Freetype integration.