Репозиторий ALT Linux backports/2.4
Последнее обновление: 9 июля 2008 | Пакетов: 497 | Посещений: 1583452
 поиск   регистрация   авторизация 
 
Группа :: Система/Библиотеки
Пакет: freetype2

 Главная   Изменения   Спек   Патчи   Загрузить   Bugs and FR 

Патч: freetype2-bitmap-foundry.patch


diff -ru freetype-2.1.7/src/pcf/pcfread.c freetype-2.1.7.new/src/pcf/pcfread.c
--- freetype-2.1.7/src/pcf/pcfread.c	2004-03-15 22:47:12.761073165 +0100
+++ freetype-2.1.7.new/src/pcf/pcfread.c	2004-03-15 23:01:16.946185012 +0100
@@ -1046,12 +1046,34 @@
       prop = pcf_find_property( face, "FAMILY_NAME" );
       if ( prop && prop->isString )
       {
-        int  l = ft_strlen( prop->value.atom ) + 1;
-
-
-        if ( FT_NEW_ARRAY( root->family_name, l ) )
-          goto Exit;
-        ft_strcpy( root->family_name, prop->value.atom );
+ 	      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.integer >= point_size_prop->value.integer ) {
+ 			      /* 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;
 
design & coding: Vladimir Lettiev aka crux © 2004-2005