<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-us"><generator uri="https://gohugo.io/" version="0.101.0">Hugo</generator><title type="html">font on A Scripter's Notes</title><subtitle type="html">Emacs, scripting and anything text oriented.</subtitle><link href="https://scripter.co/tags/font/" rel="alternate" type="text/html" title="HTML"/><link href="https://scripter.co/tags/font/index.xml" rel="alternate" type="application/rss+xml" title="RSS"/><link href="https://scripter.co/tags/font/atom.xml" rel="self" type="application/atom+xml" title="Atom"/><link href="https://scripter.co/tags/font/jf2feed.json" rel="alternate" type="application/jf2feed+json" title="jf2feed"/><updated>2026-04-22T08:24:58-04:00</updated><author><name>Kaushal Modi</name><email>kaushal.modi@gmail.com</email></author><id>https://scripter.co/tags/font/</id><entry><title type="html">Gujarati fonts in Emacs</title><link href="https://scripter.co/gujarati-fonts-in-emacs/?utm_source=atom_feed" rel="alternate" type="text/html"/><link href="https://scripter.co/emacs-lisp-advice-combinators/?utm_source=atom_feed" rel="related" type="text/html" title="Emacs Lisp: Advice Combinators"/><link href="https://scripter.co/org-show-only-post-subtree-headings/?utm_source=atom_feed" rel="related" type="text/html" title="Org: Show only Post subtree headings"/><link href="https://scripter.co/firefox-always-open-a-new-tab-after-current/?utm_source=atom_feed" rel="related" type="text/html" title="Firefox: Always open a New Tab after Current"/><link href="https://scripter.co/saving-python-pip-dependencies/?utm_source=atom_feed" rel="related" type="text/html" title="Saving Python pip dependencies"/><link href="https://scripter.co/disarming-the-tar-bomb-in-10-seconds/?utm_source=atom_feed" rel="related" type="text/html" title="Disarming the 'tar' bomb in 10 seconds"/><id>https://scripter.co/gujarati-fonts-in-emacs/</id><author><name>Kaushal Modi</name></author><published>2022-06-19T01:31:00-04:00</published><updated>2022-06-19T01:31:00-04:00</updated><content type="html"><![CDATA[<blockquote>Setting a different font for a specific script or language in Emacs.</blockquote><div class="ox-hugo-toc toc">
<div class="heading">Table of Contents</div>
<ul>
<li><a href="#setting-a-fontset-font">Setting a &ldquo;fontset&rdquo; font</a></li>
<li><a href="#gujarati-fonts">Gujarati fonts</a></li>
</ul>
</div>
<!--endtoc-->
<p>All Emacs versions ship with a nifty <strong>HELLO</strong> file that you can quickly
open using <code>M-x view-hello-file</code> or its default binding <code>C-h h</code>. This
file lists &ldquo;Hello&rdquo; written in dozens of languages to demonstrate some
of the character sets supported by Emacs.</p>
<p><a id="figure--hello-buffer"></a></p>



<figure>
    <a href="hello.png">
        <img src="https://scripter.co/gujarati-fonts-in-emacs/hello.png" alt="Figure 1: &ldquo;Hello&rdquo; buffer in Emacs"/> </a><figcaption>
                <p>
                    <span class="figure-number">Figure 1: </span>&ldquo;Hello&rdquo; buffer in Emacs
                    
                        
                        </p>
                
            </figcaption></figure>

<p>Born and raised in the Gujarat state in India, I grew up
speaking the <a href="https://en.wikipedia.org/wiki/Gujarati_language">Gujarati (ગુજરાતી)</a> language
<span class="sidenote-number"><small class="sidenote">
India officially recognizes <a href="https://en.wikipedia.org/wiki/Languages_of_India">22 languages</a> (as of <span class="timestamp-wrapper"><span class="timestamp">&lt;2022-06-19 Sun&gt;</span></span>) and
Gujarati is one of them.
</small></span>
and so it&rsquo;s also the language closest to my heart. So I was pleasantly
surprised to see a representation of Gujarati in the &ldquo;Hello&rdquo; buffer!
In the above screenshot, in the &ldquo;South Asia&rdquo; section, the script after
the yellow cursor is Gujarati, and it reads <em>namaste</em>.</p>

<h2 id="setting-a-fontset-font">Setting a &ldquo;fontset&rdquo; font&nbsp;<a class="headline-hash no-text-decoration" href="#setting-a-fontset-font">#</a></h2>


<p>It was on <span class="timestamp-wrapper"><span class="timestamp">&lt;2018-08-13 Mon&gt; </span></span> that I discovered the presence of Gujarati
script in that &ldquo;Hello&rdquo; buffer, and the reason I know that exact date
is because I had <a href="https://lists.gnu.org/r/help-gnu-emacs/2018-08/msg00033.html">asked a question</a> regarding that on the
<em>help-gnu-emacs</em> mailing list 😃.</p>
<p>This was the time when Emacs was using the <a href="https://www.nongnu.org/m17n/">m17n</a> library for
multi-lingual font rendering by default. The question was regarding a
font rendering issue I was seeing. As I learn later in that thread, it
was because I didn&rsquo;t have the m17n database installed on my machine
<span class="sidenote-number"><small class="sidenote">
At least in 2022, the <a href="https://github.com/harfbuzz/harfbuzz">harfbuzz</a> library is the recommended library for
text shaping and font rendering. Someone please correct me if that&rsquo;s
wrong. In any case, I have switched to using <em>harfbuzz</em> instead of
<em>m17n</em> for a while now and haven&rsquo;t found any font-rendering issues
with non-English scripts.
</small></span>
. But it&rsquo;s in that support thread that, thanks to <em>Andy Moreton</em>, I
learned that you can change the font for the Gujarati script using
<code>set-fontset-font</code>.</p>
<p>This applies in general to any script. You can read more details about
this function in <a href="https://www.gnu.org/software/emacs/manual/html_node/emacs/Modifying-Fontsets.html" title="Emacs Lisp: (info &quot;(emacs) Modifying Fontsets&quot;)">Emacs Info: Modifying Fontsets</a>, but here&rsquo;s the gist:</p>
<p><a id="code-snippet--gujarati-set-fontset-font"></a></p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-emacs-lisp" data-lang="emacs-lisp"><span class="line"><span class="cl"><span class="p">(</span><span class="nf">set-fontset-font</span> <span class="s">&#34;fontset-default&#34;</span> <span class="ss">&#39;gujarati</span> <span class="s">&#34;&lt;FONT NAME&gt;&#34;</span><span class="p">)</span>
</span></span></code></pre></div><div class="src-block-caption">
  <span class="src-block-number"><a href="#code-snippet--gujarati-set-fontset-font">Code Snippet 1</a>:</span>
  Setting default font for Gujarati script using <code>set-fontset-font</code>
</div>
<p>That led me down the path of exploring the available Gujarati fonts
out there ..</p>

<h2 id="gujarati-fonts">Gujarati fonts&nbsp;<a class="headline-hash no-text-decoration" href="#gujarati-fonts">#</a></h2>


<p>After looking around for a bit, I found a wonderful <a href="https://github.com/samyakbhuta/chhapkaam/wiki/%E0%AA%97%E0%AB%81%E0%AA%9C%E0%AA%B0%E0%AA%BE%E0%AA%A4%E0%AB%80-%E0%AA%AF%E0%AB%81%E0%AA%A8%E0%AA%BF%E0%AA%95%E0%AB%8B%E0%AA%A1-%E0%AA%AB%E0%AB%8B%E0%AA%A8%E0%AB%8D%E0%AA%9F-%E0%AA%B8%E0%AB%82%E0%AA%9A%E0%AB%80---List-of-Gujarati-Unicode-Fonts">collection of
Gujarati fonts</a> in this GitHub repository:
<a href="https://github.com/samyakbhuta/chhapkaam">github.com/samyakbhuta/chhapkaam</a>
<span class="sidenote-number"><small class="sidenote">
The repo name is <em>chhapkaam</em> (I
would have spelled it as <em>chhaapkaam</em>) which is the Gujarati word
છાપકામ, meaning &ldquo;printing&rdquo;.
</small></span>
.</p>
<p>Below is my further curated list of fonts from the above list:</p>
<p><a id="table--gujarati-fonts"></a></p>
<div class="table-caption">
  <span class="table-number"><a href="#table--gujarati-fonts">Table 1</a>:</span>
  Gujarati Fonts
</div>
<table>
<thead>
<tr>
<th>Font Name</th>
<th><em>Namaste</em></th>
<th>Category</th>
<th>Homepage</th>
<th>Download</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>Shruti</strong></td>
<td><img src="namaste_shruti.png" alt=""></td>
<td>serif</td>
<td></td>
<td><a href="https://www.wfonts.com/font/shruti">wfonts.com</a></td>
</tr>
<tr>
<td><strong>Mukta Vaani</strong></td>
<td><img src="namaste_mukta_vaani.png" alt=""></td>
<td>serif</td>
<td><a href="https://ektype.in/scripts/gujarati/mukta-vaani.html">Ek Type &ndash; Mukta Vaani</a></td>
<td><a href="https://github.com/EkType/Mukta/releases">GitHub</a></td>
</tr>
<tr>
<td><strong>Lohit Gujarati</strong></td>
<td><img src="namaste_lohit.png" alt=""></td>
<td>sans serif</td>
<td><a href="https://pagure.io/lohit">Pagure &ndash; Lohit</a></td>
<td><a href="https://releases.pagure.org/lohit/">pagure releases</a></td>
</tr>
</tbody>
</table>
<p>To use these fonts, after downloading and installing them on your
system, evaluate <a href="#code-snippet--gujarati-set-fontset-font">Code Snippet 1</a> above with the
correct &ldquo;FONT NAME&rdquo;. For example, to set the Gujarati text to use the
<em>Shruti</em> font, evaluate <code class="code-inline language-emacs-lisp"><span class="p">(</span><span class="nf">set-fontset-font</span> <span class="s">&#34;fontset-default&#34;</span> <span class="ss">&#39;gujarati</span> <span class="s">&#34;Shruti&#34;</span><span class="p">)</span></code>.</p>
<p>Thanks for reading (વાંચવા બદલ આભાર) 🙏!</p>
]]></content><category scheme="https://scripter.co/categories/emacs" term="emacs" label="emacs"/><category scheme="https://scripter.co/series/gujarati-in-emacs" term="gujarati-in-emacs" label="Gujarati in Emacs"/><category scheme="https://scripter.co/tags/gujarati" term="gujarati" label="gujarati"/><category scheme="https://scripter.co/tags/font" term="font" label="font"/><category scheme="https://scripter.co/tags/100daystooffload" term="100daystooffload" label="100DaysToOffload"/></entry></feed>