Module Name: xsrc
Committed By: mrg
Date: Fri May 31 01:18:45 UTC 2013
Modified Files:
xsrc/external/mit/libXfont/dist/src/FreeType: ftfuncs.c
xsrc/external/mit/libXfont/dist/src/bitmap: pcfread.c
xsrc/external/mit/libXfont/dist/src/fontfile: bunzip2.c decompress.c
Removed Files:
xsrc/external/mit/libXfont/dist/doc: fontlib.css fontlib.xsl
Log Message:
merge libXfont 1.4.5
To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r0 xsrc/external/mit/libXfont/dist/doc/fontlib.css \
xsrc/external/mit/libXfont/dist/doc/fontlib.xsl
cvs rdiff -u -r1.2 -r1.3 \
xsrc/external/mit/libXfont/dist/src/FreeType/ftfuncs.c
cvs rdiff -u -r1.2 -r1.3 xsrc/external/mit/libXfont/dist/src/bitmap/pcfread.c
cvs rdiff -u -r1.3 -r1.4 \
xsrc/external/mit/libXfont/dist/src/fontfile/bunzip2.c \
xsrc/external/mit/libXfont/dist/src/fontfile/decompress.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: xsrc/external/mit/libXfont/dist/src/FreeType/ftfuncs.c
diff -u xsrc/external/mit/libXfont/dist/src/FreeType/ftfuncs.c:1.2 xsrc/external/mit/libXfont/dist/src/FreeType/ftfuncs.c:1.3
--- xsrc/external/mit/libXfont/dist/src/FreeType/ftfuncs.c:1.2 Thu Aug 11 22:12:07 2011
+++ xsrc/external/mit/libXfont/dist/src/FreeType/ftfuncs.c Fri May 31 01:18:45 2013
@@ -25,9 +25,6 @@ LIABILITY, WHETHER IN AN ACTION OF CONTR
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
-/* $XdotOrg: xc/lib/font/FreeType/ftfuncs.c,v 1.11 2005/07/03 07:00:58 daniels Exp $ */
-
-/* $XFree86: xc/lib/font/FreeType/ftfuncs.c,v 1.43 2004/02/07 04:37:18 dawes Exp $ */
#ifdef HAVE_CONFIG_H
#include <config.h>
@@ -51,7 +48,7 @@ THE SOFTWARE.
#include FT_BBOX_H
#include FT_TRUETYPE_TAGS_H
/*
- * If you want to use FT_Outline_Get_CBox instead of
+ * If you want to use FT_Outline_Get_CBox instead of
* FT_Outline_Get_BBox, define here.
*/
/* #define USE_GET_CBOX */
@@ -97,7 +94,7 @@ static CharInfoRec noSuchChar = { /* met
/* The propery names for all the XLFD properties. */
-static char *xlfd_props[] = {
+static const char *xlfd_props[] = {
"FOUNDRY",
"FAMILY_NAME",
"WEIGHT_NAME",
@@ -163,7 +160,7 @@ iceil(int x, int y)
{
return ifloor(x + y - 1, y);
}
-
+
static int
FreeTypeOpenFace(FTFacePtr *facep, char *FTFileName, char *realFileName, int faceNumber)
{
@@ -188,7 +185,7 @@ FreeTypeOpenFace(FTFacePtr *facep, char
otherFace = otherFace->next;
}
if(otherFace) {
- MUMBLE1("Returning cached face: %s\n", otherFace->filename);
+ MUMBLE("Returning cached face: %s\n", otherFace->filename);
*facep = otherFace;
return Successful;
}
@@ -253,7 +250,7 @@ FreeTypeFreeFace(FTFacePtr face)
else
ErrorF("FreeType: freeing unknown face\n");
}
- MUMBLE1("Closing face: %s\n", face->filename);
+ MUMBLE("Closing face: %s\n", face->filename);
FT_Done_Face(face->face);
free(face->filename);
free(face);
@@ -270,7 +267,7 @@ TransEqual(FTNormalisedTransformationPtr
else if(t1->nonIdentity != t2->nonIdentity)
return 0;
else if(t1->nonIdentity && t2->nonIdentity) {
- return
+ return
t1->matrix.xx == t2->matrix.xx &&
t1->matrix.yx == t2->matrix.yx &&
t1->matrix.yy == t2->matrix.yy &&
@@ -303,7 +300,7 @@ TTCapEqual(struct TTCapInfo *t1, struct
t1->flags == t2->flags &&
t1->scaleBitmap == t2->scaleBitmap &&
/*
- If we use forceConstantSpacing,
+ If we use forceConstantSpacing,
we *MUST* allocate new instance.
*/
t1->forceConstantSpacingEnd < 0 &&
@@ -314,7 +311,7 @@ static int
FTInstanceMatch(FTInstancePtr instance,
char *FTFileName, FTNormalisedTransformationPtr trans,
int spacing, FontBitmapFormatPtr bmfmt,
- struct TTCapInfo *tmp_ttcap, FT_Int32 load_flags)
+ struct TTCapInfo *tmp_ttcap, FT_Int32 load_flags)
{
if(strcmp(instance->face->filename, FTFileName) != 0) {
return 0;
@@ -350,7 +347,7 @@ FreeTypeActivateInstance(FTInstancePtr i
instance->transformation.nonIdentity ?
&instance->transformation.matrix : 0,
0);
-
+
instance->face->active_instance = instance;
return Successful;
}
@@ -380,7 +377,7 @@ FTFindSize(FT_Face face, FTNormalisedTra
j = i;
d = dd;
}
- }
+ }
}
if(j < 0)
return BadFontName;
@@ -533,7 +530,7 @@ FreeTypeOpenInstance(FTInstancePtr *inst
/* maintain a linked list of instances */
instance->next = instance->face->instances;
instance->face->instances = instance;
-
+
*instance_return = instance;
return Successful;
}
@@ -550,7 +547,7 @@ FreeTypeFreeInstance(FTInstancePtr insta
instance->refcount--;
if(instance->refcount <= 0) {
int i,j;
-
+
if(instance->face->instances == instance)
instance->face->instances = instance->next;
else {
@@ -576,7 +573,7 @@ FreeTypeFreeInstance(FTInstancePtr insta
for(i = 0; i < iceil(instance->nglyphs, FONTSEGMENTSIZE); i++) {
if(instance->glyphs[i]) {
for(j = 0; j < FONTSEGMENTSIZE; j++) {
- if(instance->available[i][j] ==
+ if(instance->available[i][j] ==
FT_AVAILABLE_RASTERISED)
free(instance->glyphs[i][j].bits);
}
@@ -613,7 +610,7 @@ FreeTypeInstanceFindGlyph(unsigned idx_i
*found = 0;
return Successful;
}
-
+
if(*available == NULL) {
*available = calloc(iceil(instance->nglyphs, FONTSEGMENTSIZE),
sizeof(int *));
@@ -656,7 +653,7 @@ FreeTypeInstanceGetGlyph(unsigned idx, i
int xrc;
int ***available;
CharInfoPtr **glyphs;
-
+
available = &instance->available;
glyphs = &instance->glyphs;
@@ -668,17 +665,17 @@ FreeTypeInstanceGetGlyph(unsigned idx, i
if(!found || (*available)[segment][offset] == FT_AVAILABLE_NO) {
*g = NULL;
return Successful;
- }
+ }
if((*available)[segment][offset] == FT_AVAILABLE_RASTERISED) {
*g = &(*glyphs)[segment][offset];
return Successful;
}
-
+
flags |= FT_GET_GLYPH_BOTH;
- xrc = FreeTypeRasteriseGlyph(idx, flags,
- &(*glyphs)[segment][offset], instance,
+ 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");
@@ -701,7 +698,7 @@ FreeTypeInstanceGetGlyphMetrics(unsigned
{
int xrc;
int found, segment, offset;
-
+
/* Char cell */
if(instance->spacing == FT_CHARCELL) {
*metrics = instance->charcellMetrics;
@@ -715,8 +712,8 @@ FreeTypeInstanceGetGlyphMetrics(unsigned
/* Not char cell */
- xrc = FreeTypeInstanceFindGlyph(idx, flags, instance,
- &instance->glyphs, &instance->available,
+ xrc = FreeTypeInstanceFindGlyph(idx, flags, instance,
+ &instance->glyphs, &instance->available,
&found, &segment, &offset);
if(xrc != Successful)
return xrc;
@@ -727,16 +724,16 @@ FreeTypeInstanceGetGlyphMetrics(unsigned
if( instance->available[segment][offset] == FT_AVAILABLE_NO ) {
*metrics = NULL;
return Successful;
- }
+ }
if( instance->available[segment][offset] >= FT_AVAILABLE_METRICS ) {
*metrics = &instance->glyphs[segment][offset].metrics;
return Successful;
}
-
+
flags |= FT_GET_GLYPH_METRICS_ONLY;
- xrc = FreeTypeRasteriseGlyph(idx, flags,
+ xrc = FreeTypeRasteriseGlyph(idx, flags,
&instance->glyphs[segment][offset],
instance, 0);
if(xrc == Successful) {
@@ -745,7 +742,7 @@ FreeTypeInstanceGetGlyphMetrics(unsigned
}
return xrc;
}
-
+
/*
* Pseudo enbolding similar as Microsoft Windows.
* It is useful but poor.
@@ -799,7 +796,7 @@ ft_make_up_italic_bitmap( char *raster,
tmp_shift %= 8;
if ( tmp_shift ) {
for (x=bpr-1;0<=x;x--) {
- if ( x != bpr-1 )
+ if ( x != bpr-1 )
tmp_p[x+1] |= tmp_p[x]<<(8-tmp_shift);
tmp_p[x]>>=tmp_shift;
}
@@ -817,7 +814,7 @@ ft_make_up_italic_bitmap( char *raster,
tmp_shift %= 8;
if ( tmp_shift ) {
for (x=0;x<bpr;x++) {
- if ( x != 0 )
+ if ( x != 0 )
tmp_p[x-1] |= tmp_p[x]>>(8-tmp_shift);
tmp_p[x]<<=tmp_shift;
}
@@ -895,7 +892,7 @@ tt_get_metrics( FT_Face face,
}
}
-static int
+static int
ft_get_very_lazy_bbox( FT_UInt index,
FT_Face face,
FT_Size size,
@@ -1052,7 +1049,7 @@ FT_Do_SBit_Metrics( FT_Face ft_face, FT_
metrics_return->horiBearingX = (FT_Pos)elem_metrics.horiBearingX << 6;
metrics_return->horiBearingY = (FT_Pos)elem_metrics.horiBearingY << 6;
metrics_return->horiAdvance = (FT_Pos)elem_metrics.horiAdvance << 6;
-
+
metrics_return->vertBearingX = (FT_Pos)elem_metrics.vertBearingX << 6;
metrics_return->vertBearingY = (FT_Pos)elem_metrics.vertBearingY << 6;
metrics_return->vertAdvance = (FT_Pos)elem_metrics.vertAdvance << 6;
@@ -1103,12 +1100,12 @@ FreeTypeRasteriseGlyph(unsigned idx, int
if(!hasMetrics) {
if( instance->spacing == FT_CHARCELL || flags & FT_GET_DUMMY ){
- memcpy((char*)&tgp->metrics,
+ memcpy((char*)&tgp->metrics,
(char*)instance->charcellMetrics,
sizeof(xCharInfo));
}
else if( flags & FT_FORCE_CONSTANT_SPACING ) {
- memcpy((char*)&tgp->metrics,
+ memcpy((char*)&tgp->metrics,
(char*)instance->forceConstantMetrics,
sizeof(xCharInfo));
}
@@ -1126,16 +1123,16 @@ FreeTypeRasteriseGlyph(unsigned idx, int
}
if( bitmap_metrics == NULL ) {
if ( sbitchk_incomplete_but_exist==0 && (instance->ttcap.flags & TTCAP_IS_VERY_LAZY) ) {
- if( ft_get_very_lazy_bbox( idx, face->face, instance->size,
+ if( ft_get_very_lazy_bbox( idx, face->face, instance->size,
face->num_hmetrics,
instance->ttcap.vl_slant,
&instance->transformation.matrix,
- &bbox, &outline_hori_advance,
+ &bbox, &outline_hori_advance,
&outline_vert_advance ) == 0 ) {
goto bbox_ok; /* skip exact calculation */
}
}
- ftrc = FT_Load_Glyph(instance->face->face, idx,
+ ftrc = FT_Load_Glyph(instance->face->face, idx,
instance->load_flags);
if(ftrc != 0) return FTtoXReturnCode(ftrc);
metrics = &face->face->glyph->metrics;
@@ -1146,11 +1143,11 @@ FreeTypeRasteriseGlyph(unsigned idx, int
if( bitmap_metrics ) {
FT_Pos factor;
-
+
leftSideBearing = bitmap_metrics->horiBearingX / 64;
rightSideBearing = (bitmap_metrics->width + bitmap_metrics->horiBearingX) / 64;
bbox_center_raw = (2.0 * bitmap_metrics->horiBearingX + bitmap_metrics->width)/2.0/64.0;
- characterWidth = (int)floor(bitmap_metrics->horiAdvance
+ characterWidth = (int)floor(bitmap_metrics->horiAdvance
* instance->ttcap.scaleBBoxWidth / 64.0 + .5);
ascent = bitmap_metrics->horiBearingY / 64;
descent = (bitmap_metrics->height - bitmap_metrics->horiBearingY) / 64 ;
@@ -1195,11 +1192,11 @@ FreeTypeRasteriseGlyph(unsigned idx, int
bbox_center_raw = (double)(bbox.xMax + bbox.xMin)/2.0/64.;
if ( instance->pixel_width_unit_x != 0 )
characterWidth =
- (int)floor( outline_hori_advance
+ (int)floor( outline_hori_advance
* instance->ttcap.scaleBBoxWidth
* instance->pixel_width_unit_x / 64. + .5);
else {
- characterWidth =
+ characterWidth =
(int)floor( outline_vert_advance
* instance->ttcap.scaleBBoxHeight
* instance->pixel_width_unit_y / 64. + .5);
@@ -1215,12 +1212,12 @@ FreeTypeRasteriseGlyph(unsigned idx, int
characterWidth = new_width;
if ( instance->pixel_width_unit_x != 0 )
rawCharacterWidth =
- (unsigned short)(short)(floor(1000 * outline_hori_advance
+ (unsigned short)(short)(floor(1000 * outline_hori_advance
* instance->ttcap.scaleBBoxWidth * ratio
* instance->pixel_width_unit_x / 64.));
else {
rawCharacterWidth =
- (unsigned short)(short)(floor(1000 * outline_vert_advance
+ (unsigned short)(short)(floor(1000 * outline_vert_advance
* instance->ttcap.scaleBBoxHeight * ratio
* instance->pixel_width_unit_y / 64.));
if(rawCharacterWidth <= 0)
@@ -1284,7 +1281,7 @@ FreeTypeRasteriseGlyph(unsigned idx, int
if( flags & FT_GET_DUMMY ) is_outline = -1;
else {
if( !metrics ) {
- ftrc = FT_Load_Glyph(instance->face->face, idx,
+ ftrc = FT_Load_Glyph(instance->face->face, idx,
instance->load_flags);
metrics = &face->face->glyph->metrics;
@@ -1302,7 +1299,7 @@ FreeTypeRasteriseGlyph(unsigned idx, int
bbox.yMin = FLOOR64( bbox.yMin );
bbox.yMax = CEIL64 ( bbox.yMax );
ht_actual = ( bbox.yMax - bbox.yMin ) >> 6;
- /* FreeType think a glyph with 0 height control box is invalid.
+ /* FreeType think a glyph with 0 height control box is invalid.
* So just let X to create a empty bitmap instead. */
if ( ht_actual == 0 )
is_outline = -1;
@@ -1322,11 +1319,11 @@ FreeTypeRasteriseGlyph(unsigned idx, int
if( (instance->ttcap.flags & TTCAP_MONO_CENTER) && hasMetrics ) {
if( is_outline == 1 ){
if( correct ){
- if( ft_get_very_lazy_bbox( idx, face->face, instance->size,
+ if( ft_get_very_lazy_bbox( idx, face->face, instance->size,
face->num_hmetrics,
instance->ttcap.vl_slant,
&instance->transformation.matrix,
- &bbox, &outline_hori_advance,
+ &bbox, &outline_hori_advance,
&outline_vert_advance ) != 0 ){
is_outline = -1; /* <- error */
}
@@ -1360,10 +1357,10 @@ FreeTypeRasteriseGlyph(unsigned idx, int
if(ht_actual <= 0) ht = 1;
else ht=ht_actual;
- bpr = (((wd + (instance->bmfmt.glyph<<3) - 1) >> 3) &
+ bpr = (((wd + (instance->bmfmt.glyph<<3) - 1) >> 3) &
-instance->bmfmt.glyph);
raster = calloc(1, ht * bpr);
- if(raster == NULL)
+ if(raster == NULL)
return AllocError;
tgp->bits = raster;
@@ -1486,7 +1483,7 @@ FreeTypeRasteriseGlyph(unsigned idx, int
if ( is_outline == 0 &&
( instance->ttcap.lsbShiftOfBitmapAutoItalic != 0 ||
instance->ttcap.rsbShiftOfBitmapAutoItalic != 0 ) ) {
- ft_make_up_italic_bitmap( raster, bpr, ht,
+ ft_make_up_italic_bitmap( raster, bpr, ht,
- instance->ttcap.lsbShiftOfBitmapAutoItalic
+ instance->ttcap.rsbShiftOfBitmapAutoItalic,
instance->charcellMetrics->ascent
@@ -1495,11 +1492,11 @@ FreeTypeRasteriseGlyph(unsigned idx, int
- tgp->metrics.ascent,
instance->ttcap.autoItalic);
}
-
+
if(instance->bmfmt.bit == LSBFirst) {
BitOrderInvert((unsigned char*)(tgp->bits), ht*bpr);
}
-
+
if(instance->bmfmt.byte != instance->bmfmt.bit) {
switch(instance->bmfmt.scan) {
case 1:
@@ -1535,7 +1532,7 @@ static void
FreeTypeFreeXFont(FontPtr pFont, int freeProps)
{
FTFontPtr tf;
-
+
if(pFont) {
if((tf = (FTFontPtr)pFont->fontPrivate)) {
FreeTypeFreeFont(tf);
@@ -1565,7 +1562,7 @@ FreeTypeUnloadXFont(FontPtr pFont)
used by Xaw. */
static int
-FreeTypeAddProperties(FTFontPtr font, FontScalablePtr vals, FontInfoPtr info,
+FreeTypeAddProperties(FTFontPtr font, FontScalablePtr vals, FontInfoPtr info,
char *fontname, int rawAverageWidth, Bool font_properties)
{
int i, j, maxprops;
@@ -1603,7 +1600,7 @@ FreeTypeAddProperties(FTFontPtr font, Fo
}
info->nprops = 0; /* in case we abort */
-
+
strcpy(val, fontname);
if(FontParseXLFDName(val, vals, FONT_XLFD_REPLACE_VALUE)) {
xlfdProps = 1;
@@ -1621,11 +1618,11 @@ FreeTypeAddProperties(FTFontPtr font, Fo
( (font_properties && os2) ? 6 : 0 ) +
( (font_properties && (post || t1info)) ? 3 : 0 ) +
2; /* type */
-
+
info->props = malloc(maxprops * sizeof(FontPropRec));
if(info->props == NULL)
return AllocError;
-
+
info->isStringProp = malloc(maxprops);
if(info->isStringProp == NULL) {
free(info->props);
@@ -1649,18 +1646,18 @@ FreeTypeAddProperties(FTFontPtr font, Fo
for (ep = sp; *ep && *ep != '['; ep++);
else
for (ep = sp; *ep && *ep != '-'; ep++);
-
+
info->props[i].name =
MakeAtom(xlfd_props[j], strlen(xlfd_props[j]), TRUE);
-
+
switch(j) {
case 6: /* pixel size */
- info->props[i].value =
+ info->props[i].value =
(int)(fabs(vals->pixel_matrix[3]) + 0.5);
i++;
break;
case 7: /* point size */
- info->props[i].value =
+ info->props[i].value =
(int)(fabs(vals->point_matrix[3])*10.0 + 0.5);
i++;
break;
@@ -1707,7 +1704,7 @@ FreeTypeAddProperties(FTFontPtr font, Fo
if(!face->bitmap) {
info->props[i].name = MakeAtom("RAW_ASCENT", 10, TRUE);
- info->props[i].value =
+ info->props[i].value =
((double)face->face->ascender/(double)upm*1000.0);
i++;
}
@@ -1720,7 +1717,7 @@ FreeTypeAddProperties(FTFontPtr font, Fo
if(!face->bitmap) {
info->props[i].name = MakeAtom("RAW_DESCENT", 11, TRUE);
- info->props[i].value =
+ info->props[i].value =
-((double)face->face->descender/(double)upm*1000.0);
i++;
}
@@ -1740,7 +1737,7 @@ FreeTypeAddProperties(FTFontPtr font, Fo
info->isStringProp[i] = 1;
i++;
}
-
+
j = FTGetEnglishName(face->face, TT_NAME_ID_FULL_NAME,
val, MAXFONTNAMELEN);
vp = val;
@@ -1793,30 +1790,30 @@ FreeTypeAddProperties(FTFontPtr font, Fo
/* In what follows, we assume the matrix is diagonal. In the rare
case when it is not, the values will be somewhat wrong. */
-
+
if( font_properties && os2 ) {
info->props[i].name = MakeAtom("SUBSCRIPT_SIZE",14,TRUE);
- info->props[i].value =
+ info->props[i].value =
TRANSFORM_FUNITS_Y(os2->ySubscriptYSize);
i++;
info->props[i].name = MakeAtom("SUBSCRIPT_X",11,TRUE);
- info->props[i].value =
+ info->props[i].value =
TRANSFORM_FUNITS_X(os2->ySubscriptXOffset);
i++;
info->props[i].name = MakeAtom("SUBSCRIPT_Y",11,TRUE);
- info->props[i].value =
+ info->props[i].value =
TRANSFORM_FUNITS_Y(os2->ySubscriptYOffset);
i++;
info->props[i].name = MakeAtom("SUPERSCRIPT_SIZE",16,TRUE);
- info->props[i].value =
+ info->props[i].value =
TRANSFORM_FUNITS_Y(os2->ySuperscriptYSize);
i++;
info->props[i].name = MakeAtom("SUPERSCRIPT_X",13,TRUE);
- info->props[i].value =
+ info->props[i].value =
TRANSFORM_FUNITS_X(os2->ySuperscriptXOffset);
i++;
info->props[i].name = MakeAtom("SUPERSCRIPT_Y",13,TRUE);
- info->props[i].value =
+ info->props[i].value =
TRANSFORM_FUNITS_Y(os2->ySuperscriptYOffset);
i++;
}
@@ -1824,15 +1821,15 @@ FreeTypeAddProperties(FTFontPtr font, Fo
if( font_properties && (post || t1info) ) {
int underlinePosition, underlineThickness;
- /* Raw underlineposition counts upwards,
+ /* Raw underlineposition counts upwards,
but UNDERLINE_POSITION counts downwards. */
if(post) {
underlinePosition = TRANSFORM_FUNITS_Y(-post->underlinePosition);
underlineThickness = TRANSFORM_FUNITS_Y(post->underlineThickness);
} else {
- underlinePosition =
+ underlinePosition =
TRANSFORM_FUNITS_Y(-t1info->underline_position);
- underlineThickness =
+ underlineThickness =
TRANSFORM_FUNITS_Y(t1info->underline_thickness);
}
if(underlineThickness <= 0)
@@ -1851,8 +1848,8 @@ FreeTypeAddProperties(FTFontPtr font, Fo
/* The italic angle is often unreliable for Type 1 fonts */
if(post && trans->matrix.xx == trans->matrix.yy) {
info->props[i].name = MakeAtom("ITALIC_ANGLE",12,TRUE);
- info->props[i].value =
- /* Convert from TT_Fixed to
+ info->props[i].value =
+ /* Convert from TT_Fixed to
64th of a degree counterclockwise from 3 o'clock */
90*64+(post->italicAngle >> 10);
i++;
@@ -1866,12 +1863,12 @@ FreeTypeAddProperties(FTFontPtr font, Fo
info->props[i].value = MakeAtom(vp, strlen(vp), TRUE);
info->isStringProp[i] = 1;
i++;
-
+
info->props[i].name = MakeAtom("RASTERIZER_NAME", 15, TRUE);
info->props[i].value = MakeAtom("FreeType", 10, TRUE);
info->isStringProp[i] = 1;
i++;
-
+
info->nprops = i;
return Successful;
}
@@ -1879,20 +1876,20 @@ FreeTypeAddProperties(FTFontPtr font, Fo
static int
ft_get_index(unsigned code, FTFontPtr font, unsigned *idx)
{
-
+
/* As a special case, we pass 0 even when it is not in the ranges;
this will allow for the default glyph, which should exist in any
TrueType font. */
-
+
/* This is not required...
if(code > 0 && font->nranges) {
int i;
for(i = 0; i < font->nranges; i++)
- if((code >=
+ if((code >=
font->ranges[i].min_char_low+
(font->ranges[i].min_char_high<<8)) &&
(code <=
- font->ranges[i].max_char_low +
+ font->ranges[i].max_char_low +
(font->ranges[i].max_char_high<<8)))
break;
if(i == font->nranges) {
@@ -1914,7 +1911,7 @@ ft_get_index(unsigned code, FTFontPtr fo
}
*idx = FTRemap(font->instance->face->face, &font->mapping, code);
-
+
return 0;
}
@@ -1923,7 +1920,7 @@ FreeTypeFontGetGlyph(unsigned code, int
{
unsigned idx = 0;
int xrc;
-
+
#ifdef X_ACCEPTS_NO_SUCH_CHAR
if( ft_get_index(code,font,&idx) || idx == 0 || idx == font->zero_idx ) {
*g = NULL;
@@ -1975,7 +1972,7 @@ FreeTypeFontGetGlyphMetrics(unsigned cod
if( xrc == Successful && *metrics != NULL )
return Successful;
if( font->zero_idx != idx ) {
- xrc = FreeTypeInstanceGetGlyphMetrics(font->zero_idx, flags,
+ xrc = FreeTypeInstanceGetGlyphMetrics(font->zero_idx, flags,
metrics, font->instance);
if( xrc == Successful && *metrics != NULL )
return Successful;
@@ -2159,7 +2156,7 @@ restrict_code_range_by_str(int count,uns
}
/* *face_number and *spacing are initialized but *load_flags is NOT. */
-static int
+static int
FreeTypeSetUpTTCap( char *fileName, FontScalablePtr vals,
char **dynStrRealFileName, char **dynStrFTFileName,
struct TTCapInfo *ret, int *face_number, FT_Int32 *load_flags,
@@ -2188,7 +2185,7 @@ FreeTypeSetUpTTCap( char *fileName, Font
{
/* font cap */
char *p1=NULL, *p2=NULL;
-
+
p1=strrchr(fileName, '/');
if ( p1 == NULL ) p1 = fileName;
else p1++;
@@ -2196,7 +2193,7 @@ FreeTypeSetUpTTCap( char *fileName, Font
/* colon exist in the right side of slash. */
int dirLen = p1-fileName;
int baseLen = fileName+len - p2 -1;
-
+
*dynStrRealFileName = malloc(dirLen+baseLen+1);
if( *dynStrRealFileName == NULL ) {
result = AllocError;
@@ -2305,7 +2302,7 @@ FreeTypeSetUpTTCap( char *fileName, Font
fprintf(stderr,"[Filename:%s]\n",fileName);
fprintf(stderr,"[RealFilename:%s]\n",*dynStrRealFileName);
fprintf(stderr,"[FTFilename:%s]\n",*dynStrFTFileName);
- */
+ */
/* slant control */
if (SPropRecValList_search_record(&listPropRecVal,
&contRecValue,
@@ -2590,15 +2587,15 @@ FreeTypeSetUpTTCap( char *fileName, Font
semic_ptr=strchr(strMetrics,';');
comma_ptr=strchr(strMetrics,',');
period_ptr=strchr(strMetrics,'.');
- if ( semic_ptr && comma_ptr )
+ if ( semic_ptr && comma_ptr )
if ( semic_ptr < comma_ptr ) comma_ptr=NULL;
- if ( semic_ptr && period_ptr )
+ if ( semic_ptr && period_ptr )
if ( semic_ptr < period_ptr ) period_ptr=NULL;
if ( !comma_ptr && !period_ptr && strMetrics != semic_ptr ) {
if ( restrict_code_range_by_str(1,&first_col, &first_row,
&last_col, &last_row,
SPropContainer_value_str(contRecValue)) == 1 ) {
- ret->force_c_representative_metrics_char_code =
+ ret->force_c_representative_metrics_char_code =
(int)( first_row<<8 | first_col );
}
}
@@ -2691,14 +2688,14 @@ ft_get_trans_from_vals( FontScalablePtr
{
/* Compute the transformation matrix. We use floating-point
arithmetic for simplicity */
-
+
trans->xres = vals->x;
trans->yres = vals->y;
-
+
/* This value cannot be 0. */
trans->scale = hypot(vals->point_matrix[2], vals->point_matrix[3]);
trans->nonIdentity = 0;
-
+
/* Try to round stuff. We want approximate zeros to be exact zeros,
and if the elements on the diagonal are approximately equal, we
want them equal. We do this to avoid breaking hinting. */
@@ -2713,14 +2710,14 @@ ft_get_trans_from_vals( FontScalablePtr
((vals->point_matrix[0] + vals->point_matrix[3])/2*
(double)TWO_SIXTEENTH)/trans->scale;
}
-
+
if(DIFFER0(vals->point_matrix[1], trans->scale)) {
trans->matrix.yx =
(int)((vals->point_matrix[1]*(double)TWO_SIXTEENTH)/trans->scale);
trans->nonIdentity = 1;
} else
trans->matrix.yx = 0;
-
+
if(DIFFER0(vals->point_matrix[2], trans->scale)) {
trans->matrix.xy =
(int)((vals->point_matrix[2]*(double)TWO_SIXTEENTH)/trans->scale);
@@ -2752,7 +2749,7 @@ is_fixed_width(FT_Face face)
static int
FreeTypeLoadFont(FTFontPtr font, FontInfoPtr info, FTFacePtr face,
char *FTFileName, FontScalablePtr vals, FontEntryPtr entry,
- FontBitmapFormatPtr bmfmt, FT_Int32 load_flags,
+ FontBitmapFormatPtr bmfmt, FT_Int32 load_flags,
struct TTCapInfo *tmp_ttcap, char *dynStrTTCapCodeRange,
int ttcap_spacing )
{
@@ -2769,7 +2766,7 @@ FreeTypeLoadFont(FTFontPtr font, FontInf
if(entry->name.ndashes == 14) {
char *p;
int dashes = 0;
- for(p = entry->name.name;
+ for(p = entry->name.name;
p <= entry->name.name + entry->name.length - 2;
p++) {
if(*p == '-') {
@@ -2803,17 +2800,17 @@ FreeTypeLoadFont(FTFontPtr font, FontInf
if (xrc != Successful)
return xrc;
} else {
- xrc = FTPickMapping(0, 0, FTFileName,
+ xrc = FTPickMapping(0, 0, FTFileName,
face->face, &font->mapping);
if (xrc != Successful)
return xrc;
}
-
+
font->nranges = vals->nranges;
font->ranges = 0;
if(font->nranges) {
font->ranges = malloc(vals->nranges*sizeof(fsRange));
- if(font->ranges == NULL)
+ if(font->ranges == NULL)
return AllocError;
memcpy((char*)font->ranges, (char*)vals->ranges,
vals->nranges*sizeof(fsRange));
@@ -2823,7 +2820,7 @@ FreeTypeLoadFont(FTFontPtr font, FontInf
if(info) {
firstCode = 0;
lastCode = 0xFFFFL;
- if(!font->mapping.mapping ||
+ if(!font->mapping.mapping ||
font->mapping.mapping->encoding->row_size == 0) {
/* linear indexing */
lastCode=MIN(lastCode,
@@ -2844,7 +2841,7 @@ FreeTypeLoadFont(FTFontPtr font, FontInf
info->lastRow = MIN(font->mapping.mapping->encoding->size-1,
lastCode/0x100);
info->firstCol = font->mapping.mapping->encoding->first_col;
- info->lastCol = MIN(font->mapping.mapping->encoding->row_size-1,
+ info->lastCol = MIN(font->mapping.mapping->encoding->row_size-1,
lastCode<0x100?lastCode:0xFF);
if( info->firstRow == 0 && info->firstCol == 0 ) zero_code=0;
}
@@ -2871,7 +2868,7 @@ FreeTypeLoadFont(FTFontPtr font, FontInf
font->zero_idx = 0;
}
else
- font->zero_idx = FTRemap(face->face,
+ font->zero_idx = FTRemap(face->face,
&font->mapping, zero_code);
post = FT_Get_Sfnt_Table(face->face, ft_sfnt_post);
@@ -2957,7 +2954,7 @@ ft_compute_bounds(FTFontPtr font, FontIn
for (row = pinfo->firstRow; row <= pinfo->lastRow; row++) {
if ( skip_ok && tmpchar ) {
if ( !force_c_outside ) {
- if ( instance->ttcap.forceConstantSpacingBegin < row<<8
+ if ( instance->ttcap.forceConstantSpacingBegin < row<<8
&& row<<8 < (instance->ttcap.forceConstantSpacingEnd & 0x0ff00) ) {
if (tmpchar->characterWidth) {
num_chars += num_cols;
@@ -2969,7 +2966,7 @@ ft_compute_bounds(FTFontPtr font, FontIn
else skip_ok=0;
}
else { /* for GB18030 proportional */
- if ( instance->ttcap.forceConstantSpacingBegin < row<<8
+ if ( instance->ttcap.forceConstantSpacingBegin < row<<8
|| row<<8 < (instance->ttcap.forceConstantSpacingEnd & 0x0ff00) ) {
if (tmpchar->characterWidth) {
num_chars += num_cols;
@@ -2985,12 +2982,12 @@ ft_compute_bounds(FTFontPtr font, FontIn
c = row<<8|col;
flags=0;
if ( !force_c_outside ) {
- if ( c <= instance->ttcap.forceConstantSpacingEnd
+ if ( c <= instance->ttcap.forceConstantSpacingEnd
&& instance->ttcap.forceConstantSpacingBegin <= c )
flags|=FT_FORCE_CONSTANT_SPACING;
}
else { /* for GB18030 proportional */
- if ( c <= instance->ttcap.forceConstantSpacingEnd
+ if ( c <= instance->ttcap.forceConstantSpacingEnd
|| instance->ttcap.forceConstantSpacingBegin <= c )
flags|=FT_FORCE_CONSTANT_SPACING;
}
@@ -3010,13 +3007,13 @@ ft_compute_bounds(FTFontPtr font, FontIn
overlap = tmpchar->rightSideBearing - tmpchar->characterWidth;
if (maxOverlap < overlap)
maxOverlap = overlap;
-
+
if (!tmpchar->characterWidth)
continue;
num_chars++;
swidth += ABS(tmpchar->characterWidth);
total_width += tmpchar->characterWidth;
-
+
if ( flags & FT_FORCE_CONSTANT_SPACING ) skip_ok=1;
}
}
@@ -3110,7 +3107,7 @@ is_matrix_unit(FontScalablePtr vals)
m.yx = vals->point_matrix[1] / base_size * 65536;
m.yy = vals->point_matrix[3] / base_size * 65536;
- return (m.xx == 65536) && (m.yx == 0) &&
+ return (m.xx == 65536) && (m.yx == 0) &&
(m.xy == 0) && (m.yy == 65536);
}
@@ -3118,7 +3115,7 @@ is_matrix_unit(FontScalablePtr vals)
/* xf->info is only accessed through info, and xf might be null */
static int
-FreeTypeLoadXFont(char *fileName,
+FreeTypeLoadXFont(char *fileName,
FontScalablePtr vals, FontPtr xf, FontInfoPtr info,
FontBitmapFormatPtr bmfmt, FontEntryPtr entry)
{
@@ -3146,9 +3143,9 @@ FreeTypeLoadXFont(char *fileName,
goto quit;
}
- xrc = FreeTypeSetUpTTCap(fileName, vals,
+ xrc = FreeTypeSetUpTTCap(fileName, vals,
&dynStrRealFileName, &dynStrFTFileName,
- &tmp_ttcap, &face_number,
+ &tmp_ttcap, &face_number,
&load_flags, &ttcap_spacing,
&font_properties, &dynStrTTCapCodeRange);
if ( xrc != Successful ) {
@@ -3190,7 +3187,7 @@ FreeTypeLoadXFont(char *fileName,
}
xrc = FreeTypeLoadFont(font, info, face, dynStrFTFileName, vals, entry, bmfmt,
- load_flags, &tmp_ttcap, dynStrTTCapCodeRange,
+ load_flags, &tmp_ttcap, dynStrTTCapCodeRange,
ttcap_spacing );
if(xrc != Successful) {
goto quit;
@@ -3261,9 +3258,9 @@ FreeTypeLoadXFont(char *fileName,
width_x = max_advance_height * ins_ttcap->scaleBBoxHeight * unit_y;
}
else{
- unit_x = fabs(vals->pixel_matrix[0] -
+ unit_x = fabs(vals->pixel_matrix[0] -
vals->pixel_matrix[1]*vals->pixel_matrix[2]/vals->pixel_matrix[3]);
- unit_y = fabs(vals->pixel_matrix[2] -
+ unit_y = fabs(vals->pixel_matrix[2] -
vals->pixel_matrix[3]*vals->pixel_matrix[0]/vals->pixel_matrix[1]);
width_x = face->face->max_advance_width * ins_ttcap->scaleBBoxWidth * unit_x;
width_y = max_advance_height * ins_ttcap->scaleBBoxHeight * unit_y;
@@ -3349,7 +3346,7 @@ FreeTypeLoadXFont(char *fileName,
force_c_rsb += ins_ttcap->force_c_adjust_rsb_by_pixel;
force_c_lsb += ins_ttcap->force_c_adjust_lsb_by_pixel;
/* apply to rawWidth */
- averageWidth = (int)floor(10 * width_x * scale
+ averageWidth = (int)floor(10 * width_x * scale
* ratio + 0.5);
rawWidth = floor(width_x * scale
* ratio * 1000. / base_height + 0.5);
@@ -3508,7 +3505,7 @@ FreeTypeLoadXFont(char *fileName,
instance->forceConstantMetrics->attributes = force_c_rawWidth;
}
/* Check code 0 */
- if( FreeTypeInstanceGetGlyph(font->zero_idx, FT_FORCE_CONSTANT_SPACING,
+ if( FreeTypeInstanceGetGlyph(font->zero_idx, FT_FORCE_CONSTANT_SPACING,
&tmpglyph, font->instance) != Successful
|| tmpglyph == NULL)
if( FreeTypeInstanceGetGlyph(font->zero_idx, FT_FORCE_CONSTANT_SPACING | FT_GET_DUMMY,
@@ -3544,10 +3541,10 @@ FreeTypeLoadXFont(char *fileName,
if( !charcell ) { /* NOT CHARCELL */
if( info ){
- /*
+ /*
Calculate all glyphs' metrics.
maxbounds.ascent and maxbounds.descent are quite important values
- for XAA. If ascent/descent of each glyph exceeds
+ for XAA. If ascent/descent of each glyph exceeds
maxbounds.ascent/maxbounds.descent, XAA causes SERVER CRASH.
Therefore, THIS MUST BE DONE.
*/
@@ -3561,7 +3558,7 @@ FreeTypeLoadXFont(char *fileName,
*/
vals->width = averageWidth;
-
+
if( info ){
info->maxbounds.leftSideBearing = minLsb;
@@ -3571,7 +3568,7 @@ FreeTypeLoadXFont(char *fileName,
info->maxbounds.descent = descent;
info->maxbounds.attributes =
(unsigned short)(short)rawWidth;
-
+
info->minbounds = info->maxbounds;
}
}
@@ -3587,12 +3584,12 @@ FreeTypeLoadXFont(char *fileName,
info->fontDescent = info->maxbounds.descent;
/* Glyph metrics are accurate */
info->inkMetrics=1;
-
+
memcpy((char *)&info->ink_maxbounds,
(char *)&info->maxbounds, sizeof(xCharInfo));
memcpy((char *)&info->ink_minbounds,
(char *)&info->minbounds, sizeof(xCharInfo));
-
+
/* XXX - hack */
info->defaultCh=0;
@@ -3610,9 +3607,9 @@ FreeTypeLoadXFont(char *fileName,
if(xf)
xf->fontPrivate = (void*)font;
-
+
if(info) {
- xrc = FreeTypeAddProperties(font, vals, info, entry->name.name,
+ xrc = FreeTypeAddProperties(font, vals, info, entry->name.name,
rawAverageWidth, font_properties);
if (xrc != Successful) {
goto quit;
@@ -3645,7 +3642,7 @@ FreeTypeGetMetrics(FontPtr pFont, unsign
struct TTCapInfo *ttcap;
xCharInfo **mp, *m;
- /* MUMBLE1("Get metrics for %ld characters\n", count);*/
+ /* MUMBLE("Get metrics for %ld characters\n", count);*/
tf = (FTFontPtr)pFont->fontPrivate;
ttcap = &tf->instance->ttcap;
@@ -3653,23 +3650,23 @@ FreeTypeGetMetrics(FontPtr pFont, unsign
while (count-- > 0) {
switch (charEncoding) {
- case Linear8Bit:
+ case Linear8Bit:
case TwoD8Bit:
code = *chars++;
break;
- case Linear16Bit:
+ case Linear16Bit:
case TwoD16Bit:
code = (*chars++ << 8);
code |= *chars++;
/* */
if ( !(ttcap->flags & TTCAP_FORCE_C_OUTSIDE) ) {
- if ( (int)code <= ttcap->forceConstantSpacingEnd
+ if ( (int)code <= ttcap->forceConstantSpacingEnd
&& ttcap->forceConstantSpacingBegin <= (int)code )
flags|=FT_FORCE_CONSTANT_SPACING;
else flags=0;
}
else { /* for GB18030 proportional */
- if ( (int)code <= ttcap->forceConstantSpacingEnd
+ if ( (int)code <= ttcap->forceConstantSpacingEnd
|| ttcap->forceConstantSpacingBegin <= (int)code )
flags|=FT_FORCE_CONSTANT_SPACING;
else flags=0;
@@ -3684,7 +3681,7 @@ FreeTypeGetMetrics(FontPtr pFont, unsign
else *mp++ = &noSuchChar.metrics;
#endif
}
-
+
*metricCount = mp - metrics;
return Successful;
}
@@ -3711,24 +3708,24 @@ FreeTypeGetGlyphs(FontPtr pFont, unsigne
code = *chars++;
break;
case Linear16Bit: case TwoD16Bit:
- code = *chars++ << 8;
+ code = *chars++ << 8;
code |= *chars++;
/* */
if ( !(ttcap->flags & TTCAP_FORCE_C_OUTSIDE) ) {
- if ( (int)code <= ttcap->forceConstantSpacingEnd
+ if ( (int)code <= ttcap->forceConstantSpacingEnd
&& ttcap->forceConstantSpacingBegin <= (int)code )
flags|=FT_FORCE_CONSTANT_SPACING;
else flags=0;
}
else { /* for GB18030 proportional */
- if ( (int)code <= ttcap->forceConstantSpacingEnd
+ if ( (int)code <= ttcap->forceConstantSpacingEnd
|| ttcap->forceConstantSpacingBegin <= (int)code )
flags|=FT_FORCE_CONSTANT_SPACING;
else flags=0;
}
break;
}
-
+
if(FreeTypeFontGetGlyph(code, flags, &g, tf) == Successful && g!=NULL) {
*gp++ = g;
}
@@ -3749,7 +3746,7 @@ FreeTypeGetGlyphs(FontPtr pFont, unsigne
else wd=wd_actual;
if(ht_actual <= 0) ht = 1;
else ht=ht_actual;
- bpr = (((wd + (tf->instance->bmfmt.glyph<<3) - 1) >> 3) &
+ bpr = (((wd + (tf->instance->bmfmt.glyph<<3) - 1) >> 3) &
-tf->instance->bmfmt.glyph);
raster = calloc(1, ht * bpr);
if(raster) {
@@ -3761,13 +3758,13 @@ FreeTypeGetGlyphs(FontPtr pFont, unsigne
}
#endif
}
-
+
*glyphCount = gp - glyphs;
return Successful;
}
static int
-FreeTypeSetUpFont(FontPathElementPtr fpe, FontPtr xf, FontInfoPtr info,
+FreeTypeSetUpFont(FontPathElementPtr fpe, FontPtr xf, FontInfoPtr info,
fsBitmapFormat format, fsBitmapFormatMask fmask,
FontBitmapFormatPtr bmfmt)
{
@@ -3780,7 +3777,7 @@ FreeTypeSetUpFont(FontPathElementPtr fpe
if ((xrc = CheckFSFormat(format, fmask, &bmfmt->bit, &bmfmt->byte,
&bmfmt->scan, &bmfmt->glyph,
&image)) != Successful) {
- MUMBLE1("Aborting after checking FS format: %d\n", xrc);
+ MUMBLE("Aborting after checking FS format: %d\n", xrc);
return xrc;
}
@@ -3829,11 +3826,7 @@ FreeTypeOpenScalable(FontPathElementPtr
FontPtr xf;
FontBitmapFormatRec bmfmt;
- MUMBLE1("Open Scalable %s, XLFD=",fileName);
-#ifdef DEBUG_TRUETYPE
- fwrite(entry->name.name, entry->name.length, 1, stdout);
-#endif
- MUMBLE("\n");
+ MUMBLE("Open Scalable %s, XLFD=%s\n",fileName, entry->name.length ? entry->name.name : "");
xf = CreateFontRec();
if (xf == NULL)
@@ -3846,7 +3839,7 @@ FreeTypeOpenScalable(FontPathElementPtr
}
xrc = FreeTypeLoadXFont(fileName, vals, xf, &xf->info, &bmfmt, entry);
if(xrc != Successful) {
- MUMBLE1("Error during load: %d\n",xrc);
+ MUMBLE("Error during load: %d\n",xrc);
DestroyFontRec(xf);
return xrc;
}
@@ -3866,11 +3859,7 @@ FreeTypeGetInfoScalable(FontPathElementP
int xrc;
FontBitmapFormatRec bmfmt;
- MUMBLE("Get info, XLFD= ");
-#ifdef DEBUG_TRUETYPE
- fwrite(entry->name.name, entry->name.length, 1, stdout);
-#endif
- MUMBLE("\n");
+ MUMBLE("Get info, XLFD=%s\n", entry->name.length ? entry->name.name : "");
xrc = FreeTypeSetUpFont(fpe, 0, info, 0, 0, &bmfmt);
if(xrc != Successful) {
@@ -3881,7 +3870,7 @@ FreeTypeGetInfoScalable(FontPathElementP
xrc = FreeTypeLoadXFont(fileName, vals, 0, info, &bmfmt, entry);
if(xrc != Successful) {
- MUMBLE1("Error during load: %d\n", xrc);
+ MUMBLE("Error during load: %d\n", xrc);
return xrc;
}
@@ -3918,9 +3907,9 @@ static FontRendererRec alt_renderers[] =
FreeTypeGetInfoScalable, 0, CAPABILITIES},
};
-static int num_alt_renderers =
+static int num_alt_renderers =
sizeof(alt_renderers) / sizeof(alt_renderers[0]);
-
+
void
FreeTypeRegisterFontFileFunctions(void)
Index: xsrc/external/mit/libXfont/dist/src/bitmap/pcfread.c
diff -u xsrc/external/mit/libXfont/dist/src/bitmap/pcfread.c:1.2 xsrc/external/mit/libXfont/dist/src/bitmap/pcfread.c:1.3
--- xsrc/external/mit/libXfont/dist/src/bitmap/pcfread.c:1.2 Sat May 19 05:16:27 2012
+++ xsrc/external/mit/libXfont/dist/src/bitmap/pcfread.c Fri May 31 01:18:45 2013
@@ -25,7 +25,6 @@ other dealings in this Software without
from The Open Group.
*/
-/* $XFree86: xc/lib/font/bitmap/pcfread.c,v 1.21 2003/11/17 22:20:22 dawes Exp $ */
/*
* Author: Keith Packard, MIT X Consortium
@@ -57,7 +56,7 @@ pcfError(const char* message, ...)
vfprintf(stderr, message, args);
va_end(args);
}
-
+
/* Read PCF font files */
static void pcfUnloadFont ( FontPtr pFont );
@@ -139,7 +138,8 @@ pcfReadTOC(FontFilePtr file, int *countp
}
tables = malloc(count * sizeof(PCFTableRec));
if (!tables) {
- pcfError("pcfReadTOC(): Couldn't allocate tables (%d*%d)\n", count, sizeof(PCFTableRec));
+ pcfError("pcfReadTOC(): Couldn't allocate tables (%d*%d)\n",
+ count, (int) sizeof(PCFTableRec));
return (PCFTablePtr) NULL;
}
for (i = 0; i < count; i++) {
@@ -198,7 +198,7 @@ pcfGetCompressedMetric(FontFilePtr file,
* in the font file
*/
static Bool
-pcfSeekToType(FontFilePtr file, PCFTablePtr tables, int ntables,
+pcfSeekToType(FontFilePtr file, PCFTablePtr tables, int ntables,
CARD32 type, CARD32 *formatp, CARD32 *sizep)
{
int i;
@@ -229,14 +229,14 @@ pcfHasType (PCFTablePtr tables, int ntab
}
/*
- * pcfGetProperties
+ * pcfGetProperties
*
* Reads the font properties from the font file, filling in the FontInfo rec
* supplied. Used by by both ReadFont and ReadFontInfo routines.
*/
static Bool
-pcfGetProperties(FontInfoPtr pFontInfo, FontFilePtr file,
+pcfGetProperties(FontInfoPtr pFontInfo, FontFilePtr file,
PCFTablePtr tables, int ntables)
{
FontPropPtr props = 0;
@@ -263,22 +263,24 @@ pcfGetProperties(FontInfoPtr pFontInfo,
if (IS_EOF(file)) goto Bail;
props = malloc(nprops * sizeof(FontPropRec));
if (!props) {
- pcfError("pcfGetProperties(): Couldn't allocate props (%d*%d)\n", nprops, sizeof(FontPropRec));
+ pcfError("pcfGetProperties(): Couldn't allocate props (%d*%d)\n",
+ nprops, (int) sizeof(FontPropRec));
goto Bail;
}
isStringProp = malloc(nprops * sizeof(char));
if (!isStringProp) {
- pcfError("pcfGetProperties(): Couldn't allocate isStringProp (%d*%d)\n", nprops, sizeof(char));
+ pcfError("pcfGetProperties(): Couldn't allocate isStringProp (%d*%d)\n",
+ nprops, (int) sizeof(char));
goto Bail;
}
for (i = 0; i < nprops; i++) {
props[i].name = pcfGetINT32(file, format);
isStringProp[i] = pcfGetINT8(file, format);
props[i].value = pcfGetINT32(file, format);
- if (props[i].name < 0
+ if (props[i].name < 0
|| (isStringProp[i] != 0 && isStringProp[i] != 1)
|| (isStringProp[i] && props[i].value < 0)) {
- pcfError("pcfGetProperties(): invalid file format %d %d %d\n",
+ pcfError("pcfGetProperties(): invalid file format %ld %d %ld\n",
props[i].name, isStringProp[i], props[i].value);
goto Bail;
}
@@ -335,7 +337,7 @@ Bail:
*/
static Bool
-pcfGetAccel(FontInfoPtr pFontInfo, FontFilePtr file,
+pcfGetAccel(FontInfoPtr pFontInfo, FontFilePtr file,
PCFTablePtr tables, int ntables, CARD32 type)
{
CARD32 format;
@@ -346,7 +348,7 @@ pcfGetAccel(FontInfoPtr pFontInfo, FontF
goto Bail;
format = pcfGetLSB32(file);
if (!PCF_FORMAT_MATCH(format, PCF_DEFAULT_FORMAT) &&
- !PCF_FORMAT_MATCH(format, PCF_ACCEL_W_INKBOUNDS))
+ !PCF_FORMAT_MATCH(format, PCF_ACCEL_W_INKBOUNDS))
{
goto Bail;
}
@@ -383,7 +385,7 @@ Bail:
}
int
-pcfReadFont(FontPtr pFont, FontFilePtr file,
+pcfReadFont(FontPtr pFont, FontFilePtr file,
int bit, int byte, int glyph, int scan)
{
CARD32 format;
@@ -446,7 +448,8 @@ pcfReadFont(FontPtr pFont, FontFilePtr f
}
metrics = malloc(nmetrics * sizeof(CharInfoRec));
if (!metrics) {
- pcfError("pcfReadFont(): Couldn't allocate metrics (%d*%d)\n", nmetrics, sizeof(CharInfoRec));
+ pcfError("pcfReadFont(): Couldn't allocate metrics (%d*%d)\n",
+ nmetrics, (int) sizeof(CharInfoRec));
goto Bail;
}
for (i = 0; i < nmetrics; i++)
@@ -457,7 +460,7 @@ pcfReadFont(FontPtr pFont, FontFilePtr f
if (!pcfGetCompressedMetric(file, format, &(metrics + i)->metrics))
goto Bail;
}
-
+
/* bitmaps */
if (!pcfSeekToType(file, tables, ntables, PCF_BITMAPS, &format, &size))
@@ -472,7 +475,8 @@ pcfReadFont(FontPtr pFont, FontFilePtr f
/* nmetrics is already ok, so nbitmap also is */
offsets = malloc(nbitmaps * sizeof(CARD32));
if (!offsets) {
- pcfError("pcfReadFont(): Couldn't allocate offsets (%d*%d)\n", nbitmaps, sizeof(CARD32));
+ pcfError("pcfReadFont(): Couldn't allocate offsets (%d*%d)\n",
+ nbitmaps, (int) sizeof(CARD32));
goto Bail;
}
for (i = 0; i < nbitmaps; i++) {
@@ -485,7 +489,7 @@ pcfReadFont(FontPtr pFont, FontFilePtr f
if (IS_EOF(file)) goto Bail;
if (bitmapSizes[i] < 0) goto Bail;
}
-
+
sizebitmaps = bitmapSizes[PCF_GLYPH_PAD_INDEX(format)];
/* guard against completely empty font */
bitmaps = malloc(sizebitmaps ? sizebitmaps : 1);
@@ -561,10 +565,11 @@ pcfReadFont(FontPtr pFont, FontFilePtr f
goto Bail;
/* nmetrics already checked */
ink_metrics = malloc(nink_metrics * sizeof(xCharInfo));
- if (!ink_metrics) {
- pcfError("pcfReadFont(): Couldn't allocate ink_metrics (%d*%d)\n", nink_metrics, sizeof(xCharInfo));
+ if (!ink_metrics) {
+ pcfError("pcfReadFont(): Couldn't allocate ink_metrics (%d*%d)\n",
+ nink_metrics, (int) sizeof(xCharInfo));
goto Bail;
- }
+ }
for (i = 0; i < nink_metrics; i++)
if (PCF_FORMAT_MATCH(format, PCF_DEFAULT_FORMAT)) {
if (!pcfGetMetric(file, format, ink_metrics + i))
@@ -598,10 +603,11 @@ pcfReadFont(FontPtr pFont, FontFilePtr f
encoding = calloc(NUM_SEGMENTS(nencoding), sizeof(CharInfoPtr*));
if (!encoding) {
- pcfError("pcfReadFont(): Couldn't allocate encoding (%d*%d)\n", nencoding, sizeof(CharInfoPtr));
+ pcfError("pcfReadFont(): Couldn't allocate encoding (%d*%d)\n",
+ nencoding, (int) sizeof(CharInfoPtr));
goto Bail;
}
-
+
pFont->info.allExist = TRUE;
for (i = 0; i < nencoding; i++) {
encodingOffset = pcfGetINT16(file, format);
@@ -627,7 +633,8 @@ pcfReadFont(FontPtr pFont, FontFilePtr f
bitmapFont = malloc(sizeof *bitmapFont);
if (!bitmapFont) {
- pcfError("pcfReadFont(): Couldn't allocate bitmapFont (%d)\n", sizeof *bitmapFont);
+ pcfError("pcfReadFont(): Couldn't allocate bitmapFont (%d)\n",
+ (int) sizeof *bitmapFont);
goto Bail;
}
Index: xsrc/external/mit/libXfont/dist/src/fontfile/bunzip2.c
diff -u xsrc/external/mit/libXfont/dist/src/fontfile/bunzip2.c:1.3 xsrc/external/mit/libXfont/dist/src/fontfile/bunzip2.c:1.4
--- xsrc/external/mit/libXfont/dist/src/fontfile/bunzip2.c:1.3 Sat Aug 14 10:50:32 2010
+++ xsrc/external/mit/libXfont/dist/src/fontfile/bunzip2.c Fri May 31 01:18:45 2013
@@ -3,7 +3,7 @@
intended for inclusion in X11 public releases. */
/*
- * Copyright © 2008 Sun Microsystems, Inc. All rights reserved.
+ * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -78,7 +78,7 @@ BufFilePushBZIP2 (BufFilePtr f)
BufBzip2FileClose);
}
-static int
+static int
BufBzip2FileClose(BufFilePtr f, int flag)
{
xzip_buf *x = (xzip_buf *)f->private;
@@ -88,15 +88,15 @@ BufBzip2FileClose(BufFilePtr f, int flag
return 1;
}
-/* here's the real work.
+/* here's the real work.
-- we need to put stuff in f.buffer, update f.left and f.bufp,
then return the first byte (or BUFFILEEOF).
- -- to do this, we need to get stuff into avail_in, and next_in,
+ -- to do this, we need to get stuff into avail_in, and next_in,
and call BZ2_bzDecompress appropriately.
-- we may also need to add CRC maintenance - if BZ2_bzDecompress tells us
BZ_STREAM_END, we then have 4bytes CRC and 4bytes length...
*/
-static int
+static int
BufBzip2FileFill (BufFilePtr f)
{
xzip_buf *x = (xzip_buf *)f->private;
@@ -150,7 +150,7 @@ BufBzip2FileFill (BufFilePtr f)
}
}
f->bufp = x->b;
- f->left = BUFFILESIZE - x->z.avail_out;
+ f->left = BUFFILESIZE - x->z.avail_out;
if (f->left >= 0) {
f->left--;
@@ -161,7 +161,7 @@ BufBzip2FileFill (BufFilePtr f)
}
/* there should be a BufCommonSkip... */
-static int
+static int
BufBzip2FileSkip (BufFilePtr f, int c)
{
/* BufFileRawSkip returns the count unchanged.
Index: xsrc/external/mit/libXfont/dist/src/fontfile/decompress.c
diff -u xsrc/external/mit/libXfont/dist/src/fontfile/decompress.c:1.3 xsrc/external/mit/libXfont/dist/src/fontfile/decompress.c:1.4
--- xsrc/external/mit/libXfont/dist/src/fontfile/decompress.c:1.3 Tue Aug 16 13:57:30 2011
+++ xsrc/external/mit/libXfont/dist/src/fontfile/decompress.c Fri May 31 01:18:45 2013
@@ -1,4 +1,3 @@
-/* $Xorg: decompress.c,v 1.4 2001/02/09 02:04:03 xorgcvs Exp $ */
/*
* Copyright 1985, 1986 The Regents of the University of California.
* All rights reserved.
@@ -45,8 +44,7 @@ used in advertising or otherwise to prom
in this Software without prior written authorization from The Open Group.
*/
-/* $XFree86: xc/lib/font/fontfile/decompress.c,v 1.4 2001/01/17 19:43:29 dawes Exp $ */
-/*
+/*
* decompress - cat a compressed file
*/
@@ -95,7 +93,7 @@ static char_type magic_header[] = { "\03
/*
* the next two codes should not be changed lightly, as they must not
* lie within the contiguous general code space.
- */
+ */
#define FIRST 257 /* first free entry */
#define CLEAR 256 /* table clear output code */
@@ -126,14 +124,6 @@ typedef struct _compressedFILE {
} CompressedFile;
-static int hsize_table[] = {
- 5003, /* 12 bits - 80% occupancy */
- 9001, /* 13 bits - 91% occupancy */
- 18013, /* 14 bits - 91% occupancy */
- 35023, /* 15 bits - 94% occupancy */
- 69001 /* 16 bits - 95% occupancy */
-};
-
static int BufCompressedClose ( BufFilePtr f, int doClose );
static int BufCompressedFill ( BufFilePtr f );
static code_int getcode ( CompressedFile *file );
@@ -144,7 +134,6 @@ BufFilePushCompressed (BufFilePtr f)
{
int code;
int maxbits;
- int hsize;
CompressedFile *file;
int extra;
@@ -155,13 +144,12 @@ BufFilePushCompressed (BufFilePtr f)
}
code = BufFileGet (f);
if (code == BUFFILEEOF) return 0;
-
+
maxbits = code & BIT_MASK;
- if (maxbits > BITS || maxbits < 12)
+ if (maxbits > BITS || maxbits <= INIT_BITS)
return 0;
- hsize = hsize_table[maxbits - 12];
extra = (1 << maxbits) * sizeof (char_type) +
- hsize * sizeof (unsigned short);
+ (1 << maxbits) * sizeof (unsigned short);
file = malloc (sizeof (CompressedFile) + extra);
if (!file)
return 0;
@@ -233,7 +221,7 @@ BufCompressedFill (BufFilePtr f)
code = getcode (file);
if (code == -1)
break;
-
+
if ( (code == CLEAR) && file->block_compress ) {
for ( code = 255; code >= 0; code-- )
file->tab_prefix[code] = 0;
@@ -271,7 +259,7 @@ BufCompressedFill (BufFilePtr f)
}
finchar = file->tab_suffix[code];
*stackp++ = finchar;
-
+
/*
* Generate the new entry.
*/
@@ -279,7 +267,7 @@ BufCompressedFill (BufFilePtr f)
file->tab_prefix[code] = (unsigned short)oldcode;
file->tab_suffix[code] = finchar;
file->free_ent = code+1;
- }
+ }
/*
* Remember previous code.
*/
@@ -387,7 +375,7 @@ static int
BufCompressedSkip (BufFilePtr f, int bytes)
{
int c;
- while (bytes--)
+ while (bytes--)
{
c = BufFileGet(f);
if (c == BUFFILEEOF)
@@ -402,7 +390,7 @@ main (int argc, char *argv[])
{
BufFilePtr inputraw, input, output;
int c;
-
+
inputraw = BufFileOpenRead (0);
input = BufFilePushCompressed (inputraw);
output = BufFileOpenWrite (1);