diff options
-rw-r--r-- | src/FreeType/ftfuncs.c | 47 | ||||
-rw-r--r-- | src/FreeType/ftfuncs.h | 3 | ||||
-rw-r--r-- | src/Type1/t1malloc.c | 15 | ||||
-rw-r--r-- | src/fc/fserve.c | 4 | ||||
-rw-r--r-- | src/fontfile/renderers.c | 4 |
5 files changed, 54 insertions, 19 deletions
diff --git a/src/FreeType/ftfuncs.c b/src/FreeType/ftfuncs.c index f87a278..4dbff4a 100644 --- a/src/FreeType/ftfuncs.c +++ b/src/FreeType/ftfuncs.c @@ -26,7 +26,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/* $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.42 2003/12/31 05:10:03 dawes Exp $ */ #include "fontmisc.h" @@ -89,6 +89,8 @@ THE SOFTWARE. /* 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}, @@ -611,6 +613,13 @@ FreeTypeInstanceGetGlyph(unsigned idx, int flags, CharInfoPtr *g, FTInstancePtr 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 */ @@ -1276,6 +1285,8 @@ FreeTypeFreeFont(FTFontPtr font) FreeTypeFreeInstance(font->instance); if(font->ranges) xfree(font->ranges); + if(font->dummy_char.bits) + xfree(font->dummy_char.bits); xfree(font); } @@ -2947,7 +2958,6 @@ FreeTypeLoadXFont(char *fileName, 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; @@ -2960,16 +2970,13 @@ FreeTypeLoadXFont(char *fileName, 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; @@ -3454,7 +3461,33 @@ FreeTypeGetGlyphs(FontPtr pFont, unsigned long count, unsigned char *chars, *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 } diff --git a/src/FreeType/ftfuncs.h b/src/FreeType/ftfuncs.h index a08d521..dadb546 100644 --- a/src/FreeType/ftfuncs.h +++ b/src/FreeType/ftfuncs.h @@ -20,7 +20,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 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 @@ typedef struct _FTFont{ unsigned zero_idx; FontInfoPtr info; int nranges; + CharInfoRec dummy_char; fsRange *ranges; } FTFontRec, *FTFontPtr; diff --git a/src/Type1/t1malloc.c b/src/Type1/t1malloc.c index 08a3a8b..81ff220 100644 --- a/src/Type1/t1malloc.c +++ b/src/Type1/t1malloc.c @@ -26,7 +26,7 @@ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF * THIS SOFTWARE. */ -/* $XFree86: xc/lib/font/Type1/t1malloc.c,v 1.11 2002/02/18 20:51:57 herrb Exp $ */ +/* $XFree86: xc/lib/font/Type1/t1malloc.c,v 1.12 2004/01/23 03:55:25 dawes Exp $ */ /* MALLOC CWEB V0004 LOTS */ /* :h1.MALLOC - Fast Memory Allocation @@ -258,13 +258,13 @@ If we have too many uncombined blocks, call combine() to combine one. if (++uncombined > MAXUNCOMBINED) { combine(); if (mallocdebug) { - printf("xiFree(%p) with combine, ", addr); + printf("xiFree(%p) with combine, ", (void *)addr); dumpchain(); } } else { if (mallocdebug) { - printf("xiFree(%p), ", addr); + printf("xiFree(%p), ", (void *)addr); dumpchain(); } } @@ -470,7 +470,8 @@ only to be "unhook"ed: unhook(p); uncombined--; if (mallocdebug) { - printf("fast xiMalloc(%ld) = %p, ", size, p); + printf("fast xiMalloc(%ld) = %p, ", size, + (void *)p); dumpchain(); } AvailableWords += size; /* decreases AvailableWords */ @@ -527,7 +528,7 @@ flag that this block is allocated: area[size - 1] = area[0] = - size; if (mallocdebug) { - printf("slow xiMalloc(%ld) @ %p, ", size, area); + printf("slow xiMalloc(%ld) @ %p, ", size, (void *)area); dumpchain(); } whocalledme(area, &Size); @@ -646,7 +647,7 @@ dumpchain(void) if (--i < 0) Abort("too many uncombined areas"); size = p->size; - printf(". . . area @ %p, size = %ld\n", p, -size); + printf(". . . area @ %p, size = %ld\n", (void *)p, -size); if (size >= 0 || size != ((int *) p)[-1 - size]) Abort("dumpchain: bad size"); if (p->back != back) @@ -656,7 +657,7 @@ dumpchain(void) printf("DUMPING COMBINED FREE LIST:\n"); for (; p != &lastfree; p = p->fore) { size = p->size; - printf(". . . area @ %p, size = %ld\n", p, size); + printf(". . . area @ %p, size = %ld\n", (void *)p, size); if (size <= 0 || size != ((int *) p)[size - 1]) Abort("dumpchain: bad size"); if (p->back != back) diff --git a/src/fc/fserve.c b/src/fc/fserve.c index ee2bdb3..07634cc 100644 --- a/src/fc/fserve.c +++ b/src/fc/fserve.c @@ -24,7 +24,7 @@ used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/lib/font/fc/fserve.c,v 3.26 2003/11/22 02:12:37 dawes Exp $ */ +/* $XFree86: xc/lib/font/fc/fserve.c,v 3.27 2004/01/12 17:19:30 tsi Exp $ */ /* * Copyright 1990 Network Computing Devices @@ -2214,7 +2214,7 @@ _fs_load_glyphs(pointer client, FontPtr pfont, Bool range_flag, xfree(ranges); /* Now try to reopen the font. */ - return fs_send_open_font(client, (FontPathElementPtr)0, + return fs_send_open_font(client, pfont->fpe, (Mask)FontReopen, (char *)0, 0, (fsBitmapFormat)0, (fsBitmapFormatMask)0, (XID)0, &pfont); diff --git a/src/fontfile/renderers.c b/src/fontfile/renderers.c index 2db871d..0230e09 100644 --- a/src/fontfile/renderers.c +++ b/src/fontfile/renderers.c @@ -25,7 +25,7 @@ used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/lib/font/fontfile/renderers.c,v 1.7 2002/12/09 17:30:00 dawes Exp $ */ +/* $XFree86: xc/lib/font/fontfile/renderers.c,v 1.8 2004/01/06 16:28:21 martin Exp $ */ /* * Author: Keith Packard, MIT X Consortium @@ -58,7 +58,7 @@ FontFilePriorityRegisterRenderer (FontRendererPtr renderer, int priority) if (rendererGeneration != serverGeneration) { rendererGeneration = serverGeneration; renderers.number = 0; - if (!renderers.renderers) + if (renderers.renderers) xfree(renderers.renderers); renderers.renderers = NULL; } |