diff options
Diffstat (limited to 'source/blender/blenkernel/intern/font.c')
-rw-r--r-- | source/blender/blenkernel/intern/font.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c index d4634748c71..b3edeb67928 100644 --- a/source/blender/blenkernel/intern/font.c +++ b/source/blender/blenkernel/intern/font.c @@ -101,9 +101,9 @@ void BKE_vfont_free(struct VFont *vf) static void *builtin_font_data = NULL; static int builtin_font_size = 0; -int BKE_vfont_is_builtin(struct VFont *vfont) +bool BKE_vfont_is_builtin(struct VFont *vfont) { - return (strcmp(vfont->name, FO_BUILTIN_NAME) == 0); + return STREQ(vfont->name, FO_BUILTIN_NAME); } void BKE_vfont_builtin_register(void *mem, int size) @@ -188,18 +188,14 @@ VFont *BKE_vfont_load(Main *bmain, const char *name) PackedFile *temp_pf = NULL; int is_builtin; - if (strcmp(name, FO_BUILTIN_NAME) == 0) { + if (STREQ(name, FO_BUILTIN_NAME)) { BLI_strncpy(filename, name, sizeof(filename)); pf = get_builtin_packedfile(); is_builtin = TRUE; } else { - char dir[FILE_MAXDIR]; - - BLI_strncpy(dir, name, sizeof(dir)); - BLI_splitdirstring(dir, filename); - + BLI_split_file_part(name, filename, sizeof(filename)); pf = newPackedFile(NULL, name, bmain->name); temp_pf = newPackedFile(NULL, name, bmain->name); @@ -947,10 +943,13 @@ makebreak: ct = chartransdata; for (i = 0; i < slen; i++) { if (ct->linenr == lnr) { - if (ct->charnr == cnr) break; - if ( (ct + 1)->charnr == 0) break; + if ((ct->charnr == cnr) || ((ct + 1)->charnr == 0)) { + break; + } + } + else if (ct->linenr > lnr) { + break; } - else if (ct->linenr > lnr) break; cu->pos++; ct++; } @@ -962,9 +961,9 @@ makebreak: float si, co; ct = chartransdata + cu->pos; - si = (float)sin(ct->rot); - co = (float)cos(ct->rot); - + si = sinf(ct->rot); + co = cosf(ct->rot); + f = cu->editfont->textcurs[0]; f[0] = cu->fsize * (-0.1f * co + ct->xof); |