diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-10-24 11:02:19 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-10-24 11:02:19 +0400 |
commit | 619a8b6952b63108c95c031683102f45bd049cd4 (patch) | |
tree | 79090a899322ba47ffe9866a9169f70d81766f46 /source/blender/blenkernel | |
parent | 1424a171a464f79073da2a00c2b5bfa66bf00bc4 (diff) |
bugfix [#24357] Font folder can be specified but is not opened
- open operator was incorrectly checking if the font path was set.
- rna ID editable check was also incorrect, checking the ID name rather then the filename.
- use define FO_BUILTIN_NAME rather then "<builtin>".
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/font.c | 18 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/packedFile.c | 2 |
2 files changed, 10 insertions, 10 deletions
diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c index 131b16b319e..58917e75a43 100644 --- a/source/blender/blenkernel/intern/font.c +++ b/source/blender/blenkernel/intern/font.c @@ -305,7 +305,7 @@ static VFontData *vfont_get_data(VFont *vfont) if (!vfont->data) { PackedFile *pf; - if (BLI_streq(vfont->name, "<builtin>")) { + if (strcmp(vfont->name, FO_BUILTIN_NAME)==0) { pf= get_builtin_packedfile(); } else { if (vfont->packedfile) { @@ -342,7 +342,7 @@ static VFontData *vfont_get_data(VFont *vfont) if(!pf) { printf("Font file doesn't exist: %s\n", vfont->name); - strcpy(vfont->name, "<builtin>"); + strcpy(vfont->name, FO_BUILTIN_NAME); pf= get_builtin_packedfile(); } } @@ -367,7 +367,7 @@ VFont *load_vfont(char *name) int is_builtin; struct TmpFont *tmpfnt; - if (BLI_streq(name, "<builtin>")) { + if (strcmp(name, FO_BUILTIN_NAME)==0) { strcpy(filename, name); pf= get_builtin_packedfile(); @@ -403,8 +403,8 @@ VFont *load_vfont(char *name) vfont->packedfile = pf; } - // Do not add <builtin> to temporary listbase - if(strcmp(filename, "<builtin>")) + // Do not add FO_BUILTIN_NAME to temporary listbase + if(strcmp(filename, FO_BUILTIN_NAME)) { tmpfnt= (struct TmpFont *) MEM_callocN(sizeof(struct TmpFont), "temp_font"); tmpfnt->pf= tpf; @@ -443,10 +443,10 @@ VFont *get_builtin_font(void) VFont *vf; for (vf= G.main->vfont.first; vf; vf= vf->id.next) - if (BLI_streq(vf->name, "<builtin>")) + if (strcmp(vf->name, FO_BUILTIN_NAME)==0) return vf; - return load_vfont("<builtin>"); + return load_vfont(FO_BUILTIN_NAME); } static VChar *find_vfont_char(VFontData *vfd, intptr_t character) @@ -781,10 +781,10 @@ struct chartrans *BKE_text_to_curve(Scene *scene, Object *ob, int mode) /* * The character wasn't in the current curve base so load it - * But if the font is <builtin> then do not try loading since + * But if the font is FO_BUILTIN_NAME then do not try loading since * whole font is in the memory already */ - if(che == NULL && strcmp(vfont->name, "<builtin>")) { + if(che == NULL && strcmp(vfont->name, FO_BUILTIN_NAME)) { BLI_vfontchar_from_freetypefont(vfont, ascii); } diff --git a/source/blender/blenkernel/intern/packedFile.c b/source/blender/blenkernel/intern/packedFile.c index 33f1949c5ac..e8223caed41 100644 --- a/source/blender/blenkernel/intern/packedFile.c +++ b/source/blender/blenkernel/intern/packedFile.c @@ -227,7 +227,7 @@ void packAll(Main *bmain, ReportList *reports) } for(vf=bmain->vfont.first; vf; vf=vf->id.next) - if(vf->packedfile == NULL && vf->id.lib==NULL && strcmp(vf->name, "<builtin>") != 0) + if(vf->packedfile == NULL && vf->id.lib==NULL && strcmp(vf->name, FO_BUILTIN_NAME) != 0) vf->packedfile = newPackedFile(reports, vf->name); for(sound=bmain->sound.first; sound; sound=sound->id.next) |