diff -up blender-2.65a/source/blender/blenfont/intern/blf_translation.c.droid blender-2.65a/source/blender/blenfont/intern/blf_translation.c
--- blender-2.65a/source/blender/blenfont/intern/blf_translation.c.droid 2012-11-11 17:54:26.000000000 +0100
+++ blender-2.65a/source/blender/blenfont/intern/blf_translation.c 2013-02-23 21:00:38.693953610 +0100
@@ -47,24 +47,18 @@
#include "DNA_userdef_types.h" /* For user settings. */
-static const char unifont_filename[] = "droidsans.ttf.gz";
+static const char unifont_filename[] = "DroidSans.ttf";
static unsigned char *unifont_ttf = NULL;
static int unifont_size = 0;
unsigned char *BLF_get_unifont(int *unifont_size_r)
{
- if (unifont_ttf == NULL) {
- char *fontpath = BLI_get_folder(BLENDER_DATAFILES, "fonts");
- if (fontpath) {
- char unifont_path[1024];
-
- BLI_snprintf(unifont_path, sizeof(unifont_path), "%s/%s", fontpath, unifont_filename);
+ const char *fontpath = "/usr/share/fonts/google-droid";
- unifont_ttf = (unsigned char *)BLI_file_ungzip_to_mem(unifont_path, &unifont_size);
- }
- else {
- printf("%s: 'fonts' data path not found for international font, continuing\n", __func__);
- }
+ if (unifont_ttf == NULL) {
+ char unifont_path[1024];
+ BLI_snprintf(unifont_path, sizeof(unifont_path), "%s/%s", fontpath, unifont_filename);
+ unifont_ttf = (unsigned char *)BLI_file_to_mem(unifont_path, &unifont_size);
}
*unifont_size_r = unifont_size;
diff -up blender-2.65a/source/blender/blenlib/BLI_fileops.h.droid blender-2.65a/source/blender/blenlib/BLI_fileops.h
--- blender-2.65a/source/blender/blenlib/BLI_fileops.h.droid 2012-10-06 09:03:03.000000000 +0200
+++ blender-2.65a/source/blender/blenlib/BLI_fileops.h 2013-02-23 20:59:12.507903294 +0100
@@ -81,6 +81,8 @@ int BLI_file_touch(const char *file);
int BLI_file_gzip(const char *from, const char *to);
char *BLI_file_ungzip_to_mem(const char *from_file, int *size_r);
+char *BLI_file_to_mem(const char *from_file, int *size_r);
+
size_t BLI_file_descriptor_size(int file);
size_t BLI_file_size(const char *file);
diff -up blender-2.65a/source/blender/blenlib/intern/fileops.c.droid blender-2.65a/source/blender/blenlib/intern/fileops.c
--- blender-2.65a/source/blender/blenlib/intern/fileops.c.droid 2012-10-07 17:39:47.000000000 +0200
+++ blender-2.65a/source/blender/blenlib/intern/fileops.c 2013-02-23 20:59:12.520902390 +0100
@@ -155,6 +155,31 @@ char *BLI_file_ungzip_to_mem(const char
return mem;
}
+char *BLI_file_to_mem(const char *from_file, int *size_r)
+{
+ int file;
+ int size = 0;
+ char *mem = NULL;
+
+ file = BLI_open(from_file, O_RDONLY, 0);
+
+ size = BLI_file_descriptor_size(file);
+
+ if (size == 0) {
+ close (file);
+ return 0;
+ }
+
+ mem = MEM_callocN(size, "BLI_ungzip_to_mem");
+
+ read(file, mem, size);
+
+ close (file);
+
+ *size_r = size;
+
+ return mem;
+}
/* return 1 when file can be written */
int BLI_file_is_writable(const char *filename)