Bug 687654 - t1_hinter__find_best_standard_width() always returns 0
Summary: t1_hinter__find_best_standard_width() always returns 0
Status: NOTIFIED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: General (show other bugs)
Version: master
Hardware: All All
: P4 minor
Assignee: leonardo
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-03 05:18 UTC by Alex Cherepanov
Modified: 2008-12-19 08:31 UTC (History)
0 users

See Also:
Customer:
Word Size: ---


Attachments
patch1.txt (11.01 KB, patch)
2004-09-06 06:38 UTC, Igor Melichev
Details | Diff
patch1.txt (9.62 KB, patch)
2006-01-20 06:46 UTC, leonardo
Details | Diff
patch2.txt (13.46 KB, patch)
2006-01-21 02:47 UTC, leonardo
Details | Diff
patch3.txt (16.95 KB, patch)
2006-01-23 02:36 UTC, leonardo
Details | Diff
patch4.txt (16.12 KB, patch)
2006-01-23 04:37 UTC, leonardo
Details | Diff
patch5.txt (17.78 KB, patch)
2006-02-06 11:58 UTC, leonardo
Details | Diff
patch6.txt (18.28 KB, patch)
2006-02-10 11:00 UTC, leonardo
Details | Diff
patch7.txt (18.47 KB, patch)
2006-02-10 12:48 UTC, leonardo
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Cherepanov 2004-09-03 05:18:47 UTC
t1_hinter__find_best_standard_width() 
does some calculations but always returns 0.
Comment 1 Igor Melichev 2004-09-06 06:38:15 UTC
Created attachment 880 [details]
patch1.txt

I just tried the obvious fix for that code, and got results, which cannot be
qualified as a progression at 300dpi (i.e. not closer to Acrobat Reader 5). At
72dpi the difference is small, but doesn't look as a progression also. Likely
at small resolution it should return always 0 to force the standard stem width
(the Type 1 spec says so), but at bigger resolutions it may return other
values. Maybe 300dpi isn't a big resolution. So likely ignoring StemSnapH,
StemSnapV isn't a bad siolution, but the code to be simplified and commented.

Unfortunately I can't recall why it was coded so. Maybe at first time it was
coded with "return m", then changed for an experimenting, and then left so. In
any case, the Type 1 spec isn't so clear, so maybe "return 0" is the right
solution.
Comment 2 Igor Melichev 2004-09-06 06:40:23 UTC
BTW, Maybe StemSnapH, StemSnapV are for font substitution purpose only ?
Comment 3 Igor Melichev 2004-09-06 06:46:02 UTC
Likely FreeType 2 doesn't use StemSnapH, StemSnapV. I found a code that reads 
and copies them, but nothing more.
Comment 4 Igor Melichev 2004-09-09 05:28:23 UTC
There is some processing in UFST.
Comment 5 Igor Melichev 2004-09-09 06:41:21 UTC
I tried to return 'm' with the recent patch, but results are still not good.

I guess that StemSnap* to be adjusted to the pixel grid, and then decide 
whether to apply it. If deltas are pretty small, then adjust all to Std*W. With 
bigger deltas adjust to StemSnap*. With very big deltas don't adjust. Also need 
to verify our algorithm. Delaying this for better times.
Comment 6 leonardo 2006-01-18 23:26:19 UTC
Adobe Technical Note #5049 defines the logic.
Comment 7 leonardo 2006-01-20 06:46:17 UTC
Created attachment 1937 [details]
patch1.txt

An experimental patch according to Adobe Technical Note #5049.
Need to decide whether it is applicable at small resolutions.
Comment 8 leonardo 2006-01-21 02:47:55 UTC
Created attachment 1939 [details]
patch2.txt

A better experimental patch.
Comment 9 leonardo 2006-01-23 02:36:31 UTC
Created attachment 1943 [details]
patch3.txt

An improved patch - needs a visual testing with humans.
Comment 10 leonardo 2006-01-23 04:37:22 UTC
Created attachment 1945 [details]
patch4.txt

A better patch (Cygwin/gcc warning cleaned).
Comment 11 leonardo 2006-02-06 11:58:10 UTC
Created attachment 2000 [details]
patch5.txt

A more improved patch : debugged a mixing of pixel_gh, pixel_gw.
Comment 12 leonardo 2006-02-10 11:00:31 UTC
Created attachment 2026 [details]
patch6.txt

A better patch, includes a fix for t1_hinter__align_stem_commands start with an
off-curve pole.
Comment 13 leonardo 2006-02-10 12:48:04 UTC
Created attachment 2029 [details]
patch7.txt

The last patch skips too many poles, causing a regression with
S2_Digitalproof-Forum_x3k.pdf. Attaching a better one.
Comment 14 leonardo 2006-02-12 16:19:23 UTC
Patch to HEAD :
http://ghostscript.com/pipermail/gs-cvs/2006-February/006347.html

This patch also fixes the bug 688553.