From 03e2c13cfe59893605eab3e84dd0a8ec9407b914 Mon Sep 17 00:00:00 2001 From: Marcin Juszkiewicz Date: Thu, 19 Jan 2006 14:11:16 +0000 Subject: opie-ttf-support: updated to 1.1 - this version generate line for 'fixed' font from first fixed width TrueType font - close #441 and #599 --- .../opie-ttf-support/files/update-qtttffontdir.c | 37 ++++++++++++++++++++-- .../opie-ttf-support/opie-ttf-support_1.0.0.bb | 23 -------------- packages/opie-ttf-support/opie-ttf-support_1.1.bb | 22 +++++++++++++ 3 files changed, 57 insertions(+), 25 deletions(-) delete mode 100644 packages/opie-ttf-support/opie-ttf-support_1.0.0.bb create mode 100644 packages/opie-ttf-support/opie-ttf-support_1.1.bb (limited to 'packages/opie-ttf-support') diff --git a/packages/opie-ttf-support/files/update-qtttffontdir.c b/packages/opie-ttf-support/files/update-qtttffontdir.c index 4c2b0c6eff..fa45e38a8b 100644 --- a/packages/opie-ttf-support/files/update-qtttffontdir.c +++ b/packages/opie-ttf-support/files/update-qtttffontdir.c @@ -46,6 +46,8 @@ int main(int argc, char* argv[]) chdir(argv[1]); if((katalog = opendir("."))) { + int found_fixed = 0; + while((plik = readdir(katalog))) { if(!strstr(plik->d_name, ".ttf")) @@ -62,7 +64,38 @@ int main(int argc, char* argv[]) char* ptr; for(ptr = strchr(face->family_name,' '); (ptr = strchr(ptr, ' ')); ) *ptr = '_'; - + + if( + face->face_flags & FT_FACE_FLAG_FIXED_WIDTH && + !found_fixed && + !(face->style_flags & FT_STYLE_FLAG_ITALIC) && + !(face->style_flags & FT_STYLE_FLAG_BOLD) + ) + { + found_fixed = 1; + printf("fixed %s/%s FT", 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"); + } + printf("%s %s/%s FT", face->family_name, argv[1], plik->d_name); if(face->style_flags & FT_STYLE_FLAG_ITALIC) @@ -82,7 +115,7 @@ int main(int argc, char* argv[]) { printf(" 50"); } - + printf(" 60 su \n"); FT_Done_Face(face); diff --git a/packages/opie-ttf-support/opie-ttf-support_1.0.0.bb b/packages/opie-ttf-support/opie-ttf-support_1.0.0.bb deleted file mode 100644 index fa20f212b7..0000000000 --- a/packages/opie-ttf-support/opie-ttf-support_1.0.0.bb +++ /dev/null @@ -1,23 +0,0 @@ -DESCRIPTION = "Meta-package for Opie TTF support" -DEPENDS = "freetype" -SECTION = "opie/fonts" -PR = "r5" - -SRC_URI = "file://update-qtttffontdir.c" -S = "${WORKDIR}" - -do_compile() { - ${CC} ${CFLAGS} ${LDFLAGS} -I${STAGING_INCDIR}/freetype2 -lfreetype -o update-qtttffontdir update-qtttffontdir.c -} - -do_install() { - install -d ${D}${sbindir} - install -m 0755 update-qtttffontdir ${D}${sbindir} -} - -pkg_postinst() { -#!/bin/sh -if [ -n "$D" ]; then exit 1; fi -mkdir -p /opt/QtPalmtop/lib/fonts/ -${sbindir}/update-qtttffontdir ${datadir}/fonts/truetype >/opt/QtPalmtop/lib/fonts/fontdir -} diff --git a/packages/opie-ttf-support/opie-ttf-support_1.1.bb b/packages/opie-ttf-support/opie-ttf-support_1.1.bb new file mode 100644 index 0000000000..f012af4a72 --- /dev/null +++ b/packages/opie-ttf-support/opie-ttf-support_1.1.bb @@ -0,0 +1,22 @@ +DESCRIPTION = "Meta-package for Opie TTF support" +DEPENDS = "freetype" +SECTION = "opie/fonts" + +SRC_URI = "file://update-qtttffontdir.c" +S = "${WORKDIR}" + +do_compile() { + ${CC} ${CFLAGS} ${LDFLAGS} -I${STAGING_INCDIR}/freetype2 -lfreetype -o update-qtttffontdir update-qtttffontdir.c +} + +do_install() { + install -d ${D}${sbindir} + install -m 0755 update-qtttffontdir ${D}${sbindir} +} + +pkg_postinst() { +#!/bin/sh +if [ -n "$D" ]; then exit 1; fi +mkdir -p /opt/QtPalmtop/lib/fonts/ +${sbindir}/update-qtttffontdir ${datadir}/fonts/truetype >/opt/QtPalmtop/lib/fonts/fontdir +} -- cgit v1.2.3