<?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[Font for non-latin characters]]></title><description><![CDATA[<p dir="auto">Hi.</p>
<p dir="auto">I have Open Sans Condensed Thin for my primary font, which is fine for Latin characters. But I don’t like the font for Korean characters in the primary fontset.  So want to create a custom.css which should use the primary font for Latin letters but a different font (Noto Sans KR) for Korean.<br />
Both are installed in the /usr/share/font directory of my RPI5.</p>
<p dir="auto">So I have tried several options of which none were working. Please correct me as I am not familiar with the font-face command.<br />
The 2 last options were suggestions from ChatGPT…</p>
<p dir="auto">Option 1:</p>
<pre><code>@font-face {
  font-family: 'korean';
  src: local('Noto Sans KR');
  unicode-range: U+110-11FF, U+3130-318F, AC00-FFFD;
}

@font-face {
  font-family: 'korean';
  src: local('Open Sans Condensed Light');
  unicode-range: U+0000-017F;
}  

body {
  font-family: 'korean';
}
</code></pre>
<p dir="auto">Option 2:</p>
<pre><code>/* Define font face for Noto Sans KR */
@font-face {
  font-family: 'Noto Sans KR';
  src: local('Noto Sans KR'), url('path/to/noto-sans-kr.woff2') format('woff2'); /* Adjust the path to your font file */
}

/* Define font face for Open Sans Condensed */
@font-face {
  font-family: 'Open Sans Condensed';
  src: local('Open Sans Condensed'), url('path/to/open-sans-condensed.woff2') format('woff2'); /* Adjust the path to your font file */
}

/* Apply Noto Sans KR to Korean text */
html[lang="ko-KR"] body {
  font-family: 'Noto Sans KR', sans-serif;
}

/* Apply Open Sans Condensed to non-Korean text */
body:not([lang="ko-KR"]) {
  font-family: 'Open Sans Condensed', sans-serif;
}

</code></pre>
<p dir="auto">Option 3:</p>
<pre><code>/* Define font face for Noto Sans KR */
@font-face {
  font-family: 'Noto Sans KR';
  src: local('Noto Sans KR'), url('path/to/noto-sans-kr.woff2') format('woff2'); /* Adjust the path to your font file */
}

/* Define font face for Open Sans Condensed */
@font-face {
  font-family: 'Open Sans Condensed';
  src: local('Open Sans Condensed'), url('path/to/open-sans-condensed.woff2') format('woff2'); /* Adjust the path to your font file */
}

/* Apply Open Sans Condensed by default */
body {
  font-family: 'Open Sans Condensed', sans-serif;
}

/* Apply Noto Sans KR to Korean text within English content */
body:lang(en-GB)::before,
body:lang(en)::before,
body:lang(en-US)::before {
  content: attr(data-korean);
  font-family: 'Noto Sans KR', sans-serif;
}

</code></pre>
]]></description><link>https://forum.magicmirror.builders/topic/18737/font-for-non-latin-characters</link><generator>RSS for Node</generator><lastBuildDate>Wed, 10 Jun 2026 19:22:59 GMT</lastBuildDate><atom:link href="https://forum.magicmirror.builders/topic/18737.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 14 May 2024 19:12:10 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Font for non-latin characters on Wed, 22 May 2024 19:07:12 GMT]]></title><description><![CDATA[<p dir="auto">Thanks <a class="plugin-mentions-user plugin-mentions-a" href="/user/mmrize" aria-label="Profile: MMRIZE">@<bdi>MMRIZE</bdi></a>  and <a class="plugin-mentions-user plugin-mentions-a" href="/user/karsten13" aria-label="Profile: karsten13">@<bdi>karsten13</bdi></a> !</p>
<p dir="auto">I have tried following your instructions but it didn’t help.<br />
I figured out it’s hidden in the modules css-file. I should have thought about that beforehand.<br />
When I change the font as suggested by <a class="plugin-mentions-user plugin-mentions-a" href="/user/mmrize" aria-label="Profile: MMRIZE">@<bdi>MMRIZE</bdi></a> to set as</p>
<pre><code>font-family: 'Open Sans Condensed', 'Noto Sans KR';
</code></pre>
<p dir="auto">It works now.</p>
<p dir="auto">Thanks guys!<br />
Case closed!</p>
]]></description><link>https://forum.magicmirror.builders/post/117905</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/117905</guid><dc:creator><![CDATA[jv2007]]></dc:creator><pubDate>Wed, 22 May 2024 19:07:12 GMT</pubDate></item><item><title><![CDATA[Reply to Font for non-latin characters on Tue, 14 May 2024 21:30:51 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jv2007" aria-label="Profile: jv2007">@<bdi>jv2007</bdi></a><br />
If you want to use <code>@font-face</code>, you can use like this;</p>
<pre><code class="language-css">@font-face {
  font-family: 'korean';
  src: url('./notosans.ttf') format('truetype');
  unicode-range: U+AC00-FFDD;
}

@font-face {
    font-family: 'english';
    src: url('./opensanscondensed.ttf') format('truetype');
}

div.test {
    font-family: 'korean', 'english';
}
</code></pre>
<blockquote>
<p dir="auto"><img src="/assets/uploads/files/1715722242438-9e04b138-2e5b-4a9b-9dcc-d087d1b2988f-image.png" alt="9e04b138-2e5b-4a9b-9dcc-d087d1b2988f-image.png" class=" img-fluid img-markdown" /></p>
</blockquote>
]]></description><link>https://forum.magicmirror.builders/post/117766</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/117766</guid><dc:creator><![CDATA[MMRIZE]]></dc:creator><pubDate>Tue, 14 May 2024 21:30:51 GMT</pubDate></item><item><title><![CDATA[Reply to Font for non-latin characters on Tue, 14 May 2024 21:02:06 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jv2007" aria-label="Profile: jv2007">@<bdi>jv2007</bdi></a></p>
<p dir="auto">you can take a look at <code>&lt;mm-folder&gt;/fonts/roboto.css</code> where the mm fonts are defined</p>
]]></description><link>https://forum.magicmirror.builders/post/117765</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/117765</guid><dc:creator><![CDATA[karsten13]]></dc:creator><pubDate>Tue, 14 May 2024 21:02:06 GMT</pubDate></item><item><title><![CDATA[Reply to Font for non-latin characters on Tue, 14 May 2024 21:31:26 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jv2007" aria-label="Profile: jv2007">@<bdi>jv2007</bdi></a><br />
But, more simple way is; just use this;</p>
<pre><code class="language-css">body {
  font-family: 'Open Sans Condensed', 'Noto Sans KR';
}
</code></pre>
<p dir="auto"><code>Open Sans Condensed</code> font doesn’t have any Korean characters, so when the renderer meet Korean chars, the second fallback <code>Noto Sans KR</code> would be applied instead of <code>Open Sans Condensed</code>.</p>
<blockquote>
<p dir="auto"><img src="/assets/uploads/files/1715720444630-5dad8c9d-2cf0-4c04-a3e7-542682a1f0d8-image.png" alt="5dad8c9d-2cf0-4c04-a3e7-542682a1f0d8-image.png" class=" img-fluid img-markdown" /></p>
</blockquote>
]]></description><link>https://forum.magicmirror.builders/post/117764</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/117764</guid><dc:creator><![CDATA[MMRIZE]]></dc:creator><pubDate>Tue, 14 May 2024 21:31:26 GMT</pubDate></item><item><title><![CDATA[Reply to Font for non-latin characters on Tue, 14 May 2024 20:28:51 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jv2007" aria-label="Profile: jv2007">@<bdi>jv2007</bdi></a><br />
Option 1 is almost right, but each font-face needs to have a different name.<br />
Option 2 or 3 seems something related to lang attribute. If your content has explicit lang attribute on the element, it might be work, but, as far as I understand, that might not be your thing.</p>
]]></description><link>https://forum.magicmirror.builders/post/117763</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/117763</guid><dc:creator><![CDATA[MMRIZE]]></dc:creator><pubDate>Tue, 14 May 2024 20:28:51 GMT</pubDate></item></channel></rss>