Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/font.c
| Context not available. | |||||
| #include <wchar.h> | #include <wchar.h> | ||||
| #include <wctype.h> | #include <wctype.h> | ||||
| #include "CLG_log.h" | |||||
| #include "MEM_guardedalloc.h" | #include "MEM_guardedalloc.h" | ||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| Context not available. | |||||
| #include "BKE_anim.h" | #include "BKE_anim.h" | ||||
| #include "BKE_curve.h" | #include "BKE_curve.h" | ||||
| static CLG_LogRef LOG = { "bke.data_transfer" }; | |||||
| static ThreadRWMutex vfont_rwlock = BLI_RWLOCK_INITIALIZER; | static ThreadRWMutex vfont_rwlock = BLI_RWLOCK_INITIALIZER; | ||||
| /* The vfont code */ | /* The vfont code */ | ||||
| Context not available. | |||||
| static PackedFile *get_builtin_packedfile(void) | static PackedFile *get_builtin_packedfile(void) | ||||
| { | { | ||||
| if (!builtin_font_data) { | if (!builtin_font_data) { | ||||
| printf("Internal error, builtin font not loaded\n"); | CLOG_ERROR(&LOG, "Internal error, builtin font not loaded"); | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| Context not available. | |||||
| } | } | ||||
| } | } | ||||
| if (!pf) { | if (!pf) { | ||||
| printf("Font file doesn't exist: %s\n", vfont->name); | CLOG_WARN(&LOG, "Font file doesn't exist: %s", vfont->name); | ||||
| /* DON'T DO THIS | /* DON'T DO THIS | ||||
| * missing file shouldn't modify path! - campbell */ | * missing file shouldn't modify path! - campbell */ | ||||
| Context not available. | |||||
| (ct->dobreak == 0) && | (ct->dobreak == 0) && | ||||
| (((xof - tb_scale.x) + twidth) > xof_scale + tb_scale.w)) | (((xof - tb_scale.x) + twidth) > xof_scale + tb_scale.w)) | ||||
| { | { | ||||
| // fprintf(stderr, "linewidth exceeded: %c%c%c...\n", mem[i], mem[i+1], mem[i+2]); | // CLOG_WARN(&LOG, "linewidth exceeded: %c%c%c...", mem[i], mem[i+1], mem[i+2]); | ||||
| for (j = i; j && (mem[j] != '\n') && (chartransdata[j].dobreak == 0); j--) { | for (j = i; j && (mem[j] != '\n') && (chartransdata[j].dobreak == 0); j--) { | ||||
| bool dobreak = false; | bool dobreak = false; | ||||
| if (mem[j] == ' ' || mem[j] == '-') { | if (mem[j] == ' ' || mem[j] == '-') { | ||||
| Context not available. | |||||
| dobreak = true; | dobreak = true; | ||||
| } | } | ||||
| else if (chartransdata[j].dobreak) { | else if (chartransdata[j].dobreak) { | ||||
| // fprintf(stderr, "word too long: %c%c%c...\n", mem[j], mem[j+1], mem[j+2]); | // CLOG_WARN(&LOG, "word too long: %c%c%c...", mem[j], mem[j+1], mem[j+2]); | ||||
| ct->dobreak = 1; | ct->dobreak = 1; | ||||
| custrinfo[i + 1].flag |= CU_CHINFO_WRAP; | custrinfo[i + 1].flag |= CU_CHINFO_WRAP; | ||||
| ct -= 1; | ct -= 1; | ||||
| Context not available. | |||||
| } | } | ||||
| if (ob == NULL || info->mat_nr > (ob->totcol)) { | if (ob == NULL || info->mat_nr > (ob->totcol)) { | ||||
| /* printf("Error: Illegal material index (%d) in text object, setting to 0\n", info->mat_nr); */ | /* CLOG_ERROR(&LOG, "Illegal material index (%d) in text object, setting to 0", info->mat_nr); */ | ||||
| info->mat_nr = 0; | info->mat_nr = 0; | ||||
| } | } | ||||
| /* We do not want to see any character for \n or \r */ | /* We do not want to see any character for \n or \r */ | ||||
| Context not available. | |||||