[Bf-blender-cvs] [7c04bc9a011] master: Cleanup: exclude uiFont from DNA, rename filename -> filepath

Campbell Barton noreply at git.blender.org
Fri Jan 7 08:06:31 CET 2022


Commit: 7c04bc9a0114b5b3a7159f5aade86d51719a4cf6
Author: Campbell Barton
Date:   Fri Jan 7 18:01:32 2022 +1100
Branches: master
https://developer.blender.org/rB7c04bc9a0114b5b3a7159f5aade86d51719a4cf6

Cleanup: exclude uiFont from DNA, rename filename -> filepath

This isn't saved to the preferences,
so there is no need to store in DNA.

Also remove unused `r_to_l` member.

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

M	source/blender/editors/interface/interface_style.c
M	source/blender/makesdna/DNA_userdef_types.h

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

diff --git a/source/blender/editors/interface/interface_style.c b/source/blender/editors/interface/interface_style.c
index 76063412758..c28769a4951 100644
--- a/source/blender/editors/interface/interface_style.c
+++ b/source/blender/editors/interface/interface_style.c
@@ -427,11 +427,11 @@ void uiStyleInit(void)
   }
 
   if (U.font_path_ui[0]) {
-    BLI_strncpy(font_first->filename, U.font_path_ui, sizeof(font_first->filename));
+    BLI_strncpy(font_first->filepath, U.font_path_ui, sizeof(font_first->filepath));
     font_first->uifont_id = UIFONT_CUSTOM1;
   }
   else {
-    BLI_strncpy(font_first->filename, "default", sizeof(font_first->filename));
+    BLI_strncpy(font_first->filepath, "default", sizeof(font_first->filepath));
     font_first->uifont_id = UIFONT_DEFAULT;
   }
 
@@ -442,7 +442,7 @@ void uiStyleInit(void)
       font->blf_id = BLF_load_default(unique);
     }
     else {
-      font->blf_id = BLF_load(font->filename);
+      font->blf_id = BLF_load(font->filepath);
       if (font->blf_id == -1) {
         font->blf_id = BLF_load_default(unique);
       }
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index 34415308ef6..a1a4f9381a3 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -55,17 +55,16 @@ typedef enum eUIFont_ID {
  * Default fonts to load/initialize.
  * First font is the default (index 0), others optional.
  */
+#
+#
 typedef struct uiFont {
   struct uiFont *next, *prev;
   /** 1024 = FILE_MAX. */
-  char filename[1024];
+  char filepath[1024];
   /** From blfont lib. */
   short blf_id;
   /** Own id (eUIFont_ID). */
   short uifont_id;
-  /** Fonts that read from left to right. */
-  short r_to_l;
-  char _pad0[2];
 } uiFont;
 
 /** This state defines appearance of text. */



More information about the Bf-blender-cvs mailing list