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 <campbell@blender.org>2022-06-22 07:50:22 +0300
committerCampbell Barton <campbell@blender.org>2022-06-22 07:50:22 +0300
commitb8289eb1b9c63a25a1926a32740171a92d857b2b (patch)
tree55ae29a3e94e28a647027b29ed161f9534ecdc1b
parent8fab580949374e6208cee2e9ba2caf249bc0c1fd (diff)
Cleanup: replace BLF defines with enum, formatting
-rw-r--r--release/scripts/presets/keyconfig/keymap_data/blender_default.py1
-rw-r--r--source/blender/blenfont/BLF_api.h40
-rw-r--r--source/blender/blenfont/intern/blf_font.c2
3 files changed, 25 insertions, 18 deletions
diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
index 1239f49473c..623ca2340d1 100644
--- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py
+++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
@@ -5590,6 +5590,7 @@ def km_font(params):
return keymap
+
# Curves edit mode.
def km_curves(params):
items = []
diff --git a/source/blender/blenfont/BLF_api.h b/source/blender/blenfont/BLF_api.h
index 78c8612f7f5..83ca9158efc 100644
--- a/source/blender/blenfont/BLF_api.h
+++ b/source/blender/blenfont/BLF_api.h
@@ -329,23 +329,29 @@ void BLF_load_font_stack(void);
void BLF_state_print(int fontid);
#endif
-/* font->flags. */
-#define BLF_ROTATION (1 << 0)
-#define BLF_CLIPPING (1 << 1)
-#define BLF_SHADOW (1 << 2)
-// #define BLF_FLAG_UNUSED_3 (1 << 3) /* dirty */
-#define BLF_MATRIX (1 << 4)
-#define BLF_ASPECT (1 << 5)
-#define BLF_WORD_WRAP (1 << 6)
-#define BLF_MONOCHROME (1 << 7) /* no-AA */
-#define BLF_HINTING_NONE (1 << 8)
-#define BLF_HINTING_SLIGHT (1 << 9)
-#define BLF_HINTING_FULL (1 << 10)
-#define BLF_BOLD (1 << 11)
-#define BLF_ITALIC (1 << 12)
-#define BLF_MONOSPACED (1 << 13) /* Intended USE is monospaced, regardless of font type. */
-#define BLF_DEFAULT (1 << 14) /* A font within the default stack of fonts. */
-#define BLF_LAST_RESORT (1 << 15) /* Must only be used as last font in the stack. */
+/** #FontBLF.flags. */
+enum {
+ BLF_ROTATION = 1 << 0,
+ BLF_CLIPPING = 1 << 1,
+ BLF_SHADOW = 1 << 2,
+ // BLF_FLAG_UNUSED_3 = 1 << 3, /* dirty */
+ BLF_MATRIX = 1 << 4,
+ BLF_ASPECT = 1 << 5,
+ BLF_WORD_WRAP = 1 << 6,
+ /** No anti-aliasing. */
+ BLF_MONOCHROME = 1 << 7,
+ BLF_HINTING_NONE = 1 << 8,
+ BLF_HINTING_SLIGHT = 1 << 9,
+ BLF_HINTING_FULL = 1 << 10,
+ BLF_BOLD = 1 << 11,
+ BLF_ITALIC = 1 << 12,
+ /** Intended USE is monospaced, regardless of font type. */
+ BLF_MONOSPACED = 1 << 13,
+ /** A font within the default stack of fonts. */
+ BLF_DEFAULT = 1 << 14,
+ /** Must only be used as last font in the stack. */
+ BLF_LAST_RESORT = 1 << 15,
+};
#define BLF_DRAW_STR_DUMMY_MAX 1024
diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c
index 26a72fcb95a..3e2927d581e 100644
--- a/source/blender/blenfont/intern/blf_font.c
+++ b/source/blender/blenfont/intern/blf_font.c
@@ -1289,7 +1289,7 @@ FontBLF *blf_font_new(const char *name, const char *filepath)
font->filepath = BLI_strdup(filepath);
blf_font_fill(font);
- /* Save TrueType table with bits to quickly test most unicode block coverage. */
+ /* Save TrueType table with bits to quickly test most unicode block coverage. */
TT_OS2 *os2_table = (TT_OS2 *)FT_Get_Sfnt_Table(font->face, FT_SFNT_OS2);
if (os2_table) {
font->UnicodeRanges[0] = (uint)os2_table->ulUnicodeRange1;