[gs-cvs] rev 8190 - in trunk/gs: examples lib src

till at ghostscript.com till at ghostscript.com
Tue Aug 14 13:48:29 PDT 2007


Author: till
Date: 2007-08-14 13:48:29 -0700 (Tue, 14 Aug 2007)
New Revision: 8190

Removed:
   trunk/gs/examples/cjk/
   trunk/gs/lib/cjkv/
Modified:
   trunk/gs/lib/gs_cidtt.ps
   trunk/gs/lib/gs_init.ps
   trunk/gs/src/gstype42.c
   trunk/gs/src/gxfont42.h
   trunk/gs/src/unixinst.mak
   trunk/gs/src/zchar1.c
   trunk/gs/src/zchar42.c
Log:
Removed CJK patches.


Modified: trunk/gs/lib/gs_cidtt.ps
===================================================================
--- trunk/gs/lib/gs_cidtt.ps	2007-08-14 18:53:48 UTC (rev 8189)
+++ trunk/gs/lib/gs_cidtt.ps	2007-08-14 20:48:29 UTC (rev 8190)
@@ -56,36 +56,27 @@
 } bind def
 
 /load_sfnts  % <FontDict> load_sfnts <FontDict> 
-{
-  NOCJKV {
-    % Read the True Type file from the path /Path, and buld /sfnts,
-    % skipping glyf and loca. 
-    dup /Path get                                            % <font> (path)
-    QUIET not {
-      (Loading a TT font from ) print dup print 
-      ( to emulate a CID font ) print 1 index /CIDFontName get =only ( ... ) print
-    } if
-    (r) file dup                                             % <font> file file
-    3 1 roll                                                 % file <font> file
-    1 index /SubfontID .knownget not { 0 } if                % file <font> file SubfontID
-    .load_tt_font_stripped exch copy                         % file <font>
-    QUIET not {
-      (Done.) =
-    } if
-    dup 3 1 roll                                             % <font> file <font>
-    exch /File exch put                                      % <font>
-    dup dup /CIDSystemInfo get /Ordering get (.)             % <font> () ()
-    2 index /Decoding get =string cvs                        % <font> () () ()
-    concatstrings concatstrings cvn /Decoding exch put       % <font>
-    //ChooseDecoding exec                                    % <font>
-    //GenerateCIDMap exec                                    % <font>
-  }
-  {
-    dup /Path get % <font> (path)
-    exch /SubfontID .knownget not { 0 } if 1 add    % (path) SubfontID
-    .openttcidfont
-  }
-  ifelse
+{ % Read the True Type file from the path /Path, and buld /sfnts,
+  % skipping glyf and loca. 
+  dup /Path get                                            % <font> (path)
+  QUIET not {
+    (Loading a TT font from ) print dup print 
+    ( to emulate a CID font ) print 1 index /CIDFontName get =only ( ... ) print
+  } if
+  (r) file dup                                             % <font> file file
+  3 1 roll                                                 % file <font> file
+  1 index /SubfontID .knownget not { 0 } if                % file <font> file SubfontID
+  .load_tt_font_stripped exch copy                         % file <font>
+  QUIET not {
+    (Done.) =
+  } if
+  dup 3 1 roll                                             % <font> file <font>
+  exch /File exch put                                      % <font>
+  dup dup /CIDSystemInfo get /Ordering get (.)             % <font> () ()
+  2 index /Decoding get =string cvs                        % <font> () () ()
+  concatstrings concatstrings cvn /Decoding exch put       % <font>
+  //ChooseDecoding exec                                    % <font>
+  //GenerateCIDMap exec                                    % <font>
 } bind def
 
 %-----------TrueType-specific methods for category redefinition : -----------

Modified: trunk/gs/lib/gs_init.ps
===================================================================
--- trunk/gs/lib/gs_init.ps	2007-08-14 18:53:48 UTC (rev 8189)
+++ trunk/gs/lib/gs_init.ps	2007-08-14 20:48:29 UTC (rev 8190)
@@ -154,7 +154,6 @@
 currentdict /NOFONTMAP known   /NOFONTMAP exch def
 currentdict /NOFONTPATH known   /NOFONTPATH exch def
 currentdict /NOGC known   /NOGC exch def
-currentdict /NOCJKV known   /NOCJKV exch def
 currentdict /NOINTERPOLATE .knownget { /INTERPOLATE exch not def } if
 currentdict /NOMEDIAATTRS known /NOMEDIAATTRS exch def
 currentdict /NOOUTERSAVE known   /NOOUTERSAVE exch def
@@ -672,14 +671,6 @@
 	   { /undefinedfilename signalerror }
 	  ifelse
 	} bind def
-/runlibfileifexists
-	{		% We don't want to bind 'run' into this procedure,
-			% since run may get redefined.
-	  findlibfile
-	   { exch pop /run .systemvar exec }
-	   { pop }
-	  ifelse
-	} bind def
 /selectdevice
 	{ finddevice setdevice .setdefaultscreen } bind def
 /signalerror		% <object> <errorname> signalerror -
@@ -848,7 +839,6 @@
 	} bind def
 % Temporarily substitute it for the real runlibfile.
 /.runlibfile /runlibfile load def
-/.runlibfileifexists /runlibfileifexists load def
 /runlibfile /runlibfile0 load def
 
 % Create the error handling machinery.
@@ -2198,9 +2188,4 @@
 % be 'true' in some cases.
 userdict /AGM_preserve_spots false put
 
-%Load CJKV environment.
-NOCJKV not {
-  (cjkv/cjkvinit.ps) runlibfile
-} if
-
 % The interpreter will run the initial procedure (start).

Modified: trunk/gs/src/gstype42.c
===================================================================
--- trunk/gs/src/gstype42.c	2007-08-14 18:53:48 UTC (rev 8189)
+++ trunk/gs/src/gstype42.c	2007-08-14 20:48:29 UTC (rev 8190)
@@ -10,14 +10,6 @@
    or contact Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134,
    San Rafael, CA  94903, U.S.A., +1(415)492-9861, for further information.
 */
-/*
- * Modified by AXE,Inc., BBR Inc. and Turbolinux Inc.
- *   under the technical advice by suzuki toshiya (Hiroshima University)
- * For questions, please send mail to espgs8-cjk at printing-japan.org
- *
- * (C) Copyright 2006 Center of the International Cooperation for
- *     Computerization
- */
 
 /* $Id$ */
 /* Type 42 (TrueType) font library routines */
@@ -668,49 +660,6 @@
 			     origin.y + float2fixed(info.width[WMode].y));
 }
 
-/* Get glyph bounding box from font file */
-int
-gs_type42_glyph_fbbox(gs_font *font, uint glyph_index, gs_rect *pbbox)
-{
-    gs_font_type42 *const pfont = (gs_font_type42 *)font;
-    gs_glyph_data_t glyph_data;
-    double factor = 1.0 / pfont->data.unitsPerEm;
-    int code = 0;
-    const byte *gdata;
-
-    if ((code = pfont->data.get_outline(pfont, glyph_index, &glyph_data)) < 0) {
-	return code;		/* non-existent glyph */
-    }
-    if (glyph_data.bits.size == 0) {
-	return 1; /* notdef */
-    }
-    if (glyph_data.bits.size != 0 && S16(glyph_data.bits.data) == -1) {
-	/* This is a composite glyph. */
-	uint flags;
-	gs_matrix_fixed mat;
-
-	gdata = glyph_data.bits.data + 10;
-	memset(&mat, 0, sizeof(mat)); /* arbitrary */
-	do {
-	    uint comp_index = U16(gdata + 2);
-
-	    parse_component(&gdata, &flags, &mat, NULL, pfont, &mat);
-	    if (flags & TT_CG_USE_MY_METRICS) {
-		code = gs_type42_glyph_fbbox(pfont, comp_index,pbbox);
-		goto done;
-	    }
-	}
-	while (flags & TT_CG_MORE_COMPONENTS);
-    }
-    gdata = glyph_data.bits.data;
-    pbbox->p.x = S16(gdata+2)*factor;
-    pbbox->p.y = S16(gdata+4)*factor;
-    pbbox->q.x = S16(gdata+6)*factor;
-    pbbox->q.y = S16(gdata+8)*factor;
-done:
-    gs_glyph_data_free(&glyph_data, "gs_type42_enumerate_glyph");
-    return code;
-}
 /* Get glyph info by glyph index. */
 int
 gs_type42_glyph_info_by_gid(gs_font *font, gs_glyph glyph, const gs_matrix *pmat,

Modified: trunk/gs/src/gxfont42.h
===================================================================
--- trunk/gs/src/gxfont42.h	2007-08-14 18:53:48 UTC (rev 8189)
+++ trunk/gs/src/gxfont42.h	2007-08-14 20:48:29 UTC (rev 8190)
@@ -10,14 +10,6 @@
    or contact Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134,
    San Rafael, CA  94903, U.S.A., +1(415)492-9861, for further information.
 */
-/*
- * Modified by AXE,Inc., BBR Inc. and Turbolinux Inc.
- *   under the technical advice by suzuki toshiya (Hiroshima University)
- * For questions, please send mail to espgs8-cjk at printing-japan.org
- *
- * (C) Copyright 2006 Center of the International Cooperation for
- *     Computerization
- */
 
 /* $Id$ */
 /* Type 42 font data definition */
@@ -163,9 +155,6 @@
 int gs_type42_get_outline_from_TT_file(gs_font_type42 * pfont, stream *s, uint glyph_index,
 		gs_glyph_data_t *pgd);
 
-/* Export the function get glypf bounding box from font data */
-int gs_type42_glyph_fbbox(gs_font *font, uint glyph_index, gs_rect *pbbox);
-
 /* Export the font procedures so they can be called from the interpreter. */
 font_proc_enumerate_glyph(gs_type42_enumerate_glyph);
 font_proc_glyph_info(gs_type42_glyph_info);

Modified: trunk/gs/src/unixinst.mak
===================================================================
--- trunk/gs/src/unixinst.mak	2007-08-14 18:53:48 UTC (rev 8189)
+++ trunk/gs/src/unixinst.mak	2007-08-14 20:48:29 UTC (rev 8190)
@@ -63,7 +63,6 @@
 	-mkdir -p $(DESTDIR)$(gsdir)
 	-mkdir -p $(DESTDIR)$(gsdatadir)
 	-mkdir -p $(DESTDIR)$(gsdatadir)/lib
-	-mkdir -p $(DESTDIR)$(gsdatadir)/lib/cjkv
 	$(SH) -c 'for f in \
 $(EXTRA_INIT_FILES) Fontmap.GS \
 ht_ccsto.ps \
@@ -90,10 +89,6 @@
 	$(SH) -c 'for f in $(PSLIBDIR)/*.ppd $(PSLIBDIR)/*.rpd $(PSLIBDIR)/*.upp $(PSLIBDIR)/*.xbm $(PSLIBDIR)/*.xpm;\
 	do $(INSTALL_DATA) $$f $(DESTDIR)$(gsdatadir)/lib ;\
 	done'
-# install cjkv patch
-	$(SH) -c 'for f in $(PSLIBDIR)/cjkv/*.ps ;\
-	do $(INSTALL_DATA) $$f $(DESTDIR)$(gsdatadir)/lib/cjkv/ ;\
-	done'
 
 # install the default resource files
 # copy in every category (directory) but CVS

Modified: trunk/gs/src/zchar1.c
===================================================================
--- trunk/gs/src/zchar1.c	2007-08-14 18:53:48 UTC (rev 8189)
+++ trunk/gs/src/zchar1.c	2007-08-14 20:48:29 UTC (rev 8190)
@@ -10,15 +10,6 @@
    or contact Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134,
    San Rafael, CA  94903, U.S.A., +1(415)492-9861, for further information.
 */
-/*
- * Modified by AXE,Inc., BBR Inc. and Turbolinux Inc.
- *   under the technical advice by suzuki toshiya (Hiroshima University)
- * Based on bugfix by Hideo Saito, 2001.
- * For questions, please send mail to espgs8-cjk at printing-japan.org
- *
- * (C) Copyright 2006 Center of the International Cooperation for
- *     Computerization
- */
 
 /* $Id$ */
 /* Type 1 character display operator */
@@ -239,7 +230,7 @@
 	cxs.sbw[2] = 0;
 	cxs.sbw[3] = -penum->FontBBox_as_Metrics2.x; /* Sic! */
 	cxs.use_FontBBox_as_Metrics2 = true;
-	cxs.present = metricsSideBearingAndWidth;
+	cxs.present = metricsNone;
     }
     /* Establish a current point. */
     code = gs_moveto(igs, 0.0, 0.0);
@@ -272,8 +263,7 @@
 	const ref *opstr = op;
 	ref other_subr;
 
-	if (cxs.present == metricsSideBearingAndWidth
-	    && !cxs.use_FontBBox_as_Metrics2) {
+	if (cxs.present == metricsSideBearingAndWidth) {
 	    gs_point sbpt;
 
 	    sbpt.x = cxs.sbw[0], sbpt.y = cxs.sbw[1];
@@ -381,48 +371,11 @@
     } else {
 	/* We have the width and bounding box: */
 	/* set up the cache device now. */
-        double w[2];
-        w[0] = pcxs->sbw[2], w[1] = pcxs->sbw[3];
-      
-	if (pcxs->use_FontBBox_as_Metrics2) {
-	   /* In this case, we have to calculate width for WMode=0. 
-	      pcxs->sbw[2, 3] is width for WMode=1.
-	      Normally, the width for WMode=0 is not used in WMode=1 
-	      rendering. However, if CDevProc is defined, 
-	      the width for WMode=0 is used. 
-	      Do the same as the case pcxs->present == metricsNone */
-	     double sbw[4];
-	     ref cnref;
-	     ref other_subr;
-	     int code;
-	     
-	    /* Since an OtherSubr callout might change osp, */
-	    /* save the character name now. */
-	    ref_assign(&cnref, op - 1);
-	    code = type1_continue_dispatch(i_ctx_p, pcxs, op, &other_subr, 4);
-	    op = osp;		/* OtherSubrs might change it */
-	    switch (code) {
- 	     default:		/* code < 0 or done, error */
-		 return ((code < 0 ? code :
-			 gs_note_error(e_invalidfont)));
-	    case type1_result_callothersubr:	/* unknown OtherSubr */
-		return type1_call_OtherSubr(i_ctx_p, pcxs,
-					    bbox_getsbw_continue,
-					    &other_subr);
-	    case type1_result_sbw:	/* [h]sbw, done */
-		break;
-	    }
-	    type1_cis_get_metrics(pcis, sbw);
-	    w[0] = sbw[2], w[1] = sbw[3];
-	    /* Now actual width is available, I can calculate much 
-	       better side bearing for WMode 1 from the width. */
-	    pcxs->sbw[0] = w[0] / 2;
-	}
  	return zchar_set_cache(i_ctx_p, pbfont, op - 1,
 			       (pcxs->present == metricsSideBearingAndWidth
 			        && !pcxs->use_FontBBox_as_Metrics2 ?
 			        pcxs->sbw : NULL),
-			       w,
+			       pcxs->sbw + 2,
 			       &pcxs->char_bbox,
 			       cont, exec_cont, 
 			       (pcxs->use_FontBBox_as_Metrics2 ? pcxs->sbw : NULL));
@@ -650,7 +603,7 @@
     code = type1_exec_init(&cxs.cis, penum, igs, pfont1);
     if (code < 0)
 	return code;
-    cxs.char_bbox = bbox;
+    cxs.char_bbox = pfont1->FontBBox;
     code = type1exec_bbox(i_ctx_p, &cxs, pfont, exec_cont);
     return code;
 }
@@ -855,7 +808,6 @@
     int code;
     gs_text_enum_t *penum = op_show_find(i_ctx_p);
     gs_font *pfont;
-    double w[2];
 
     if ((code = gs_pathbbox(igs, &pcxs->char_bbox)) < 0 ||
 	(code = font_param(op - 3, &pfont)) < 0
@@ -868,24 +820,13 @@
 	gs_font_type1 *const pfont1 = (gs_font_type1 *) pfont;
 	op_proc_t cont, exec_cont = 0;
 
-	if (pcxs->present == metricsNone
-	    || pcxs->use_FontBBox_as_Metrics2) {
+	if (pcxs->present == metricsNone) {
 	    gs_point endpt;
 
 	    if ((code = gs_currentpoint(igs, &endpt)) < 0)
 		return code;
-	    /* We will not use sbw[3, 4]. 
-	       If pcxs->use_FontBBox_as_Metrics2 is true,
-	       sbw[3, 4] are used as arguments(W1x, W1y) of setcachedevice2. 
-	       We will use w[0, 1] as W0x and W0y of setcachedevice2.
-	       W0 and W1 is differrent parameters. Don't confuse. */
-	    w[0] = endpt.x, w[1] = endpt.y;
+	    pcxs->sbw[2] = endpt.x, pcxs->sbw[3] = endpt.y;
 	    pcxs->present = metricsSideBearingAndWidth;
-	    if (pcxs->use_FontBBox_as_Metrics2) {
-	      /* Now actual width is available, I can calculate much 
-		 better side bearing for WMode 1 from the width. */
-	      pcxs->sbw[0] = w[0] / 2;
-	    }
 	}
 	/*
 	 * We only need to rebuild the path from scratch if we might
@@ -902,7 +843,7 @@
 	} else {
 	    cont = (pbfont->PaintType == 0 ? nobbox_fill : nobbox_stroke), exec_cont = 0;
 	    code = zchar_set_cache(i_ctx_p, pbfont, op - 1, NULL,
-				    w,
+				   pcxs->sbw + 2,
 				   &pcxs->char_bbox,
 				   cont, &exec_cont,
 				   (pcxs->use_FontBBox_as_Metrics2 ? pcxs->sbw : NULL));

Modified: trunk/gs/src/zchar42.c
===================================================================
--- trunk/gs/src/zchar42.c	2007-08-14 18:53:48 UTC (rev 8189)
+++ trunk/gs/src/zchar42.c	2007-08-14 20:48:29 UTC (rev 8190)
@@ -10,16 +10,6 @@
    or contact Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134,
    San Rafael, CA  94903, U.S.A., +1(415)492-9861, for further information.
 */
-/*
- * Modified by AXE,Inc., BBR Inc. and Turbolinux Inc.
- *   under the technical advice by suzuki toshiya (Hiroshima University)
- * Based on bugfix by Masatake Yamato and Hideo Saito, 2001.
- * For questions, please send mail to espgs8-cjk at printing-japan.org
- *
- * (C) Copyright 2006 Center of the International Cooperation for
- *     Computerization
- */
- 
 
 /* $Id$ */
 /* Type 42 character display operator */
@@ -52,17 +42,11 @@
     double w[2];
     int present;
     gs_font_type42 *pfont42 = (gs_font_type42 *)pbfont;
-    gs_rect bbox,*pbbox;
-    int code = gs_type42_glyph_fbbox((gs_font *)pbfont, glyph_index, &bbox);
+    int code = zchar_get_metrics(pbfont, cnref, sbw);
+    gs_rect bbox;
     int vertical = gs_rootfont(igs)->WMode;
     float sbw_bbox[8];
 
-    if (code != 0) {
-      pbbox = &pbfont->FontBBox;
-    } else {
-      pbbox = &bbox;
-    }
-    code = zchar_get_metrics(pbfont, cnref, sbw);
     if (code < 0)
 	return code;
     present = code;
@@ -91,16 +75,9 @@
 		present = metricsSideBearingAndWidth;
 	    }
 	} else {
-	    float sbw_hbbox[8];
-
-	    code = pfont42->data.get_metrics(pfont42, glyph_index, 
-		    gs_type42_metrics_options_WMODE0_AND_BBOX, sbw_hbbox);
-	    if (code < 0)
-		return code;
-
 	    if (present == metricsNone) {
-		sbw[0] = sbw_hbbox[2] / 2;
-		sbw[1] = pbbox->q.y - sbw_bbox[1];
+		sbw[0] = sbw_bbox[2] / 2;
+		sbw[1] = (pbfont->FontBBox.q.y + pbfont->FontBBox.p.y - sbw_bbox[3]) / 2;
 		sbw[2] = sbw_bbox[2];
 		sbw[3] = sbw_bbox[3];
 		present = metricsSideBearingAndWidth;
@@ -136,7 +113,7 @@
     return zchar_set_cache(i_ctx_p, pbfont, cnref,
 			   (put_lsb && present == metricsSideBearingAndWidth ?
 			    sbw : NULL),
-			   w, pbbox,
+			   w, &bbox,
 			   cont, exec_cont,
 			   gs_rootfont(igs)->WMode ? sbw : NULL);
 }



More information about the gs-cvs mailing list