summaryrefslogtreecommitdiffstats
path: root/minuitwrp/mkfont.c
diff options
context:
space:
mode:
authorDees_Troy <dees_troy@teamw.in>2012-09-05 21:24:24 +0200
committerDees_Troy <dees_troy@teamw.in>2012-09-05 21:24:31 +0200
commit51a0e82eb29a6dfc79f93479883383fbdbf8bcc2 (patch)
tree52fc18206eb0feba9f50dc3b0ede9fdc5e40f35e /minuitwrp/mkfont.c
parentInitial stub of partitions.hpp (diff)
downloadandroid_bootable_recovery-51a0e82eb29a6dfc79f93479883383fbdbf8bcc2.tar
android_bootable_recovery-51a0e82eb29a6dfc79f93479883383fbdbf8bcc2.tar.gz
android_bootable_recovery-51a0e82eb29a6dfc79f93479883383fbdbf8bcc2.tar.bz2
android_bootable_recovery-51a0e82eb29a6dfc79f93479883383fbdbf8bcc2.tar.lz
android_bootable_recovery-51a0e82eb29a6dfc79f93479883383fbdbf8bcc2.tar.xz
android_bootable_recovery-51a0e82eb29a6dfc79f93479883383fbdbf8bcc2.tar.zst
android_bootable_recovery-51a0e82eb29a6dfc79f93479883383fbdbf8bcc2.zip
Diffstat (limited to '')
-rw-r--r--minuitwrp/mkfont.c54
1 files changed, 54 insertions, 0 deletions
diff --git a/minuitwrp/mkfont.c b/minuitwrp/mkfont.c
new file mode 100644
index 000000000..61a5edeb2
--- /dev/null
+++ b/minuitwrp/mkfont.c
@@ -0,0 +1,54 @@
+#include <stdio.h>
+#include <stdlib.h>
+
+int main(int argc, char *argv)
+{
+ unsigned n;
+ unsigned char *x;
+ unsigned m;
+ unsigned run_val;
+ unsigned run_count;
+
+ n = gimp_image.width * gimp_image.height;
+ m = 0;
+ x = gimp_image.pixel_data;
+
+ printf("struct {\n");
+ printf(" unsigned width;\n");
+ printf(" unsigned height;\n");
+ printf(" unsigned cwidth;\n");
+ printf(" unsigned cheight;\n");
+ printf(" unsigned char rundata[];\n");
+ printf("} font = {\n");
+ printf(" .width = %d,\n .height = %d,\n .cwidth = %d,\n .cheight = %d,\n", gimp_image.width, gimp_image.height,
+ gimp_image.width / 96, gimp_image.height);
+ printf(" .rundata = {\n");
+
+ run_val = (*x ? 0 : 255);
+ run_count = 1;
+ n--;
+ x+=3;
+
+ while(n-- > 0) {
+ unsigned val = (*x ? 0 : 255);
+ x+=3;
+ if((val == run_val) && (run_count < 127)) {
+ run_count++;
+ } else {
+eject:
+ printf("0x%02x,",run_count | (run_val ? 0x80 : 0x00));
+ run_val = val;
+ run_count = 1;
+ m += 5;
+ if(m >= 75) {
+ printf("\n");
+ m = 0;
+ }
+ }
+ }
+ printf("0x%02x,",run_count | (run_val ? 0x80 : 0x00));
+ printf("\n0x00,");
+ printf("\n");
+ printf(" }\n};\n");
+ return 0;
+}