aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/opie-ttf-support
diff options
context:
space:
mode:
authorDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
committerDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
commit709c4d66e0b107ca606941b988bad717c0b45d9b (patch)
tree37ee08b1eb308f3b2b6426d5793545c38396b838 /recipes/opie-ttf-support
parentfa6cd5a3b993f16c27de4ff82b42684516d433ba (diff)
downloadopenembedded-709c4d66e0b107ca606941b988bad717c0b45d9b.tar.gz
openembedded-709c4d66e0b107ca606941b988bad717c0b45d9b.tar.bz2
openembedded-709c4d66e0b107ca606941b988bad717c0b45d9b.zip
rename packages/ to recipes/ per earlier agreement
See links below for more details: http://thread.gmane.org/gmane.comp.handhelds.openembedded/21326 http://thread.gmane.org/gmane.comp.handhelds.openembedded/21816 Signed-off-by: Denys Dmytriyenko <denis@denix.org> Acked-by: Mike Westerhof <mwester@dls.net> Acked-by: Philip Balister <philip@balister.org> Acked-by: Khem Raj <raj.khem@gmail.com> Acked-by: Marcin Juszkiewicz <hrw@openembedded.org> Acked-by: Koen Kooi <koen@openembedded.org> Acked-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Diffstat (limited to 'recipes/opie-ttf-support')
-rw-r--r--recipes/opie-ttf-support/files/02qtttffont-update6
-rw-r--r--recipes/opie-ttf-support/files/fontdir11
-rw-r--r--recipes/opie-ttf-support/files/update-qtttffontdir.c127
-rw-r--r--recipes/opie-ttf-support/opie-ttf-support_1.1.bb26
4 files changed, 170 insertions, 0 deletions
diff --git a/recipes/opie-ttf-support/files/02qtttffont-update b/recipes/opie-ttf-support/files/02qtttffont-update
new file mode 100644
index 0000000000..8f8058faea
--- /dev/null
+++ b/recipes/opie-ttf-support/files/02qtttffont-update
@@ -0,0 +1,6 @@
+#!/bin/sh
+# Author: Rolf Leggewie
+
+mkdir -p @@PALMTOPDIR@@/lib/fonts
+
+@@SBINDIR@@/update-qtttffontdir @@DATADIR@@/fonts/truetype > @@PALMTOPDIR@@/lib/fonts/fontdir
diff --git a/recipes/opie-ttf-support/files/fontdir b/recipes/opie-ttf-support/files/fontdir
new file mode 100644
index 0000000000..e537066891
--- /dev/null
+++ b/recipes/opie-ttf-support/files/fontdir
@@ -0,0 +1,11 @@
+
+DejaVuSans /usr/share/fonts/truetype/DejaVuSans.ttf FT n 50 80 su
+DejaVuSans /usr/share/fonts/truetype/DejaVuSans-Bold.ttf FT n 75 80 su
+DejaVuSans /usr/share/fonts/truetype/DejaVuSans-BoldOblique.ttf FT y 75 80 su
+DejaVuSans /usr/share/fonts/truetype/DejaVuSans-Oblique.ttf FT y 50 80 su
+
+DejaVuMono /usr/share/fonts/truetype/DejaVuSansMono-Roman.ttf FT n 50 80 su
+DejaVuMono /usr/share/fonts/truetype/DejaVuSansMono-Bold.ttf FT n 75 80 su
+DejaVuMono /usr/share/fonts/truetype/DejaVuSansMono-BoldOb.ttf FT y 75 80 su
+DejaVuMono /usr/share/fonts/truetype/DejaVuSansMono-Oblique.ttf FT y 50 80 su
+
diff --git a/recipes/opie-ttf-support/files/update-qtttffontdir.c b/recipes/opie-ttf-support/files/update-qtttffontdir.c
new file mode 100644
index 0000000000..fa45e38a8b
--- /dev/null
+++ b/recipes/opie-ttf-support/files/update-qtttffontdir.c
@@ -0,0 +1,127 @@
+/*
+ * 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(".")))
+ {
+ int found_fixed = 0;
+
+ 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 = '_';
+
+ 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)
+ {
+ 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;
+}
diff --git a/recipes/opie-ttf-support/opie-ttf-support_1.1.bb b/recipes/opie-ttf-support/opie-ttf-support_1.1.bb
new file mode 100644
index 0000000000..18ce7ac0c9
--- /dev/null
+++ b/recipes/opie-ttf-support/opie-ttf-support_1.1.bb
@@ -0,0 +1,26 @@
+DESCRIPTION = "Meta-package for Opie TTF support"
+SECTION = "opie/fonts"
+DEPENDS = "freetype"
+PR = "r5"
+
+SRC_URI = "file://update-qtttffontdir.c \
+ file://02qtttffont-update"
+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 -d ${D}${sysconfdir}/update-fonts-common.d/
+ install -m 0755 update-qtttffontdir ${D}${sbindir}
+ install -m 0755 02qtttffont-update ${D}${sysconfdir}/update-fonts-common.d/
+ sed -i 's!@@SBINDIR@@!${sbindir}!g' ${D}${sysconfdir}/update-fonts-common.d/02qtttffont-update
+ sed -i 's!@@PALMTOPDIR@@!${palmtopdir}!g' ${D}${sysconfdir}/update-fonts-common.d/02qtttffont-update
+ sed -i 's!@@DATADIR@@!${datadir}!g' ${D}${sysconfdir}/update-fonts-common.d/02qtttffont-update
+}
+
+pkg_postinst() {
+ ${sysconfdir}/update-fonts-common.d/02qtttffont-update
+}