Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/PushESPComponent.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Push component to ESP Component Registry

on:
push:
tags:
- '*.*.*'

jobs:
upload_components:
if: github.repository == 'm5stack/M5GFX'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Upload component to the component registry
uses: espressif/upload-components-ci-action@v1
with:
name: 'm5gfx'
namespace: 'm5stack'
version: ${{ github.ref_name }}
api_token: ${{ secrets.IDF_COMPONENT_API_TOKEN }}
2 changes: 0 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ file(GLOB SRCS
src/*.cpp
src/lgfx/Fonts/efont/*.c
src/lgfx/Fonts/IPA/*.c
src/lgfx/Fonts/lvgl/*.c
src/lgfx/utility/*.c
src/lgfx/v1/*.cpp
src/lgfx/v1/lv_font/*.c
src/lgfx/v1/misc/*.cpp
src/lgfx/v1/panel/*.cpp
src/lgfx/v1/platforms/esp32/*.cpp
Expand Down
30 changes: 15 additions & 15 deletions examples/Basic/LvglFont/LvglFont.ino
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,15 @@

#endif

#ifndef LV_LVGL_H_INCLUDE_SIMPLE
#define LV_LVGL_H_INCLUDE_SIMPLE
#endif

#include <M5Unified.h>

// Pre-built LVGL fonts (fonts::lvFontMontserrat*) are provided by the
// external LGFX_Fonts component: https://github.com/tobozo/LGFX_Fonts
// Install it alongside M5GFX/M5Unified to use them.
#include <LGFX_Fonts.hpp>

extern const uint8_t montserrat_bff_12[];

extern "C" {
extern const lv_font_t montserrat_16;
}
lgfx::LVGLfont user_lv_font_montserrat_16(&montserrat_16);
extern const uint8_t montserrat_bff_12[];

void setup(void)
{
Expand All @@ -33,16 +29,20 @@ void setup(void)

M5.Lcd.setTextColor(TFT_BLACK, TFT_WHITE);

// BFFfont
// (1) BFF font loaded at runtime. This path is built into M5GFX core
// (ft_lvgl -> BFFfont) and depends on neither LVGL nor LGFX_Fonts.
M5.Lcd.loadFont(montserrat_bff_12, lgfx::IFont::font_type_t::ft_lvgl);
M5.Lcd.println("ABCDEFGHJKLMNOPQRSTUVWXYZabcdefghjklmnopqrstuvwxyz0123456789");

// lvgl built-in font
// (2) Pre-built LVGL font.
// Newer M5GFX delegates LVGL fonts to the external LGFX_Fonts
// component (fonts::lvFontMontserrat*); older M5GFX bundled them
// internally (fonts::lv_font_montserrat_*). The guard keeps both.
#if defined M5GFX_LVGL_INTERNAL_H
M5.Lcd.setFont(&fonts::lv_font_montserrat_14);
M5.Lcd.println("ABCDEFGHJKLMNOPQRSTUVWXYZabcdefghjklmnopqrstuvwxyz0123456789");

// LVGL user font
M5.Lcd.setFont(&user_lv_font_montserrat_16);
#else
M5.Lcd.setFont(&fonts::lvFontMontserrat14);
#endif
M5.Lcd.println("ABCDEFGHJKLMNOPQRSTUVWXYZabcdefghjklmnopqrstuvwxyz0123456789");
}

Expand Down
Loading
Loading