Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changing font #110

Open
7h30th3r0n3 opened this issue May 10, 2024 · 1 comment
Open

changing font #110

7h30th3r0n3 opened this issue May 10, 2024 · 1 comment

Comments

@7h30th3r0n3
Copy link

Hi ! thanks for the great work !

What is the way to change the font ?

I tried things like :
M5.Display.setFont(&fonts::Font4);
or

void gfxSetup (LGFX Device* gfx) {
 gfx->setFont(&fonts::efontCN 12);
}

but it seem to not changing any font at all, and chinese characters are not printed correctly on screen while using
M5.Display.println("something);

more info : 7h30th3r0n3/Evil-M5Core2#2

@lovyan03
Copy link
Collaborator

Hello, @7h30th3r0n3 .
Please try the code below.

#include <M5Unified.h>

void setup() {
    M5.begin();
    M5.Display.setFont(&fonts::efontCN_12);
    M5.Display.print("你好世界");
}

image

I looked at the code in the URL you linked, and it seems likely that you are using the setTextFont function to disable the font each time.
After setting the font, we recommend checking whether the font has been changed unintentionally before drawing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants