forked from pool/freetype2
33110175ea
- Rediffed patches. - CVE-2012-5668.patch, CVE-2012-5669.patch, CVE-2012-5670.patch nothing to do. OBS-URL: https://build.opensuse.org/request/show/148512 OBS-URL: https://build.opensuse.org/package/show/M17N/freetype2?expand=0&rev=72
50 lines
1.8 KiB
Diff
50 lines
1.8 KiB
Diff
---
|
|
src/pcf/pcfread.c | 30 ++++++++++++++++++++++++++++--
|
|
1 file changed, 28 insertions(+), 2 deletions(-)
|
|
|
|
Index: freetype-2.4.11/src/pcf/pcfread.c
|
|
===================================================================
|
|
--- freetype-2.4.11.orig/src/pcf/pcfread.c
|
|
+++ freetype-2.4.11/src/pcf/pcfread.c
|
|
@@ -1173,12 +1173,38 @@ THE SOFTWARE.
|
|
goto Exit;
|
|
|
|
prop = pcf_find_property( face, "FAMILY_NAME" );
|
|
if ( prop && prop->isString )
|
|
{
|
|
- if ( FT_STRDUP( root->family_name, prop->value.atom ) )
|
|
- goto Exit;
|
|
+ int l = ft_strlen( prop->value.atom ) + 1;
|
|
+ int wide = 0;
|
|
+ PCF_Property foundry_prop = pcf_find_property( face, "FOUNDRY" );
|
|
+ PCF_Property point_size_prop = pcf_find_property( face, "POINT_SIZE" );
|
|
+ PCF_Property average_width_prop = pcf_find_property( face, "AVERAGE_WIDTH" );
|
|
+ if ( point_size_prop != NULL && average_width_prop != NULL) {
|
|
+ if ( average_width_prop->value.l >= point_size_prop->value.l ) {
|
|
+ /* This font is at least square shaped or even wider */
|
|
+ wide = 1;
|
|
+ l += ft_strlen( " Wide");
|
|
+ }
|
|
+ }
|
|
+ if ( foundry_prop != NULL && foundry_prop->isString) {
|
|
+ l += ft_strlen( foundry_prop->value.atom ) + 1;
|
|
+ if ( FT_NEW_ARRAY( root->family_name, l ) )
|
|
+ goto Exit;
|
|
+ ft_strcpy( root->family_name, foundry_prop->value.atom );
|
|
+ strcat( root->family_name, " ");
|
|
+ strcat( root->family_name, prop->value.atom );
|
|
+ }
|
|
+ else {
|
|
+ if ( FT_NEW_ARRAY( root->family_name, l ) )
|
|
+ goto Exit;
|
|
+ ft_strcpy( root->family_name, prop->value.atom );
|
|
+ }
|
|
+ if ( wide != 0) {
|
|
+ strcat( root->family_name, " Wide");
|
|
+ }
|
|
}
|
|
else
|
|
root->family_name = NULL;
|
|
|
|
/*
|