From 32aa52d4e86996a5011c1963c0f988e547209846 Mon Sep 17 00:00:00 2001 From: Kaleb Keithley Date: Sat, 6 Dec 2003 13:24:23 +0000 Subject: merge XFree86 4.3.99.901 (RC1) from vendor branch --- src/FreeType/ftfuncs.c | 7 ++++--- src/Type1/scanfont.c | 35 ++++++++++++++++++++------------ src/fc/fserve.c | 54 +++++++++++++++++-------------------------------- src/fontfile/fontdir.c | 17 +++++++++++++--- src/fontfile/fontfile.c | 5 ++++- 5 files changed, 63 insertions(+), 55 deletions(-) diff --git a/src/FreeType/ftfuncs.c b/src/FreeType/ftfuncs.c index d942784..7971161 100644 --- a/src/FreeType/ftfuncs.c +++ b/src/FreeType/ftfuncs.c @@ -26,7 +26,8 @@ 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.37 2003/11/20 22:36:35 dawes Exp $ */ +/* $XFree86: xc/lib/font/FreeType/ftfuncs.c,v 1.38 2003/11/29 01:37:36 dawes Exp $ */ +/* $XdotOrg: xc/lib/font/FreeType/ftfuncs.c,v 1.38 2003/11/29 01:37:36 dawes Exp $ */ #include "fontmisc.h" @@ -3043,7 +3044,7 @@ FreeTypeLoadXFont(char *fileName, int ai_lsb,ai_rsb,ai_total; if( 0 < ins_ttcap->autoItalic ) ai=ins_ttcap->autoItalic; else ai = -ins_ttcap->autoItalic; - ai_total = (int)( b_width_diagonal * ai + 0.5); + ai_total = (int)( (ascent+descent) * ai + 0.5); ai_rsb = (int)((double)ai_total * ascent / ( ascent + descent ) + 0.5 ); ai_lsb = -(ai_total - ai_rsb); if( 0 < ins_ttcap->autoItalic ) { @@ -3121,7 +3122,7 @@ FreeTypeLoadXFont(char *fileName, int ai_lsb,ai_rsb,ai_total; if( 0 < ins_ttcap->autoItalic ) ai=ins_ttcap->autoItalic; else ai = -ins_ttcap->autoItalic; - ai_total = (int)( ai * smetrics->max_advance / 64.0 + 0.5); + ai_total = (int)( (ascent+descent) * ai + 0.5); ai_rsb = (int)((double)ai_total * ascent / ( ascent + descent ) + 0.5 ); ai_lsb = -(ai_total - ai_rsb); if( 0 < ins_ttcap->autoItalic ) { diff --git a/src/Type1/scanfont.c b/src/Type1/scanfont.c index 7b2db30..de3836a 100644 --- a/src/Type1/scanfont.c +++ b/src/Type1/scanfont.c @@ -1,3 +1,4 @@ +/* $XdotOrg: scanfont.c,v 1.3 2000/08/17 19:46:32 cpqbld Exp $ */ /* $Xorg: scanfont.c,v 1.3 2000/08/17 19:46:32 cpqbld Exp $ */ /* Copyright International Business Machines,Corp. 1991 * All Rights Reserved @@ -45,7 +46,7 @@ * The Original Software is CID font code that was developed by Silicon * Graphics, Inc. */ -/* $XFree86: xc/lib/font/Type1/scanfont.c,v 1.16 2003/05/27 22:26:46 tsi Exp $ */ +/* $XFree86: xc/lib/font/Type1/scanfont.c,v 1.17 2003/11/29 04:55:28 dawes Exp $ */ #ifndef FONTMODULE #include @@ -1727,8 +1728,9 @@ scan_cidfont(cidfont *CIDFontP, cmapres *CMapP) tokenStartP[tokenLength] = '\0'; rc = FindDictValue(CMapP->CMapInfoP); - /* we are not going to report errors */ - rc = SCAN_OK; + /* we are not going to report errors except out of memory */ + if (rc != SCAN_OUT_OF_MEMORY) + rc = SCAN_OK; break; case TOKEN_NAME: if (0 == strncmp(tokenStartP,"begincodespacerange",19)) { @@ -1983,8 +1985,9 @@ scan_cidfont(cidfont *CIDFontP, cmapres *CMapP) if (CIDWantFontInfo) { rc = FindDictValue(CIDFontP->CIDfontInfoP); - /* we are not going to report errors */ - rc = SCAN_OK; + /* we are not going to report errors except out of memory */ + if (rc != SCAN_OUT_OF_MEMORY) + rc = SCAN_OK; break; } break; @@ -2109,8 +2112,10 @@ scan_cidtype1font(psfont *FontP) /* same UniqueID. We would faile on /UniqueID get */ /* because we are expecting a int to follow UniqueID*/ /* If the correct object type does not follow a Name*/ - /* then we will skip over it without reporting error*/ - rc = SCAN_OK; + /* then we will skip over it without reporting error except */ + /* out of memory */ + if (rc != SCAN_OUT_OF_MEMORY) + rc = SCAN_OK; break; } /* end of reading Private dictionary */ else @@ -2122,8 +2127,9 @@ scan_cidtype1font(psfont *FontP) else if (WantFontInfo) { rc = FindDictValue(FontP->fontInfoP); - /* we are not going to report errors */ - rc = SCAN_OK; + /* we are not going to report errors except out of memory */ + if (rc != SCAN_OUT_OF_MEMORY) + rc = SCAN_OK; break; } break; @@ -2298,8 +2304,10 @@ scan_font(psfont *FontP) /* same UniqueID. We would faile on /UniqueID get */ /* because we are expecting a int to follow UniqueID*/ /* If the correct object type does not follow a Name*/ - /* then we will skip over it without reporting error*/ - rc = SCAN_OK; + /* then we will skip over it without reporting error except */ + /* when out of memory */ + if (rc != SCAN_OUT_OF_MEMORY) + rc = SCAN_OK; break; } /* end of reading Private dictionary */ else @@ -2311,8 +2319,9 @@ scan_font(psfont *FontP) else if (WantFontInfo) { rc = FindDictValue(FontP->fontInfoP); - /* we are not going to report errors */ - rc = SCAN_OK; + /* we are not going to report errors except out of memory */ + if (rc != SCAN_OUT_OF_MEMORY) + rc = SCAN_OK; break; } break; diff --git a/src/fc/fserve.c b/src/fc/fserve.c index c9fccc4..18ea43e 100644 --- a/src/fc/fserve.c +++ b/src/fc/fserve.c @@ -1,3 +1,4 @@ +/* $XdotOrg: fserve.c,v 1.4 2001/02/09 02:04:02 xorgcvs Exp $ */ /* $Xorg: fserve.c,v 1.4 2001/02/09 02:04:02 xorgcvs Exp $ */ /* @@ -24,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/fc/fserve.c,v 3.25 2003/11/20 18:16:34 dawes Exp $ */ +/* $XFree86: xc/lib/font/fc/fserve.c,v 3.26 2003/11/22 02:12:37 dawes Exp $ */ /* * Copyright 1990 Network Computing Devices @@ -1052,44 +1053,27 @@ fs_read_extent_info(FontPathElementPtr fpe, FSBlockDataPtr blockrec) ci->metrics.descent = FONT_MAX_DESCENT(fi); ci->metrics.characterWidth = FONT_MAX_WIDTH(fi); ci->metrics.attributes = ii->metrics.attributes; - /* Bounds check. */ - if (ci->metrics.ascent > fi->maxbounds.ascent) - { - ErrorF("fserve: warning: %s %s ascent (%d) " - "> maxascent (%d)\n", - fpe->name, fsd->name, - ci->metrics.ascent, fi->maxbounds.ascent); - ci->metrics.ascent = fi->maxbounds.ascent; - } - if (ci->metrics.descent > fi->maxbounds.descent) - { - ErrorF("fserve: warning: %s %s descent (%d) " - "> maxdescent (%d)\n", - fpe->name, fsd->name, - ci->metrics.descent, fi->maxbounds.descent); - ci->metrics.descent = fi->maxbounds.descent; - } } else { ci->metrics = ii->metrics; - /* Bounds check. */ - if (ci->metrics.ascent > fi->maxbounds.ascent) - { - ErrorF("fserve: warning: %s %s ascent (%d) " - "> maxascent (%d)\n", - fpe->name, fsd->name, - ci->metrics.ascent, fi->maxbounds.ascent); - ci->metrics.ascent = fi->maxbounds.ascent; - } - if (ci->metrics.descent > fi->maxbounds.descent) - { - ErrorF("fserve: warning: %s %s descent (%d) " - "> maxdescent (%d)\n", - fpe->name, fsd->name, - ci->metrics.descent, fi->maxbounds.descent); - ci->metrics.descent = fi->maxbounds.descent; - } + } + /* Bounds check. */ + if (ci->metrics.ascent > fi->maxbounds.ascent) + { + ErrorF("fserve: warning: %s %s ascent (%d) " + "> maxascent (%d)\n", + fpe->name, fsd->name, + ci->metrics.ascent, fi->maxbounds.ascent); + ci->metrics.ascent = fi->maxbounds.ascent; + } + if (ci->metrics.descent > fi->maxbounds.descent) + { + ErrorF("fserve: warning: %s %s descent (%d) " + "> maxdescent (%d)\n", + fpe->name, fsd->name, + ci->metrics.descent, fi->maxbounds.descent); + ci->metrics.descent = fi->maxbounds.descent; } } } diff --git a/src/fontfile/fontdir.c b/src/fontfile/fontdir.c index 28e58b6..e94c483 100644 --- a/src/fontfile/fontdir.c +++ b/src/fontfile/fontdir.c @@ -1,3 +1,4 @@ +/* $XdotOrg: fontdir.c,v 1.4 2001/02/09 02:04:03 xorgcvs Exp $ */ /* $Xorg: fontdir.c,v 1.4 2001/02/09 02:04:03 xorgcvs Exp $ */ /* @@ -25,7 +26,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/fontdir.c,v 3.22 2003/07/07 16:40:11 eich Exp $ */ +/* $XFree86: xc/lib/font/fontfile/fontdir.c,v 3.23 2003/12/02 19:50:40 dawes Exp $ */ /* * Author: Keith Packard, MIT X Consortium @@ -629,6 +630,9 @@ FontFileAddFontFile (FontDirectoryPtr dir, char *fontName, char *fileName) FontScalableExtraPtr extra; FontEntryPtr bitmap = 0, scalable; Bool isscale; +#ifdef FONTDIRATTRIB + Bool scalable_xlfd; +#endif renderer = FontFileMatchRenderer (fileName); if (!renderer) @@ -656,8 +660,15 @@ FontFileAddFontFile (FontDirectoryPtr dir, char *fontName, char *fileName) !(vals.values_supplied & ENHANCEMENT_SPECIFY_MASK); #ifdef FONTDIRATTRIB #define UNSCALED_ATTRIB "unscaled" - /* For scalable fonts, check if the "unscaled" attribute is present */ - if (isscale && dir->attributes && dir->attributes[0] == ':') { + scalable_xlfd = (isscale && + (((vals.values_supplied & PIXELSIZE_MASK) == 0) || + ((vals.values_supplied & POINTSIZE_MASK) == 0))); + /* + * For scalable fonts without a scalable XFLD, check if the "unscaled" + * attribute is present. + */ + if (isscale && !scalable_xlfd && + dir->attributes && dir->attributes[0] == ':') { char *ptr1 = dir->attributes + 1; char *ptr2; int length; diff --git a/src/fontfile/fontfile.c b/src/fontfile/fontfile.c index 6378c39..a2fef2d 100644 --- a/src/fontfile/fontfile.c +++ b/src/fontfile/fontfile.c @@ -1,3 +1,4 @@ +/* $XdotOrg: fontfile.c,v 1.4 2001/02/09 02:04:03 xorgcvs Exp $ */ /* $Xorg: fontfile.c,v 1.4 2001/02/09 02:04:03 xorgcvs Exp $ */ /* @@ -25,7 +26,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/fontfile.c,v 3.19 2003/11/08 02:02:03 dawes Exp $ */ +/* $XFree86: xc/lib/font/fontfile/fontfile.c,v 3.21 2003/12/02 19:50:40 dawes Exp $ */ /* * Author: Keith Packard, MIT X Consortium @@ -531,6 +532,8 @@ FontFileGetInfoBitmap (FontPathElementPtr fpe, FontInfoPtr pFontInfo, dir = (FontDirectoryPtr) fpe->private; bitmap = &entry->u.bitmap; + if (!bitmap || !bitmap->renderer->GetInfoBitmap) + return BadFontName; strcpy (fileName, dir->directory); strcat (fileName, bitmap->fileName); ret = (*bitmap->renderer->GetInfoBitmap) (fpe, pFontInfo, entry, fileName); -- cgit v1.2.3