diff options
author | David Turner <david@freetype.org> | 2004-04-21 14:30:37 +0000 |
---|---|---|
committer | David Turner <david@freetype.org> | 2004-04-21 14:30:37 +0000 |
commit | 10bf05a31d63c6674fd057514d1066d1f081f4aa (patch) | |
tree | 06f6a0a5782e44168321134365d66510bbd9c809 /src/cff | |
parent | c78df1ef6ead341ee753f1d3239f71f101292cff (diff) | |
download | freetype2-10bf05a31d63c6674fd057514d1066d1f081f4aa.tar.gz |
* src/cff/cffobjs.c (cff_face_init): fixed a small memory leakVER-2-1-8
* src/autofit/afloader.c, src/autofit/afmodule.c, src/base/ftdebug.c:
removed compiler warnings
* src/autofit/aftypes.h, src/lzw/zopen.c, src/pcf/pcfdrivr.c,
src/pcf/pcfread.c, src/psaux/psobjs.c, src/type42/t42drivr.c:
changed data arrays to "const" to avoid populating the ".data"
segment
Diffstat (limited to 'src/cff')
-rw-r--r-- | src/cff/cffobjs.c | 53 |
1 files changed, 35 insertions, 18 deletions
diff --git a/src/cff/cffobjs.c b/src/cff/cffobjs.c index 5e9e70a77..bbe1654ee 100644 --- a/src/cff/cffobjs.c +++ b/src/cff/cffobjs.c @@ -73,7 +73,7 @@ sbit_metrics = &size->strike_metrics; - error = sfnt->set_sbit_strike( face, + error = sfnt->set_sbit_strike( face, metrics->x_ppem, metrics->y_ppem, &strike_index ); @@ -100,7 +100,7 @@ size->strike_index = (FT_UInt)strike_index; } else - { + { size->strike_index = 0xFFFFU; sbit_metrics->x_ppem = 0; @@ -113,7 +113,7 @@ return error; } - + #endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */ @@ -503,33 +503,50 @@ char* fullp = full; char* family = root->family_name; - + /* we're going to try to extract the style name from the + * full name. We need to ignore spaces and dashes during + * the search. + */ if ( full ) { while ( *fullp ) { + /* skip common characters at the start of both strings + */ if ( *fullp == *family ) { family++; fullp++; + continue; } - else + + /* ignore spaces or dashes in full name during comparison + */ + if ( *fullp == ' ' || *fullp == '-' ) + { + fullp++; + continue; + } + /* ignore spaces and dashes in family name during comparison + */ + if ( *family == ' ' || *family == '-' ) + { + family++; + continue; + } + + if ( !*family && *fullp ) { - if ( *fullp == ' ' || *fullp == '-' ) - fullp++; - else if ( *family == ' ' || *family == '-' ) - family++; - else - { - if ( !*family ) - { - style_name = cff_strcpy( memory, fullp ); - FT_FREE( full ); - } - break; - } + /* the full name begins with the same characters than the + * family name, with spaces and dashes removed. In this + * case, the remaining string in "fullp" will be used + * as the style name + */ + style_name = cff_strcpy( memory, fullp ); } + break; } + FT_FREE( full ); } } else |