<?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[Determine the width of a character]]></title><description><![CDATA[<p dir="auto">How can I determine the width of a character from the freefonts? I tried: "M5. Lcd.width('W',myfont)<br />
This reported that width is not known.</p>
]]></description><link>https://community.m5stack.com/topic/1773/determine-the-width-of-a-character</link><generator>RSS for Node</generator><lastBuildDate>Tue, 10 Mar 2026 09:50:51 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/1773.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 18 Mar 2020 09:17:44 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Determine the width of a character on Wed, 18 Mar 2020 11:36:04 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/3069">@hansim</a></p>
<p dir="auto">in the this lib file , you can find the str width  return function:</p>
<p dir="auto"><a href="https://github.com/m5stack/M5Stack/blob/master/src/utility/In_eSPI.h" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/m5stack/M5Stack/blob/master/src/utility/In_eSPI.h</a></p>
<pre><code>  int16_t  textWidth(const char *string, uint8_t font),
           textWidth(const char *string),
           textWidth(const String&amp; string, uint8_t font),
           textWidth(const String&amp; string),
           fontHeight(int16_t font),
           fontHeight(void);
</code></pre>
]]></description><link>https://community.m5stack.com/post/7811</link><guid isPermaLink="true">https://community.m5stack.com/post/7811</guid><dc:creator><![CDATA[m5stack]]></dc:creator><pubDate>Wed, 18 Mar 2020 11:36:04 GMT</pubDate></item><item><title><![CDATA[Reply to Determine the width of a character on Wed, 18 Mar 2020 11:12:45 GMT]]></title><description><![CDATA[<p dir="auto">I think there's a translation error here: I want to read the width of the characters. (Google translated :-))</p>
<p dir="auto">I can determine the size of the characters. With FreeFonts, not all characters are the same width. An "i" is narrower than an "M".<br />
Since I want to split my screen into two areas, the left part should not write in the right part. If I can read the width of the characters, I know when to start a new line.</p>
]]></description><link>https://community.m5stack.com/post/7810</link><guid isPermaLink="true">https://community.m5stack.com/post/7810</guid><dc:creator><![CDATA[HansIm]]></dc:creator><pubDate>Wed, 18 Mar 2020 11:12:45 GMT</pubDate></item></channel></rss>