<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[M5Stack Core2, How to load Custom Font?]]></title><description><![CDATA[<p dir="auto">I was reading: <a href="https://community.m5stack.com/topic/388/cahnge-font-size-in-python/">https://community.m5stack.com/topic/388/cahnge-font-size-in-python/</a> on how to load custom font on my Core2 Board and tried to do it myself.</p>
<p dir="auto">Given font file in <code>.ttf</code> format, I've generated 2 files: in <code>.c</code> and <code>.bin</code> format using the following online tool: <a href="https://lvgl.io/tools/font_conv_v5_3" target="_blank" rel="noopener noreferrer nofollow ugc">https://lvgl.io/tools/font_conv_v5_3</a></p>
<p dir="auto">Then, I moved them to my Core2 Board and tried to use the new font like this (I'm working with MicroPython):</p>
<pre><code>from m5stack import *
from m5stack_ui import *
from uiflow import *
from valera import *

screen = M5Screen()
screen.clean_screen()
screen.set_screen_bg_color(0xFFFFFF)


label0 = M5Label('Hi', x=149, y=86, color=0x000, parent=None)
lcd.compileFont("./valera.c")
lcd.font("./valera.c")
</code></pre>
<p dir="auto">But, every time I run the above code the program crashes and causes a restart to the device.<br />
Any suggestions on what could be the problem here?</p>
]]></description><link>https://community.m5stack.com/topic/4810/m5stack-core2-how-to-load-custom-font</link><generator>RSS for Node</generator><lastBuildDate>Sat, 18 Apr 2026 10:20:28 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/4810.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 15 Nov 2022 14:32:58 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to M5Stack Core2, How to load Custom Font? on Mon, 05 Dec 2022 06:54:34 GMT]]></title><description><![CDATA[<p dir="auto">I'm not seeing any error message, the device just restarts.<br />
I've tried to use the following code instead (without calling <code>lcd.font</code>):</p>
<pre><code>lcd.compileFont("./valera.c")
label0 = M5Label('Hi', x=149, y=86, color=0x000, font=valera.fon, parent=None)
</code></pre>
<p dir="auto">While it doesn't cause restart the font isn't working (I've tried to search the generated files and <code>compileFont</code> doesn't seem to produce any <code>.fon</code> file, which shouldn't be the case)</p>
<p dir="auto"><strong>Side Note:</strong> my input <code>.c</code> file is less than 100 KB in size, as larger files caused crashes according to the comments in previous posts.</p>
]]></description><link>https://community.m5stack.com/post/19309</link><guid isPermaLink="true">https://community.m5stack.com/post/19309</guid><dc:creator><![CDATA[AhmadAgb]]></dc:creator><pubDate>Mon, 05 Dec 2022 06:54:34 GMT</pubDate></item><item><title><![CDATA[Reply to M5Stack Core2, How to load Custom Font? on Wed, 16 Nov 2022 07:07:37 GMT]]></title><description><![CDATA[<p dir="auto">What crash is it, what the error message?</p>
]]></description><link>https://community.m5stack.com/post/19308</link><guid isPermaLink="true">https://community.m5stack.com/post/19308</guid><dc:creator><![CDATA[ajb2k3]]></dc:creator><pubDate>Wed, 16 Nov 2022 07:07:37 GMT</pubDate></item></channel></rss>