[gs-cvs] gs/src
Igor Melichev
igor at ghostscript.com
Wed Jul 20 11:14:06 PDT 2005
Update of /cvs/ghostscript/gs/src
In directory casper2:/tmp/cvs-serv27724/gs/src
Modified Files:
gdevpdfb.c gdevpdtt.c
Log Message:
Fix (pdfwrite, ps2write) : Synthesized bitmap fonts had zero character width in charprocs.
DETAILS :
1. The Wx operand of d1 always got the zero value
when a font is being converted into a bitmap font.
2. The Width array was wrongly computed
when a font is being converted into a bitmap font.
3. Computing Metrics, Widths values to be scaled with the FontMatrix,
to account an unusuial FontMatrix of Type 1 fonts,
which were created by 3d parties from TrueTypes.
4. Metrics was not set to a font due to a bad stack balance.
Bug 688172 "ps2write : CID text displacement".
This patch gives a numerous progressions when ps2write runs with a small resolution -r72.
In same time with this patch few files regress when ps2write runs with a small resolution -r72 :
687572.pdf
86554321.pdf
Jahr2000.pdf
EXPECTED DIFFERENCES :
pdfwrite 72dpi :
"020-01.ps"
"093-01.ps"
"Bug687845.ps"
pdfwrite 300dpi :
"020-01.ps"
"093-01.ps"
"405-01.ps"
"450-01.ps"
"Bug687845.ps"
Index: gdevpdfb.c
===================================================================
RCS file: /cvs/ghostscript/gs/src/gdevpdfb.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- gdevpdfb.c 29 Jun 2005 18:21:44 -0000 1.31
+++ gdevpdfb.c 20 Jul 2005 18:14:04 -0000 1.32
@@ -152,6 +152,7 @@
pres = pdf_find_resource_by_gs_id(pdev, resourceCharProc, id);
if (pres == 0) { /* Define the character in an embedded font. */
pdf_char_proc_t *pcp;
+ double x_offset;
int y_offset;
gs_image_t_init_mask(&image, false);
@@ -167,8 +168,11 @@
if (code < 0)
return code;
y_offset = -y_offset;
- pprintd3(pdev->strm, "0 0 0 %d %d %d d1\n", y_offset,
- w, h + y_offset);
+ x_offset = psdf_round(pdev->char_width.x, 100, 10); /* See
+ pdf_write_Widths about rounding. We need to provide
+ a compatible data for Tj. */
+ pprintg1(pdev->strm, "%g ", x_offset);
+ pprintd3(pdev->strm, "0 0 %d %d %d d1\n", y_offset, w, h + y_offset);
pprintd3(pdev->strm, "%d 0 0 %d 0 %d cm\n", w, h,
y_offset);
pdf_image_writer_init(&writer);
Index: gdevpdtt.c
===================================================================
RCS file: /cvs/ghostscript/gs/src/gdevpdtt.c,v
retrieving revision 1.102
retrieving revision 1.103
diff -u -d -r1.102 -r1.103
--- gdevpdtt.c 5 Apr 2005 09:48:46 -0000 1.102
+++ gdevpdtt.c 20 Jul 2005 18:14:04 -0000 1.103
@@ -94,8 +94,7 @@
switch (control) {
case TEXT_SET_CHAR_WIDTH:
case TEXT_SET_CACHE_DEVICE:
- pdev->char_width.x = pw[0];
- pdev->char_width.y = pw[1];
+ gs_distance_transform(pw[0], pw[1], &ctm_only(pte->pis), &pdev->char_width);
break;
case TEXT_SET_CACHE_DEVICE2:
/*
@@ -104,8 +103,7 @@
* width for Widths array. Therefore we don't check
* gs_rootfont(pgs)->WMode and don't use pw[6:7].
*/
- pdev->char_width.x = pw[0];
- pdev->char_width.y = pw[1];
+ gs_distance_transform(pw[0], pw[1], &ctm_only(pte->pis), &pdev->char_width);
if (penum->cdevproc_callout) {
memcpy(penum->cdevproc_result, pw, sizeof(penum->cdevproc_result));
return 0;
More information about the gs-cvs
mailing list