Merge bk://oe-devel@oe-devel.bkbits.net/openembedded/
authorMarcin Juszkiewicz <hrw@openembedded.org>
Thu, 30 Jun 2005 07:40:59 +0000 (07:40 +0000)
committerMarcin Juszkiewicz <hrw@openembedded.org>
Thu, 30 Jun 2005 07:40:59 +0000 (07:40 +0000)
into home.hrw.one.pl:/home/hrw/zaurus/oe/openembedded

2005/06/30 00:35:17+02:00 hrw.one.pl!hrw
opie-ttf-support: removed debug from update-qtttffontdir.c

BKrev: 42c3a20b-6wE3V8X6vjKu39t624idA

packages/opie-ttf-support/files/update-qtttffontdir.c
packages/opie-ttf-support/opie-ttf-support_1.0.0.bb

index e69de29..4c2b0c6 100644 (file)
@@ -0,0 +1,94 @@
+/*
+ * Utility to generate 'fontdir' for Qt/Embedded
+ *
+ * (C) 2004-2005 Marcin Juszkiewicz <openembedded@hrw.one.pl>
+ *
+ * License: GPLv2
+ *
+ * History:
+ * 
+ * v0.1 2004.10.06 - first version (sent to OPIE devel ML)
+ * v0.2 2005.03.12 - added Oblique fonts support
+ * v1.0 2005.06.29 - switched font style handling to not based on filenames
+ * v1.1 2005.06.29 - fixed filename comparing
+ * 
+ */ 
+
+
+#include <ft2build.h>
+#include FT_FREETYPE_H 
+
+#include <stdio.h>
+#include <dirent.h>
+#include <unistd.h>
+
+
+int main(int argc, char* argv[])
+{
+       DIR *katalog;
+       struct dirent *plik;
+
+       FT_Library  library;
+       FT_Face face;
+       
+       if(argc == 1)
+       {
+               fprintf(stderr, "Usage: %s <path to TTF fonts>\n", argv[0]);
+               exit(10);
+       }
+       
+       if(FT_Init_FreeType(&library))
+       {
+               fprintf(stderr, "Error during initialising FreeType library.\n");
+               exit(5);
+       }
+
+       chdir(argv[1]);
+       if((katalog = opendir(".")))
+       {
+               while((plik = readdir(katalog)))
+               {
+                       if(!strstr(plik->d_name, ".ttf"))
+                       {
+                               continue;
+                       }
+
+                       if(!FT_New_Face(library, plik->d_name, 0, &face))
+                       {
+                               /*
+                                *      change spaces in family_name into _
+                                */
+                               
+                               char* ptr;
+
+                               for(ptr = strchr(face->family_name,' '); (ptr = strchr(ptr, ' ')); ) *ptr = '_';
+                               
+                               printf("%s %s/%s FT", face->family_name, argv[1], plik->d_name);
+
+                               if(face->style_flags & FT_STYLE_FLAG_ITALIC)
+                               {
+                                       printf(" y");
+                               }
+                               else
+                               {
+                                       printf(" n");
+                               }
+
+                               if(face->style_flags & FT_STYLE_FLAG_BOLD)
+                               {
+                                       printf(" 75");
+                               }
+                               else
+                               {
+                                       printf(" 50");
+                               }
+                               
+                               printf(" 60 su \n");
+
+                               FT_Done_Face(face);
+                       }
+               }
+       }
+
+       return 0;
+}
index 15b4905..75723f1 100644 (file)
@@ -2,7 +2,7 @@ DESCRIPTION = "Meta-package for Opie TTF support"
 DEPENDS = "freetype opie-freetype"
 RDEPENDS = "opie-freetype"
 SECTION = "opie/fonts"
-PR = "r2"
+PR = "r3"
 
 SRC_URI = "file://update-qtttffontdir.c"
 S = "${WORKDIR}"