[Xorg-commit] xc/lib/font/FreeType ftfuncs.c,1.1.4.3,1.1.4.4 ftfuncs.h,1.1.4.1,1.1.4.2

Kaleb Keithley xorg-commit at pdx.freedesktop.org
Wed May 9 17:30:30 EEST 2007


Committed by: kaleb

Update of /cvs/xorg/xc/lib/font/FreeType
In directory pdx:/home/kaleb/xorg/xc.XORG-CURRENT/lib/font/FreeType

Modified Files:
      Tag: XORG-CURRENT
	ftfuncs.c ftfuncs.h 
Log Message:
merge most of XFree86 RC3 (4.3.99.903) from vendor branch.
bug #214


Index: ftfuncs.c
===================================================================
RCS file: /cvs/xorg/xc/lib/font/FreeType/ftfuncs.c,v
retrieving revision 1.1.4.3
retrieving revision 1.1.4.4
diff -u -d -r1.1.4.3 -r1.1.4.4
--- a/ftfuncs.c	20 Dec 2003 00:28:22 -0000	1.1.4.3
+++ b/ftfuncs.c	23 Feb 2004 21:34:40 -0000	1.1.4.4
@@ -26,8 +26,7 @@
 THE SOFTWARE.
 */
 
-/* $XdotOrg$ */
-/* $XFree86: xc/lib/font/FreeType/ftfuncs.c,v 1.39 2003/12/17 18:14:40 dawes Exp $ */
+/* $XFree86: xc/lib/font/FreeType/ftfuncs.c,v 1.43 2004/02/07 04:37:18 dawes Exp $ */
 
 #include "fontmisc.h"
 
@@ -90,6 +89,8 @@
 
 /* Does the X accept noSuchChar? */
 #define X_ACCEPTS_NO_SUCH_CHAR
+/* Does the XAA accept NULL noSuchChar.bits?(dangerous) */
+/* #define XAA_ACCEPTS_NULL_BITS */
 
 #ifdef X_ACCEPTS_NO_SUCH_CHAR
 static CharInfoRec noSuchChar = { /* metrics */{0,0,0,0,0,0},
@@ -612,6 +613,13 @@
     xrc = FreeTypeRasteriseGlyph(idx, flags, 
 				 &(*glyphs)[segment][offset], instance, 
 				 (*available)[segment][offset] >= FT_AVAILABLE_METRICS);
+    if(xrc != Successful && (*available)[segment][offset] >= FT_AVAILABLE_METRICS) {
+	ErrorF("Warning: FreeTypeRasteriseGlyph() returns an error,\n");
+	ErrorF("\tso the backend tries to set a white space.\n");
+	xrc = FreeTypeRasteriseGlyph(idx, flags | FT_GET_DUMMY,
+				     &(*glyphs)[segment][offset], instance,
+				     (*available)[segment][offset] >= FT_AVAILABLE_METRICS);
+    }
     if(xrc == Successful) {
         (*available)[segment][offset] = FT_AVAILABLE_RASTERISED;
 	/* return the glyph */
@@ -1277,6 +1285,8 @@
     FreeTypeFreeInstance(font->instance);
     if(font->ranges)
         xfree(font->ranges);
+    if(font->dummy_char.bits)
+	xfree(font->dummy_char.bits);
     xfree(font);
 }
 
@@ -1494,9 +1504,17 @@
         i++;
     }
 
-    j = FTGetEnglishName(face->face, TT_NAME_ID_PS_NAME,
+    vp = (char *)FT_Get_Postscript_Name(face->face);
+    if (vp) {
+	j = strlen(vp);
+    } else {
+	j = -1;
+    }
+    if (j < 0) {
+	j = FTGetEnglishName(face->face, TT_NAME_ID_PS_NAME,
                          val, MAXFONTNAMELEN);
-    vp = val;
+	vp = val;
+    }
     if (j < 0) {
         if(t1info && t1info->full_name) {
             vp = t1info->full_name;
@@ -2948,7 +2966,6 @@
 	if(!face->bitmap) {
 	    int new_width;
 	    double ratio,force_c_ratio;
-	    double b_width_diagonal;
 	    double width_x=0,width_y=0;
 	    double force_c_width_x, force_c_rsb_x, force_c_lsb_x;
 	    double tmp_rsb,tmp_lsb,tmp_asc,tmp_des;
@@ -2961,16 +2978,13 @@
 	    tmp_rsb = face->face->bbox.xMax;
 	    if ( tmp_rsb < face->face->max_advance_width ) tmp_rsb = face->face->max_advance_width;
 	    /* apply scaleBBoxWidth */
-	    /* we should not ...???
+	    /* we should not ...??? */
 	    tmp_lsb *= ins_ttcap->scaleBBoxWidth;
 	    tmp_rsb *= ins_ttcap->scaleBBoxWidth;
-	    */
 	    /* transform and rescale */
 	    compute_new_extents( vals, scale, tmp_lsb, tmp_rsb, tmp_des, tmp_asc,
 				 &minLsb, &maxRsb, &descent, &ascent );
 	    /* */
-	    b_width_diagonal = (tmp_rsb - tmp_lsb) /* face->face->max_advance_width */
-			       * vals->pixel_matrix[0] * scale;
 	    /* Consider vertical layouts */
 	    if( 0 < face->face->max_advance_height )
 		max_advance_height = face->face->max_advance_height;
@@ -3455,7 +3469,33 @@
             *gp++ = g;
         }
 #ifdef X_ACCEPTS_NO_SUCH_CHAR
-	else *gp++ = &noSuchChar;
+	else {
+#ifdef XAA_ACCEPTS_NULL_BITS
+	    *gp++ = &noSuchChar;
+#else
+	    if ( tf->dummy_char.bits ) {
+		*gp++ = &tf->dummy_char;
+	    }
+	    else {
+		char *raster = NULL;
+		int wd_actual, ht_actual, wd, ht, bpr;
+		wd_actual = tf->info->maxbounds.rightSideBearing - tf->info->maxbounds.leftSideBearing;
+		ht_actual = tf->info->maxbounds.ascent + tf->info->maxbounds.descent;
+		if(wd_actual <= 0) wd = 1;
+		else wd=wd_actual;
+		if(ht_actual <= 0) ht = 1;
+		else ht=ht_actual;
+		bpr = (((wd + (tf->instance->bmfmt.glyph<<3) - 1) >> 3) & 
+		       -tf->instance->bmfmt.glyph);
+		raster = (char*)xalloc(ht * bpr);
+		if(raster) {
+		    memset(raster, 0, ht * bpr);
+		    tf->dummy_char.bits = raster;
+		    *gp++ = &tf->dummy_char;
+		}
+	    }
+#endif
+	}
 #endif
     }
     

Index: ftfuncs.h
===================================================================
RCS file: /cvs/xorg/xc/lib/font/FreeType/ftfuncs.h,v
retrieving revision 1.1.4.1
retrieving revision 1.1.4.2
diff -u -d -r1.1.4.1 -r1.1.4.2
--- a/ftfuncs.h	26 Nov 2003 22:48:40 -0000	1.1.4.1
+++ b/ftfuncs.h	23 Feb 2004 21:34:40 -0000	1.1.4.2
@@ -20,7 +20,7 @@
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 THE SOFTWARE.
 */
-/* $XFree86: xc/lib/font/FreeType/ftfuncs.h,v 1.16 2003/11/02 04:30:56 dawes Exp $ */
+/* $XFree86: xc/lib/font/FreeType/ftfuncs.h,v 1.17 2003/12/21 04:02:07 dawes Exp $ */
 
 /* Number of buckets in the hashtable holding faces */
 #define NUMFACEBUCKETS 32
@@ -147,6 +147,7 @@
     unsigned zero_idx;
     FontInfoPtr info;
     int nranges;
+    CharInfoRec dummy_char;
     fsRange *ranges;
 } FTFontRec, *FTFontPtr;
 





More information about the xorg-commit mailing list