This is an automated email from the ASF dual-hosted git repository.

jerzy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git


The following commit(s) were added to refs/heads/master by this push:
     new c36f793a2 lvgl: Add syscfgs for configuring fonts
c36f793a2 is described below

commit c36f793a2c9c8b7eddb109041366bf8d109105a0
Author: Michal Gorecki <[email protected]>
AuthorDate: Mon Jun 12 13:30:14 2023 +0200

    lvgl: Add syscfgs for configuring fonts
    
    This is useful if default font used by the lvgl based application
    has to be changed.
---
 hw/drivers/display/lvgl/default/lv_conf.h | 48 ++++++++++----------
 hw/drivers/display/lvgl/syscfg.yml        | 74 +++++++++++++++++++++++++++++++
 2 files changed, 98 insertions(+), 24 deletions(-)

diff --git a/hw/drivers/display/lvgl/default/lv_conf.h 
b/hw/drivers/display/lvgl/default/lv_conf.h
index df7a40b1c..4284b00a2 100644
--- a/hw/drivers/display/lvgl/default/lv_conf.h
+++ b/hw/drivers/display/lvgl/default/lv_conf.h
@@ -344,27 +344,27 @@
 
 /*Montserrat fonts with ASCII range and some symbols using bpp = 4
  *https://fonts.google.com/specimen/Montserrat*/
-#define LV_FONT_MONTSERRAT_8  0
-#define LV_FONT_MONTSERRAT_10 0
-#define LV_FONT_MONTSERRAT_12 1
-#define LV_FONT_MONTSERRAT_14 1
-#define LV_FONT_MONTSERRAT_16 1
-#define LV_FONT_MONTSERRAT_18 0
-#define LV_FONT_MONTSERRAT_20 0
-#define LV_FONT_MONTSERRAT_22 0
-#define LV_FONT_MONTSERRAT_24 0
-#define LV_FONT_MONTSERRAT_26 0
-#define LV_FONT_MONTSERRAT_28 0
-#define LV_FONT_MONTSERRAT_30 0
-#define LV_FONT_MONTSERRAT_32 0
-#define LV_FONT_MONTSERRAT_34 0
-#define LV_FONT_MONTSERRAT_36 0
-#define LV_FONT_MONTSERRAT_38 0
-#define LV_FONT_MONTSERRAT_40 0
-#define LV_FONT_MONTSERRAT_42 0
-#define LV_FONT_MONTSERRAT_44 0
-#define LV_FONT_MONTSERRAT_46 0
-#define LV_FONT_MONTSERRAT_48 0
+#define LV_FONT_MONTSERRAT_8     MYNEWT_VAL(LV_FONT_MONTSERRAT_8)
+#define LV_FONT_MONTSERRAT_10    MYNEWT_VAL(LV_FONT_MONTSERRAT_10)
+#define LV_FONT_MONTSERRAT_12    MYNEWT_VAL(LV_FONT_MONTSERRAT_12)
+#define LV_FONT_MONTSERRAT_14    MYNEWT_VAL(LV_FONT_MONTSERRAT_14)
+#define LV_FONT_MONTSERRAT_16    MYNEWT_VAL(LV_FONT_MONTSERRAT_16)
+#define LV_FONT_MONTSERRAT_18    MYNEWT_VAL(LV_FONT_MONTSERRAT_18)
+#define LV_FONT_MONTSERRAT_20    MYNEWT_VAL(LV_FONT_MONTSERRAT_20)
+#define LV_FONT_MONTSERRAT_22    MYNEWT_VAL(LV_FONT_MONTSERRAT_22)
+#define LV_FONT_MONTSERRAT_24    MYNEWT_VAL(LV_FONT_MONTSERRAT_24)
+#define LV_FONT_MONTSERRAT_26    MYNEWT_VAL(LV_FONT_MONTSERRAT_26)
+#define LV_FONT_MONTSERRAT_28    MYNEWT_VAL(LV_FONT_MONTSERRAT_28)
+#define LV_FONT_MONTSERRAT_30    MYNEWT_VAL(LV_FONT_MONTSERRAT_30)
+#define LV_FONT_MONTSERRAT_32    MYNEWT_VAL(LV_FONT_MONTSERRAT_32)
+#define LV_FONT_MONTSERRAT_34    MYNEWT_VAL(LV_FONT_MONTSERRAT_34)
+#define LV_FONT_MONTSERRAT_36    MYNEWT_VAL(LV_FONT_MONTSERRAT_36)
+#define LV_FONT_MONTSERRAT_38    MYNEWT_VAL(LV_FONT_MONTSERRAT_38)
+#define LV_FONT_MONTSERRAT_40    MYNEWT_VAL(LV_FONT_MONTSERRAT_40)
+#define LV_FONT_MONTSERRAT_42    MYNEWT_VAL(LV_FONT_MONTSERRAT_42)
+#define LV_FONT_MONTSERRAT_44    MYNEWT_VAL(LV_FONT_MONTSERRAT_44)
+#define LV_FONT_MONTSERRAT_46    MYNEWT_VAL(LV_FONT_MONTSERRAT_46)
+#define LV_FONT_MONTSERRAT_48    MYNEWT_VAL(LV_FONT_MONTSERRAT_48)
 
 /*Demonstrate special features*/
 #define LV_FONT_MONTSERRAT_12_SUBPX      0
@@ -373,8 +373,8 @@
 #define LV_FONT_SIMSUN_16_CJK            0  /*1000 most common CJK radicals*/
 
 /*Pixel perfect monospace fonts*/
-#define LV_FONT_UNSCII_8  0
-#define LV_FONT_UNSCII_16 0
+#define LV_FONT_UNSCII_8     MYNEWT_VAL(LV_FONT_UNSCII_8)
+#define LV_FONT_UNSCII_16    MYNEWT_VAL(LV_FONT_UNSCII_16)
 
 /*Optionally declare custom fonts here.
  *You can use these fonts as default font too and they will be available 
globally.
@@ -382,7 +382,7 @@
 #define LV_FONT_CUSTOM_DECLARE
 
 /*Always set a default font*/
-#define LV_FONT_DEFAULT &lv_font_montserrat_14
+#define LV_FONT_DEFAULT &MYNEWT_VAL(LV_FONT_DEFAULT)
 
 /*Enable handling large font and/or fonts with a lot of characters.
  *The limit depends on the font size, font face and bpp.
diff --git a/hw/drivers/display/lvgl/syscfg.yml 
b/hw/drivers/display/lvgl/syscfg.yml
index 55f2fe202..6dec4222e 100644
--- a/hw/drivers/display/lvgl/syscfg.yml
+++ b/hw/drivers/display/lvgl/syscfg.yml
@@ -72,6 +72,80 @@ syscfg.defs:
         description: Add LVGL demos to build.
         value: 1
 
+    LV_FONT_DEFAULT:
+        description: Set default LVGL font.
+        value: 'lv_font_montserrat_14'
+
+    LV_FONT_MONTSERRAT_8:
+        description: Enable Montserrat 8 font.
+        value: 0
+    LV_FONT_MONTSERRAT_10:
+        description: Enable Montserrat 10 font.
+        value: 0
+    LV_FONT_MONTSERRAT_12:
+        description: Enable Montserrat 12 font.
+        value: 1
+    LV_FONT_MONTSERRAT_14:
+        description: Enable Montserrat 14 font.
+        value: 1
+    LV_FONT_MONTSERRAT_16:
+        description: Enable Montserrat 16 font.
+        value: 1
+    LV_FONT_MONTSERRAT_18:
+        description: Enable Montserrat 18 font.
+        value: 0
+    LV_FONT_MONTSERRAT_20:
+        description: Enable Montserrat 20 font.
+        value: 0
+    LV_FONT_MONTSERRAT_22:
+        description: Enable Montserrat 22 font.
+        value: 0
+    LV_FONT_MONTSERRAT_24:
+        description: Enable Montserrat 24 font.
+        value: 0
+    LV_FONT_MONTSERRAT_26:
+        description: Enable Montserrat 26 font.
+        value: 0
+    LV_FONT_MONTSERRAT_28:
+        description: Enable Montserrat 28 font.
+        value: 0
+    LV_FONT_MONTSERRAT_30:
+        description: Enable Montserrat 30 font.
+        value: 0
+    LV_FONT_MONTSERRAT_32:
+        description: Enable Montserrat 32 font.
+        value: 0
+    LV_FONT_MONTSERRAT_34:
+        description: Enable Montserrat 34 font.
+        value: 0
+    LV_FONT_MONTSERRAT_36:
+        description: Enable Montserrat 36 font.
+        value: 0
+    LV_FONT_MONTSERRAT_38:
+        description: Enable Montserrat 38 font.
+        value: 0
+    LV_FONT_MONTSERRAT_40:
+        description: Enable Montserrat 40 font.
+        value: 0
+    LV_FONT_MONTSERRAT_42:
+        description: Enable Montserrat 42 font.
+        value: 0
+    LV_FONT_MONTSERRAT_44:
+        description: Enable Montserrat 44 font.
+        value: 0
+    LV_FONT_MONTSERRAT_46:
+        description: Enable Montserrat 46 font.
+        value: 0
+    LV_FONT_MONTSERRAT_48:
+        description: Enable Montserrat 48 font.
+        value: 0
+    LV_FONT_UNSCII_8:
+        description: Enable monospace unscii 8 font.
+        value: 0
+    LV_FONT_UNSCII_16:
+        description: Enable monospace unscii 16 font.
+        value: 0
+
     LV_USE_DEMO_FLEX_LAYOUT:
         description: Enable Flex Layout demo.
         value: 1

Reply via email to