Hello World in Japanese


I am connecting ili9488 to ESP32 and creating a screen display using the lvgl library.

I have confirmed that the program that displays Hello World on the screen can be displayed normally.

Next time, I would like to display “こんにちは、世界!” in Japanese.

Do I have to create Japanese files from True Type fonts on this site?

Are there any files that are already available?

What MCU/Processor/Board and compiler are you using?

ESP32, platformio

What LVGL version are you using?

lvgl@ 8.3.9

What do you want to achieve?

I would like to display “Hello World” in Japanese.

What have you tried so far?

There is a file called NotoSerifJP-Medium.otf which is Google’s Japanese font.

Unicode for hiragana-only fonts in this file


Up to this point, the file jpfont.c has been output.

I put the main.cpp and jphont.c files in the same src folder and the build was OK, but the hiragana font of “あいうえおかきくけこ” is not displayed on the ili9488 screen at all.

Is this the correct way to create Japanese fonts?

Is the jphont.c file loaded correctly?

Please tell me how to solve it.

#include <Arduino.h>
#include <lvgl.h>
#include <TFT_eSPI.h> // ILI9488ドライバを含むライブラリ

TFT_eSPI tft = TFT_eSPI(); // TFTのインスタンスを作成

// ディスプレイフラッシュ関数
void my_disp_flush(lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *color_p) {
    tft.setAddrWindow(area->x1, area->y1, area->x2 - area->x1 + 1, area->y2 - area->y1 + 1);
    tft.pushColors((uint16_t *)&color_p->full, (area->x2 - area->x1 + 1) * (area->y2 - area->y1 + 1), true);

static lv_disp_draw_buf_t draw_buf;
static lv_color_t buf[320 * 10]; // 仮にディスプレイの垂直解像度を480ピクセルと仮定
static lv_disp_drv_t disp_drv;


void setup() {
    Serial.begin(115200); // シリアル通信の初期化
    Serial.println("Setup Start");

    tft.setRotation(1); // ディスプレイの向きに合わせて調整

    // バッファのサイズを設定(解像度に基づいて)

    lv_disp_draw_buf_init(&draw_buf, buf, NULL, 320 * 3);

    disp_drv.hor_res = 480; // ディスプレイの解像度を設定
    disp_drv.ver_res = 320;
    disp_drv.flush_cb = my_disp_flush;
    disp_drv.draw_buf = &draw_buf;

    static lv_style_t style1;
    // LVGLラベルの作成
    lv_obj_t *label = lv_label_create(lv_scr_act());
    //lv_label_set_text(label, "Hello, LVGL World02!");
    lv_style_set_text_font(&style1, &jpfont);

    lv_obj_add_style(label, &style1, 0);
    lv_style_set_text_color(&style1, lv_color_hex(0xFFFFFF));
    // ラベルのサイズを設定
    lv_obj_set_size(label, 200, 100);

    // テキストの折り返しを設定
    lv_label_set_long_mode(label, LV_LABEL_LONG_WRAP);

    lv_obj_align(label, LV_ALIGN_CENTER, 0, 0);

    Serial.println("Setup End");

void loop() {