diff options
author | Igor Melichev <igor.melichev@artifex.com> | 2004-09-22 13:52:36 +0000 |
---|---|---|
committer | Igor Melichev <igor.melichev@artifex.com> | 2004-09-22 13:52:36 +0000 |
commit | d7ca222003039c6be6e99503d487197e88c45033 (patch) | |
tree | 070df4a522863110e49643301d8f77d53439ff3f /gs/src/zfcid1.c | |
parent | 61e59ee3259dec408d28596d4ff91a29fa8bbe16 (diff) |
CDevProc|Metrics|Metrics2 did not work with CIDFontType 0.
DETAILS :
Bug 687681 "Character spacing incorrect".
The old implementation, which comes from the gs-cjk team,
has a bug accessing the replaced metrics of a CIDFontType 0 font,
which effectively caused the replaced metric to be ignored with CIDFontType 0 fonts.
1. Bug : With CIDFontType 0, CDevProc|Metrics|Metrics2 was searched
in the descendent type 1 or 2 font rather than in the parent type 9 font.
1.1. A Type 9 font needs to be accessed via a descendent Type 1|2 font
in pfont->procs.glyph_info. Added a new field gs_type1_data_s::parent,
and provided an access through it with a new function gs_font_parent.
1.2. Metrics|Metrics2 is now accessed through gs_font_parent.
1.3. To access CDevProc implemented a new function zchar_get_CDevProc,
which also works through gs_font_parent.
1.4. gs_type1_data_s::parent needs to reset while a type 9 font finalization,
due to a reason, which we could not understand for sure.
Likely descendent fonts appear to have a bigger lifetime than
their parent type 9 font. Probably the descendents are pointed from
somewhere besides FDArray (maybe the font registry ?
or maybe after scaling the type 9 font from a type 9 copy ?),
and we think it's not good.
We believe that they should be released together with the type 9 font.
For now leaving it as it is, working around with a hack notify_remove_font_type9.
1.5. In stable font copies gs_type1_data_s::parent is set to NULL
to simplify the finalization. They are not used now.
2. Bug : In some cases the glyph bytecode was used instead the CID
as a key for searching a Metrics|Metrics2 element (zchar1.c).
3. Bug : The PDF interpreter wrongly scaled W,W2,DW,DW2 for CIDFontTYpe0 (pdf_font.ps).
4. pdfwrite : Improved the generation of W, W2 for CID fonts,
because after implementing (1) re-distilled 401-01.ps rendered incorrectly.
4.1. Prefer a non-zero width when computing DW, DW2 (gdevpdtw.c)
(debugged with 401-01.ps).
4.2. Don't skip zero W, W2 elements. The old code recognized zeros as
unused glyphs, but must do with the real glyph set in the font copy
(debugged with the test file of the bug 687681).
5. zcharstring_outline still ignores CDevProc. We believe that it is correct,
because it is used to compute font features with no dependence on
the relaced metrics.
6. pdfwrite : Allowed a CDevProc callout for CIDFontType 0, because
pdfwrite needs to know replaced widths, as well as it was done a half year ago
for CIDFontType2. Actually after implementing (1) pdfwrite stopped
to work correctly when re-distilling a PDF file with CIDFontType0,
due to now it uses W,W2,DW,DW2.
6.1. A new function z1_set_cache is defined for this purpose
similarly to zchar42_set_cache.
6.2. gs_font_procs::glyph_outline now retrieves the side bearing and width.
Added a new argument 'sbw' to all implementations.
6.2.1. Currently this function extension is implemented for charstring fonts only,
which need to interpret a charstring to retrieve the info :
type 1,2,9, because we don't want to run the type 1 interpreter 2 times
for getting sbw and bbox. Other font types retrieve zeros,
which currently are not used.
6.2.2. type1_cis_get_metrics has been made public.
7. We believe that the implementation of W,W2,DW,DW2 in the PDF interpreter,
which was contributed by the gs-cjk team, is unreasonably overcomplicated,
because it is based on CDevProc, which needs an interpreter callout,
which appears extremily hard from pdfwrite.
For now leaving it as it is (except a small improvement in (3)).
We would like to generate Metrics, Metrics2 instead that.
Note that a small part of this patch (the part (1)) is necessary
for generating Metrics, Metrics2 for CIDFontTYpe 0.
EXPECTED DIFFERENCES :
Almost all differences are a single pixel glyph shift.
normal 72dpi :
"Altona.Page_3.2002-09-27.pdf"
"HeiseiMinStd.pdf"
"KozukaB-ILEmbed.pdf"
"Openhuis_pdf_zw.pdf"
"RodinCIDEmbed.pdf"
normal 300dpi :
"289-01.ps"
"Altona.Page_3.2002-09-27.pdf"
"Altona_Technical_1v1_x3.pdf"
"CIDembedded.pdf"
"HeiseiMinStd.pdf"
"KozukaB-ILEmbed.pdf"
"Openhuis_pdf_zw.pdf"
"RodinCIDEmbed.pdf"
pdfwrite 72dpi :
"Altona.Page_3.2002-09-27.pdf"
"HeiseiMinStd.pdf"
"KozukaB-ILEmbed.pdf"
"Openhuis_pdf_zw.pdf"
"RodinCIDEmbed.pdf"
pdfwrite 300dpi :
"CIDembedded.pdf"
"HeiseiMinStd.pdf"
"KozukaB-ILEmbed.pdf"
"Openhuis_pdf_zw.pdf"
"RodinCIDEmbed.pdf"
git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@5365 a1074d23-0009-0410-80fe-cf8c14f379e6
Diffstat (limited to 'gs/src/zfcid1.c')
-rw-r--r-- | gs/src/zfcid1.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gs/src/zfcid1.c b/gs/src/zfcid1.c index 38c3d300b..6e2a12fab 100644 --- a/gs/src/zfcid1.c +++ b/gs/src/zfcid1.c @@ -236,11 +236,11 @@ z11_get_glyph_index(gs_font_type42 *pfont, gs_glyph glyph) private int z11_glyph_outline(gs_font *font, int WMode, gs_glyph glyph, const gs_matrix *pmat, - gx_path *ppath) + gx_path *ppath, double sbw[4]) { return gs_type42_glyph_outline(font, WMode, z11_get_glyph_index((gs_font_type42 *)font, glyph) + GS_MIN_GLYPH_INDEX, - pmat, ppath); + pmat, ppath, sbw); } /* ------ Defining ------ */ |