* src/bdf/bdfdrivr.h (BDF_FaceRec): New element `default_glyph'.
* src/bdf/bdflib.c (_bdf_add_property, _bdf_parse_start), src/bdf/bdf.h (bdf_font_t): s/default_glyph/default_char/. * src/bdf/bdfdrivr.c (BDF_Face_Init): Fix number of glyphs. Set `default_glyph'. (BDF_Glyph_Load): Use `default_glyph' for undefined glyph. * docs/CHANGES: Updated.
This commit is contained in:
parent
83efe779e3
commit
8ef4183690
11
ChangeLog
11
ChangeLog
|
@ -7,6 +7,17 @@
|
||||||
* src/pcf/pcfdrivr.c (FT_COMPOMENT): Move up.
|
* src/pcf/pcfdrivr.c (FT_COMPOMENT): Move up.
|
||||||
(PCF_Face_Init): Simplify code.
|
(PCF_Face_Init): Simplify code.
|
||||||
|
|
||||||
|
* src/bdf/bdfdrivr.h (BDF_FaceRec): New element `default_glyph'.
|
||||||
|
|
||||||
|
* src/bdf/bdflib.c (_bdf_add_property, _bdf_parse_start),
|
||||||
|
src/bdf/bdf.h (bdf_font_t): s/default_glyph/default_char/.
|
||||||
|
|
||||||
|
* src/bdf/bdfdrivr.c (BDF_Face_Init): Fix number of glyphs.
|
||||||
|
Set `default_glyph'.
|
||||||
|
(BDF_Glyph_Load): Use `default_glyph' for undefined glyph.
|
||||||
|
|
||||||
|
* docs/CHANGES: Updated.
|
||||||
|
|
||||||
2004-06-21 Werner Lemberg <wl@gnu.org>
|
2004-06-21 Werner Lemberg <wl@gnu.org>
|
||||||
|
|
||||||
* docs/CHANGES: Updated.
|
* docs/CHANGES: Updated.
|
||||||
|
|
|
@ -9,7 +9,7 @@ LATEST CHANGES BETWEEN 2.1.9 and 2.1.8
|
||||||
cmap caches.)
|
cmap caches.)
|
||||||
|
|
||||||
- `FT_Outline_Get_BBox' sometimes returned incorrect values for
|
- `FT_Outline_Get_BBox' sometimes returned incorrect values for
|
||||||
conic outlines (e.g. for TrueType fonts).
|
conic outlines (e.g., for TrueType fonts).
|
||||||
|
|
||||||
- Handling of `bhed' table has been fixed.
|
- Handling of `bhed' table has been fixed.
|
||||||
|
|
||||||
|
@ -17,6 +17,11 @@ LATEST CHANGES BETWEEN 2.1.9 and 2.1.8
|
||||||
returned artifacts due to incorrect rounding. This bug has been
|
returned artifacts due to incorrect rounding. This bug has been
|
||||||
introduced after version 2.1.4.
|
introduced after version 2.1.4.
|
||||||
|
|
||||||
|
- The BDF driver dropped the last glyph in the font.
|
||||||
|
|
||||||
|
- The BDF driver now uses the DEFAULT_CHAR property (if available)
|
||||||
|
to select a glyph shape for the undefined glyph.
|
||||||
|
|
||||||
|
|
||||||
II. IMPORTANT CHANGES
|
II. IMPORTANT CHANGES
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2000 Computing Research Labs, New Mexico State University
|
* Copyright 2000 Computing Research Labs, New Mexico State University
|
||||||
* Copyright 2001, 2002, 2003 Francesco Zappa Nardelli
|
* Copyright 2001, 2002, 2003, 2004 Francesco Zappa Nardelli
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
* copy of this software and associated documentation files (the "Software"),
|
* copy of this software and associated documentation files (the "Software"),
|
||||||
|
@ -202,7 +202,7 @@ FT_BEGIN_HEADER
|
||||||
|
|
||||||
unsigned short monowidth; /* Logical width for monowidth font. */
|
unsigned short monowidth; /* Logical width for monowidth font. */
|
||||||
|
|
||||||
long default_glyph; /* Encoding of the default glyph. */
|
long default_char; /* Encoding of the default glyph. */
|
||||||
|
|
||||||
long font_ascent; /* Font ascent. */
|
long font_ascent; /* Font ascent. */
|
||||||
long font_descent; /* Font descent. */
|
long font_descent; /* Font descent. */
|
||||||
|
|
|
@ -109,6 +109,8 @@ THE SOFTWARE.
|
||||||
|
|
||||||
if ( charcode == code )
|
if ( charcode == code )
|
||||||
{
|
{
|
||||||
|
/* increase glyph index by 1 -- */
|
||||||
|
/* we reserve slot 0 for the undefined glyph */
|
||||||
result = encodings[mid].glyph + 1;
|
result = encodings[mid].glyph + 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -147,6 +149,8 @@ THE SOFTWARE.
|
||||||
|
|
||||||
if ( charcode == code )
|
if ( charcode == code )
|
||||||
{
|
{
|
||||||
|
/* increase glyph index by 1 -- */
|
||||||
|
/* we reserve slot 0 for the undefined glyph */
|
||||||
result = encodings[mid].glyph + 1;
|
result = encodings[mid].glyph + 1;
|
||||||
goto Exit;
|
goto Exit;
|
||||||
}
|
}
|
||||||
|
@ -397,7 +401,9 @@ THE SOFTWARE.
|
||||||
if ( ( error = bdf_interpret_style( face ) ) != 0 )
|
if ( ( error = bdf_interpret_style( face ) ) != 0 )
|
||||||
goto Exit;
|
goto Exit;
|
||||||
|
|
||||||
bdfface->num_glyphs = font->glyphs_size; /* unencoded included */
|
/* the number of glyphs (with one slot for the undefined glyph */
|
||||||
|
/* at position 0 and all unencoded glyphs) */
|
||||||
|
bdfface->num_glyphs = font->glyphs_size + 1;
|
||||||
|
|
||||||
bdfface->num_fixed_sizes = 1;
|
bdfface->num_fixed_sizes = 1;
|
||||||
if ( FT_NEW_ARRAY( bdfface->available_sizes, 1 ) )
|
if ( FT_NEW_ARRAY( bdfface->available_sizes, 1 ) )
|
||||||
|
@ -457,11 +463,15 @@ THE SOFTWARE.
|
||||||
if ( FT_NEW_ARRAY( face->en_table, font->glyphs_size ) )
|
if ( FT_NEW_ARRAY( face->en_table, font->glyphs_size ) )
|
||||||
goto Exit;
|
goto Exit;
|
||||||
|
|
||||||
|
face->default_glyph = 0;
|
||||||
for ( n = 0; n < font->glyphs_size; n++ )
|
for ( n = 0; n < font->glyphs_size; n++ )
|
||||||
{
|
{
|
||||||
(face->en_table[n]).enc = cur[n].encoding;
|
(face->en_table[n]).enc = cur[n].encoding;
|
||||||
FT_TRACE4(( "idx %d, val 0x%lX\n", n, cur[n].encoding ));
|
FT_TRACE4(( "idx %d, val 0x%lX\n", n, cur[n].encoding ));
|
||||||
(face->en_table[n]).glyph = (FT_Short)n;
|
(face->en_table[n]).glyph = (FT_Short)n;
|
||||||
|
|
||||||
|
if ( cur[n].encoding == font->default_char )
|
||||||
|
face->default_glyph = n;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -556,7 +566,7 @@ THE SOFTWARE.
|
||||||
bdfface->charmap = bdfface->charmaps[0];
|
bdfface->charmap = bdfface->charmaps[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Exit:
|
Exit:
|
||||||
return error;
|
return error;
|
||||||
|
@ -636,7 +646,10 @@ THE SOFTWARE.
|
||||||
goto Exit;
|
goto Exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( glyph_index > 0 )
|
/* index 0 is the undefined glyph */
|
||||||
|
if ( glyph_index == 0 )
|
||||||
|
glyph_index = face->default_glyph;
|
||||||
|
else
|
||||||
glyph_index--;
|
glyph_index--;
|
||||||
|
|
||||||
/* slot, bitmap => freetype, glyph => bdflib */
|
/* slot, bitmap => freetype, glyph => bdflib */
|
||||||
|
@ -813,6 +826,7 @@ THE SOFTWARE.
|
||||||
return BDF_Err_Invalid_Argument;
|
return BDF_Err_Invalid_Argument;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static FT_Error
|
static FT_Error
|
||||||
bdf_get_charset_id( BDF_Face face,
|
bdf_get_charset_id( BDF_Face face,
|
||||||
const char* *acharset_encoding,
|
const char* *acharset_encoding,
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
FreeType font driver for bdf fonts
|
FreeType font driver for bdf fonts
|
||||||
|
|
||||||
Copyright (C) 2001, 2002, 2003 by
|
Copyright (C) 2001, 2002, 2003, 2004 by
|
||||||
Francesco Zappa Nardelli
|
Francesco Zappa Nardelli
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
@ -59,6 +59,8 @@ FT_BEGIN_HEADER
|
||||||
FT_CharMap charmap_handle;
|
FT_CharMap charmap_handle;
|
||||||
FT_CharMapRec charmap; /* a single charmap per face */
|
FT_CharMapRec charmap; /* a single charmap per face */
|
||||||
|
|
||||||
|
FT_UInt default_glyph;
|
||||||
|
|
||||||
} BDF_FaceRec, *BDF_Face;
|
} BDF_FaceRec, *BDF_Face;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1404,7 +1404,7 @@
|
||||||
/* present, and the SPACING property should override the default */
|
/* present, and the SPACING property should override the default */
|
||||||
/* spacing. */
|
/* spacing. */
|
||||||
if ( ft_memcmp( name, "DEFAULT_CHAR", 12 ) == 0 )
|
if ( ft_memcmp( name, "DEFAULT_CHAR", 12 ) == 0 )
|
||||||
font->default_glyph = fp->value.int32;
|
font->default_char = fp->value.int32;
|
||||||
else if ( ft_memcmp( name, "FONT_ASCENT", 11 ) == 0 )
|
else if ( ft_memcmp( name, "FONT_ASCENT", 11 ) == 0 )
|
||||||
font->font_ascent = fp->value.int32;
|
font->font_ascent = fp->value.int32;
|
||||||
else if ( ft_memcmp( name, "FONT_DESCENT", 12 ) == 0 )
|
else if ( ft_memcmp( name, "FONT_DESCENT", 12 ) == 0 )
|
||||||
|
@ -2048,8 +2048,8 @@
|
||||||
error = hash_init( (hashtable *)p->font->internal,memory );
|
error = hash_init( (hashtable *)p->font->internal,memory );
|
||||||
if ( error )
|
if ( error )
|
||||||
goto Exit;
|
goto Exit;
|
||||||
p->font->spacing = p->opts->font_spacing;
|
p->font->spacing = p->opts->font_spacing;
|
||||||
p->font->default_glyph = -1;
|
p->font->default_char = -1;
|
||||||
|
|
||||||
goto Exit;
|
goto Exit;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue