diff options
Diffstat (limited to 'source/blender/blenkernel/intern/font.c')
-rw-r--r-- | source/blender/blenkernel/intern/font.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c index 6898615c753..0a94b4e3fd1 100644 --- a/source/blender/blenkernel/intern/font.c +++ b/source/blender/blenkernel/intern/font.c @@ -255,6 +255,29 @@ static PackedFile *get_builtin_packedfile(void) } } +#ifdef INTERNATIONAL +const char unifont_filename[]="droidsans.ttf.gz"; +static unsigned char *unifont_ttf= NULL; +static int unifont_size= 0; + +unsigned char *BKE_font_get_unifont(int *unifont_size_r) +{ + if(unifont_ttf==NULL) { + char *fontpath = BLI_get_folder(BLENDER_DATAFILES, "fonts"); + char unifont_path[1024]; + + BLI_snprintf(unifont_path, sizeof(unifont_path), "%s/%s", fontpath, unifont_filename); + + unifont_ttf= BLI_ungzip_to_mem(unifont_path, &unifont_size); + } + + *unifont_size_r= unifont_size; + + return unifont_ttf; +} + +#endif + void free_ttfont(void) { struct TmpFont *tf; @@ -265,6 +288,9 @@ void free_ttfont(void) tf->vfont= NULL; } BLI_freelistN(&ttfdata); + + if(unifont_ttf) + MEM_freeN(unifont_ttf); } struct TmpFont *vfont_find_tmpfont(VFont *vfont) |