[gs-cvs] rev 7683 - in trunk/gs: doc lib src
leonardo at ghostscript.com
leonardo at ghostscript.com
Wed Feb 7 08:30:27 PST 2007
Author: leonardo
Date: 2007-02-07 08:30:26 -0800 (Wed, 07 Feb 2007)
New Revision: 7683
Modified:
trunk/gs/doc/pscet_status.txt
trunk/gs/lib/gs_fonts.ps
trunk/gs/src/gstext.c
trunk/gs/src/gxchar.c
trunk/gs/src/ztype.c
Log:
Fix (interpreter) : 'definefont', 'show', 'setcachedevice' error inconformity.
DETAILS :
1. The old code throws different errors than CPSI
when a FontMatrix is zero (gstext.c, gxchar.c).
2. With CPSI 'noaccess' trows 'invalidaccess' with read-only dictionaries (ztype.c).
3. 'definefont' must return a read-only object (see PLRM) (gs_fonts.ps).
Debugged with CET 13-13-6, 13-15-3.
EXPECTED DIFFERENCES :
comparefiles: None.
CET tests : 13-13-6, 13-15-3, 24-09.PS (fails due to another problem),
Modified: trunk/gs/doc/pscet_status.txt
===================================================================
--- trunk/gs/doc/pscet_status.txt 2007-02-07 09:39:44 UTC (rev 7682)
+++ trunk/gs/doc/pscet_status.txt 2007-02-07 16:30:26 UTC (rev 7683)
@@ -2939,12 +2939,7 @@
13-13-5 OK Minor differences visually reviewed by HAS
-13-13-6 DIFF GS error inconformity.
- cpsi gives an undefinedresult when using a font scaled by 0.
- Note : we have got comparefiles,
- which scale with [1 0 0 0 0 0 0] to measure text width.
- It should not through error.
- assign: Alex.
+13-13-6 OK
13-13-7 OK
@@ -2960,10 +2955,7 @@
13-15-2 OK Color corrected by rev 7172.
-13-15-3 DIFF GS error inconformity.
- cpsi gives an undefinedresult when using a font scaled by 0.
- See comment to 13-13-6.
- assign: Alex.
+13-15-3 OK
13-15-4 OK
@@ -4393,7 +4385,7 @@
24-08-3 OK
-24-09-1 OK
+24-09-1 DIFF errordict must not be read-only. Assign: Igor or Assign: Alex.
24-09-2 OK
Modified: trunk/gs/lib/gs_fonts.ps
===================================================================
--- trunk/gs/lib/gs_fonts.ps 2007-02-07 09:39:44 UTC (rev 7682)
+++ trunk/gs/lib/gs_fonts.ps 2007-02-07 16:30:26 UTC (rev 7683)
@@ -500,6 +500,7 @@
dup .FontDirectory 4 -2 roll { .growput } //superexec % readonly
% If the font originated as a resource, register it.
currentfile .currentresourcefile eq { dup .registerfont } if
+ readonly
} odef
% Define a procedure for defining aliased fonts.
Modified: trunk/gs/src/gstext.c
===================================================================
--- trunk/gs/src/gstext.c 2007-02-07 09:39:44 UTC (rev 7682)
+++ trunk/gs/src/gstext.c 2007-02-07 16:30:26 UTC (rev 7683)
@@ -236,7 +236,14 @@
if (!pgs->current_point_valid)
return_error(gs_error_nocurrentpoint);
}
-
+ /* Detect zero FintNatrix now for Adobe compatibility with CET tests.
+ Note that matrixe\\ces like [1 0 0 0 0 0] are used in comparefiles
+ to compute a text width.
+ Note : FontType 3 throws error in setcachedevice. */
+ if (pgs->font->FontType != ft_user_defined &&
+ pgs->font->FontMatrix.xx == 0 && pgs->font->FontMatrix.xy == 0 &&
+ pgs->font->FontMatrix.yx == 0 && pgs->font->FontMatrix.yy == 0)
+ return_error(gs_error_undefinedresult); /* sic! : CPSI compatibility */
if (text->operation & TEXT_DO_DRAW) {
code = gx_effective_clip_path(pgs, &pcpath);
gs_set_object_tag(pgs, GS_TEXT_TAG);
Modified: trunk/gs/src/gxchar.c
===================================================================
--- trunk/gs/src/gxchar.c 2007-02-07 09:39:44 UTC (rev 7682)
+++ trunk/gs/src/gxchar.c 2007-02-07 16:30:26 UTC (rev 7683)
@@ -291,7 +291,14 @@
{
gs_show_enum *const penum = (gs_show_enum *)pte;
gs_state *pgs = penum->pgs;
+ gs_font *pfont = gs_rootfont(pgs);
+ /* Detect zero FintNatrix now for Adobe compatibility with CET tests.
+ Note that matrixe\\ces like [1 0 0 0 0 0] are used in comparefiles
+ to compute a text width. See also gs_text_begin. */
+ if (pfont->FontMatrix.xx == 0 && pfont->FontMatrix.xy == 0 &&
+ pfont->FontMatrix.yx == 0 && pfont->FontMatrix.yy == 0)
+ return_error(gs_error_undefinedresult); /* sic! : CPSI compatibility */
switch (control) {
case TEXT_SET_CHAR_WIDTH:
return set_char_width(penum, pgs, pw[0], pw[1]);
@@ -308,7 +315,7 @@
int code;
bool retry = (penum->width_status == sws_retry);
- if (gs_rootfont(pgs)->WMode) {
+ if (pfont->WMode) {
float vx = pw[8], vy = pw[9];
gs_fixed_point pvxy, dvxy;
Modified: trunk/gs/src/ztype.c
===================================================================
--- trunk/gs/src/ztype.c 2007-02-07 09:39:44 UTC (rev 7682)
+++ trunk/gs/src/ztype.c 2007-02-07 16:30:26 UTC (rev 7683)
@@ -184,9 +184,15 @@
check_op(1);
if (r_has_type(op, t_dictionary)) {
+ ref *fid;
+
/* Don't allow removing read access to permanent dictionaries. */
if (dict_is_permanent_on_dstack(op))
return_error(e_invalidaccess);
+ /* CPSI throws invalidaccess when seting noaccess to a font (CET 13-13-6) : */
+ if (dict_find_string(op, "FID", &fid) > 0 &&
+ r_type(fid) == t_fontID)
+ return_error(e_invalidaccess);
/*
* Even though Red Book 3 says that changing the access of a
* read-only dictionary is not allowed, Adobe interpreters allow
More information about the gs-cvs
mailing list