* src/type1/t1tokens.h: Handle `ForceBold' keyword. This fixes

Savannah bug #23995.

* src/cid/cidload.c (parse_expansion_factor): New callback function.
(cid_field_records): Use it for `ExpansionFactor'.
* src/cod/cidtoken.h: Handle `ForceBold' keyword.
Don't handle `ExpansionFactor'.
This commit is contained in:
Werner Lemberg 2008-08-04 18:46:37 +00:00
parent eba3eeecd9
commit 7fd201829a
4 changed files with 44 additions and 6 deletions

View File

@ -1,3 +1,13 @@
2008-08-04 Werner Lemberg <wl@gnu.org>
* src/type1/t1tokens.h: Handle `ForceBold' keyword. This fixes
Savannah bug #23995.
* src/cid/cidload.c (parse_expansion_factor): New callback function.
(cid_field_records): Use it for `ExpansionFactor'.
* src/cod/cidtoken.h: Handle `ForceBold' keyword.
Don't handle `ExpansionFactor'.
2008-08-04 Bram Tassyns <bramt@enfocus.be>
* src/cff/cffparse.c (cff_parse_fixed_scaled): Fix thinko which

View File

@ -234,14 +234,38 @@
}
/* by mistake, `expansion_factor' appears both in PS_PrivateRec */
/* and CID_FaceDictRec (both are public header files and can't */
/* changed); we simply copy the value */
FT_CALLBACK_DEF( FT_Error )
parse_expansion_factor( CID_Face face,
CID_Parser* parser )
{
CID_FaceDict dict;
if ( parser->num_dict >= 0 )
{
dict = face->cid.font_dicts + parser->num_dict;
dict->expansion_factor = cid_parser_to_fixed( parser, 0 );
dict->private_dict.expansion_factor = dict->expansion_factor;
}
return CID_Err_Ok;
}
static
const T1_FieldRec cid_field_records[] =
{
#include "cidtoken.h"
T1_FIELD_CALLBACK( "FDArray", parse_fd_array, 0 )
T1_FIELD_CALLBACK( "FontMatrix", parse_font_matrix, 0 )
T1_FIELD_CALLBACK( "FDArray", parse_fd_array, 0 )
T1_FIELD_CALLBACK( "FontMatrix", parse_font_matrix, 0 )
T1_FIELD_CALLBACK( "ExpansionFactor", parse_expansion_factor, 0 )
{ 0, T1_FIELD_LOCATION_CID_INFO, T1_FIELD_TYPE_NONE, 0, 0, 0, 0, 0, 0 }
};

View File

@ -4,7 +4,7 @@
/* */
/* CID token definitions (specification only). */
/* */
/* Copyright 1996-2001, 2002, 2003, 2006 by */
/* Copyright 1996-2001, 2002, 2003, 2006, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -62,7 +62,6 @@
T1_FIELD_NUM ( "SubrCount", num_subrs, 0 )
T1_FIELD_NUM ( "lenBuildCharArray", len_buildchar, 0 )
T1_FIELD_FIXED( "ForceBoldThreshold", forcebold_threshold, 0 )
T1_FIELD_FIXED( "ExpansionFactor", expansion_factor, 0 )
T1_FIELD_FIXED( "StrokeWidth", stroke_width, 0 )
@ -92,6 +91,9 @@
T1_FIELD_NUM_TABLE ( "StemSnapH", snap_widths, 12, 0 )
T1_FIELD_NUM_TABLE ( "StemSnapV", snap_heights, 12, 0 )
T1_FIELD_BOOL ( "ForceBold", force_bold, 0 )
#undef FT_STRUCTURE
#define FT_STRUCTURE FT_BBox
#undef T1CODE

View File

@ -4,7 +4,7 @@
/* */
/* Type 1 tokenizer (specification). */
/* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2006 by */
/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -87,7 +87,9 @@
T1_FIELD_FIXED ( "ExpansionFactor", expansion_factor,
T1_FIELD_DICT_PRIVATE )
T1_FIELD_BOOL ( "ForceBold", force_bold,
T1_FIELD_DICT_PRIVATE )
#undef FT_STRUCTURE
#define FT_STRUCTURE T1_FontRec