<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>linux on
A Scripter's Notes</title><link>https://scripter.co/categories/linux/</link><description>Recent content in linux
on A Scripter's Notes</description><language>en-us</language><managingEditor>kaushal.modi@gmail.com (Kaushal Modi)</managingEditor><webMaster>kaushal.modi@gmail.com (Kaushal Modi)</webMaster><lastBuildDate>Wed, 22 Apr 2026 08:24:58 -0400</lastBuildDate><generator>Hugo -- gohugo.io</generator><docs>https://validator.w3.org/feed/docs/rss2.html</docs><atom:link href="https://scripter.co/categories/linux/index.xml" rel="self" type="application/rss+xml"/><item><title>Installing custom fonts in Linux</title><link>https://scripter.co/installing-custom-fonts-in-linux/</link><description>&lt;p>I&amp;rsquo;ll step through how to set custom fonts for xterm terminal. My default shell is &lt;code>tcsh&lt;/code>.&lt;/p>
&lt;ol>
&lt;li>Create a folder &lt;code>.fonts&lt;/code> in your $HOME directory.&lt;/li>
&lt;li>Download fonts of your choice (&lt;strong>ttf&lt;/strong> or &lt;strong>otf&lt;/strong> format to ~/.fonts).&lt;/li>
&lt;li>Refresh the fonts cache with &lt;code>fc-cache -fv&lt;/code>.&lt;/li>
&lt;li>You can verify if your custom fonts got added to the cache using &lt;code>fc-list&lt;/code>. For example, I would do &lt;code>fc-list -f &amp;quot;%{family}\n&amp;quot; | sort -u | grep 'Inconsolata'&lt;/code>&lt;sup id="fnref:1">&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref">1&lt;/a>&lt;/sup> to check if my downloaded Inconsolata fonts got into the font cache.&lt;/li>
&lt;li>Add the below .Xdefaults snippet to your &lt;code>~/.Xdefaults&lt;/code>&lt;/li>
&lt;li>Add &lt;code>xrdb -merge $HOME/.Xdefaults&lt;/code> to your shell init script. &lt;em>My shell init script is &lt;code>~/.alias&lt;/code>&lt;/em>.&lt;/li>
&lt;/ol>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-text" data-lang="text">&lt;span class="line">&lt;span class="cl">*customization: -color
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">XTerm*termName: xterm-256color
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">xterm*saveLines: 500
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">xterm*scrollBar: false
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">xterm*cursorColor: white
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">xterm*pointerColor: white
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">xterm*Foreground: white
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">xterm*Background: black
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">xterm*c132: true
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">xterm*loginShell: false
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">! Fonts
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">! XTerm*faceName: DejaVu Sans Mono:size=11
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">! XTerm*faceName: Inconsolata:size=11
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">! XTerm*faceName: Inconsolata\\-dz:style=dz:size=11
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">XTerm*faceName: Inconsolata\\-g:style=g:size=11
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Done! Now source your shell init script and launch &lt;code>xterm&lt;/code>.&lt;/p>
&lt;p>&lt;strong>Note&lt;/strong>: In order to use font names with hyphens in them, I had to escape them by using &lt;code>\\&lt;/code>. So for the &lt;code>Inconsolata-g&lt;/code> font, I have &lt;code>XTerm*faceName: Inconsolata\\-g:style=g:size=11&lt;/code>.&lt;/p>
&lt;p>It might be helpful to add the below aliases to your tcsh init script for quick font refresh and check, using &lt;code>fontsrefresh; fontsavail | grep 'Inconsolata'&lt;/code>.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-tcsh" data-lang="tcsh">&lt;span class="line">&lt;span class="cl">&lt;span class="nb">alias &lt;/span>fontsavail &lt;span class="s1">&amp;#39;fc-list -f &amp;#34;%{family}\n&amp;#34; | sort -u&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nb">alias &lt;/span>fontsrefresh &lt;span class="s1">&amp;#39;fc-cache -fv&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;div class="footnotes" role="doc-endnotes">
&lt;hr>
&lt;ol>
&lt;li id="fn:1">
&lt;p>You can download Inconsolata font from &lt;a href="http://levien.com/type/myfonts/inconsolata.html">here&lt;/a>.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink">&amp;#x21a9;&amp;#xfe0e;&lt;/a>&lt;/p>
&lt;/li>
&lt;/ol>
&lt;/div></description><category domain="https://scripter.co/categories/font">font</category><category domain="https://scripter.co/categories/linux">linux</category><category domain="https://scripter.co/categories/xterm">xterm</category><category domain="https://scripter.co/categories/tcsh">tcsh</category><guid>https://scripter.co/installing-custom-fonts-in-linux/</guid><pubDate>Thu, 27 Mar 2014 13:42:19 -0400</pubDate></item></channel></rss>