[Bf-blender-cvs] [5908382011] blender2.8: add BLF_default function

Mike Erwin noreply at git.blender.org
Sun Feb 5 07:17:11 CET 2017


Commit: 590838201120b32a4d1e2453b199806a527968bf
Author: Mike Erwin
Date:   Sat Feb 4 23:12:53 2017 -0500
Branches: blender2.8
https://developer.blender.org/rB590838201120b32a4d1e2453b199806a527968bf

add BLF_default function

So we don't need two versions of all other BLF functions -- one for specific font ID & another for the default font.

===================================================================

M	source/blender/blenfont/BLF_api.h
M	source/blender/blenfont/intern/blf.c

===================================================================

diff --git a/source/blender/blenfont/BLF_api.h b/source/blender/blenfont/BLF_api.h
index b6fc42d774..e6d48d82a3 100644
--- a/source/blender/blenfont/BLF_api.h
+++ b/source/blender/blenfont/BLF_api.h
@@ -45,6 +45,7 @@ int BLF_init(int points, int dpi);
 void BLF_exit(void);
 void BLF_default_dpi(int dpi);
 void BLF_default_set(int fontid);
+int BLF_default(void); /* get default font ID so we can pass it to other functions */
 
 void BLF_cache_clear(void);
 
diff --git a/source/blender/blenfont/intern/blf.c b/source/blender/blenfont/intern/blf.c
index 4b3a965efd..87e56d55ee 100644
--- a/source/blender/blenfont/intern/blf.c
+++ b/source/blender/blenfont/intern/blf.c
@@ -175,6 +175,12 @@ void BLF_default_set(int fontid)
 	}
 }
 
+int BLF_default()
+{
+	ASSERT_DEFAULT_SET;
+	return global_font_default;
+}
+
 int BLF_load(const char *name)
 {
 	FontBLF *font;




More information about the Bf-blender-cvs mailing list