Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-12-18 12:18:55 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-12-18 12:33:05 +0400
commitd51dd929507e8b5491ba7909bd4d102efe039a63 (patch)
tree3067f7fd743d24d33ae5997b69f2c6690b1a4a29 /source/blender/blenfont
parent0e694b9b7ee25e74a1bbbaa78cff35ab26d3dd1d (diff)
BLF: debug function to print a fonts state
Diffstat (limited to 'source/blender/blenfont')
-rw-r--r--source/blender/blenfont/BLF_api.h4
-rw-r--r--source/blender/blenfont/intern/blf.c21
2 files changed, 25 insertions, 0 deletions
diff --git a/source/blender/blenfont/BLF_api.h b/source/blender/blenfont/BLF_api.h
index 6ba3bedd4b6..e01631fff6b 100644
--- a/source/blender/blenfont/BLF_api.h
+++ b/source/blender/blenfont/BLF_api.h
@@ -182,6 +182,10 @@ char **BLF_dir_get(int *ndir);
/* Free the data return by BLF_dir_get. */
void BLF_dir_free(char **dirs, int count);
+#ifdef DEBUG
+void BLF_state_print(int fontid);
+#endif
+
/* font->flags. */
#define BLF_ROTATION (1 << 0)
#define BLF_CLIPPING (1 << 1)
diff --git a/source/blender/blenfont/intern/blf.c b/source/blender/blenfont/intern/blf.c
index a5aa19704ec..152af0d999d 100644
--- a/source/blender/blenfont/intern/blf.c
+++ b/source/blender/blenfont/intern/blf.c
@@ -850,3 +850,24 @@ void BLF_draw_buffer(int fontid, const char *str)
blf_font_buffer(font, str);
}
}
+
+#ifdef DEBUG
+void BLF_state_print(int fontid)
+{
+ FontBLF *font = blf_get(fontid);
+ if (font) {
+ printf("fontid %d %p\n", fontid, font->name, (void *)font);
+ printf(" name: '%s'\n", font->name);
+ printf(" size: %u\n", font->size);
+ printf(" dpi: %u\n", font->dpi);
+ printf(" pos: %.6f %.6f %.6f\n", UNPACK3(font->pos));
+ printf(" aspect: (%d) %.6f %.6f %.6f\n", (font->flags & BLF_ROTATION) != 0, UNPACK3(font->aspect));
+ printf(" angle: (%d) %.6f\n", (font->flags & BLF_ASPECT) != 0, font->angle);
+ printf(" flag: %d\n", font->flags);
+ }
+ else {
+ printf("fontid %d (NULL)\n", fontid);
+ }
+ fflush(stdout);
+}
+#endif