* Fonts from specified directory
@ 2018-09-16 8:11 N. Raghavendra
2018-09-16 9:36 ` Yuri Khan
0 siblings, 1 reply; 7+ messages in thread
From: N. Raghavendra @ 2018-09-16 8:11 UTC (permalink / raw)
To: help-gnu-emacs
Is it possible to configure Emacs to use fonts from a specified
directory? My OS is Linux. For instance, I have downloaded a version
of DejaVu fonts that is more recent than the one provided by the OS, and
have installed the new fonts as, say, /foo/dejavu/DejaVu*.ttf. Is it
possible to configure Emacs to use /foo/dejavu/DejaVu*.ttf instead of
/usr/share/fonts/truetype/dejavu/DejaVu*.ttf?
Thanks,
Raghu.
--
N. Raghavendra <raghu@hri.res.in>, http://www.retrotexts.net/
Harish-Chandra Research Institute, http://www.hri.res.in/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Fonts from specified directory
2018-09-16 8:11 N. Raghavendra
@ 2018-09-16 9:36 ` Yuri Khan
2018-09-16 13:19 ` N. Raghavendra
0 siblings, 1 reply; 7+ messages in thread
From: Yuri Khan @ 2018-09-16 9:36 UTC (permalink / raw)
To: nyraghu27132, help-gnu-emacs
On Sun, Sep 16, 2018 at 3:12 PM N. Raghavendra <nyraghu27132@gmail.com> wrote:
> Is it possible to configure Emacs to use fonts from a specified
> directory? My OS is Linux. For instance, I have downloaded a version
> of DejaVu fonts that is more recent than the one provided by the OS, and
> have installed the new fonts as, say, /foo/dejavu/DejaVu*.ttf. Is it
> possible to configure Emacs to use /foo/dejavu/DejaVu*.ttf instead of
> /usr/share/fonts/truetype/dejavu/DejaVu*.ttf?
On fontconfig/GNU/Linux, font file locations are specified by
/etc/fonts/fonts.conf and configuration files included by it. See “man
fonts-conf” for details.
On my system (Ubuntu 16.04), the list goes like this:
* /usr/share/fonts (system-provided)
* /usr/local/share/fonts (locally administered system-wide)
* $XDG_DATA_HOME/fonts (user-specific)
* ~/.fonts (deprecated user-specific)
I don’t see a description of what happens when different versions of
the same font are available, but I’d expect user-specific to override
local and system, and local to override system.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Fonts from specified directory
[not found] <mailman.838.1537085537.1284.help-gnu-emacs@gnu.org>
@ 2018-09-16 9:43 ` Javier
2018-09-16 13:37 ` N. Raghavendra
0 siblings, 1 reply; 7+ messages in thread
From: Javier @ 2018-09-16 9:43 UTC (permalink / raw)
To: help-gnu-emacs
N. Raghavendra <nyraghu27132@gmail.com> wrote:
> Is it possible to configure Emacs to use fonts from a specified
> directory? My OS is Linux. For instance, I have downloaded a version
> of DejaVu fonts that is more recent than the one provided by the OS, and
> have installed the new fonts as, say, /foo/dejavu/DejaVu*.ttf. Is it
> possible to configure Emacs to use /foo/dejavu/DejaVu*.ttf instead of
> /usr/share/fonts/truetype/dejavu/DejaVu*.ttf?
/foo/dejavu/ should contain files fonts.dir, fonts.scale
Otherwise create them
mkfontscale /foo/dejavu/
mkfontdir /foo/dejavu/
change the font path
xset -fp /usr/share/fonts/truetype/dejavu/
xset +fp /foo/dejavu/
xset fp rehash
and try
emacs -fn fontname
The names are in fonts.dir
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Fonts from specified directory
2018-09-16 9:36 ` Yuri Khan
@ 2018-09-16 13:19 ` N. Raghavendra
2018-09-16 13:40 ` Yuri Khan
0 siblings, 1 reply; 7+ messages in thread
From: N. Raghavendra @ 2018-09-16 13:19 UTC (permalink / raw)
To: help-gnu-emacs
At 2018-09-16T16:36:02+07:00, Yuri Khan wrote:
> On Sun, Sep 16, 2018 at 3:12 PM N. Raghavendra <nyraghu27132@gmail.com> wrote:
>
>> Is it possible to configure Emacs to use fonts from a specified
>> directory? ...
>
> On fontconfig/GNU/Linux, font file locations are specified by
> /etc/fonts/fonts.conf and configuration files included by it. See “man
> fonts-conf” for details.
Thanks for the suggestion. Yes, I can use fontconfig to do it, but it
will force the settings on other applications too. I was wondering if
one can specify certain font directories just for Emacs. (For example,
one can do this with TeX and friends, by setting the environment
variable TEXFONTS.)
Regards,
Raghu.
--
N. Raghavendra <raghu@hri.res.in>, http://www.retrotexts.net/
Harish-Chandra Research Institute, http://www.hri.res.in/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Fonts from specified directory
2018-09-16 9:43 ` Fonts from specified directory Javier
@ 2018-09-16 13:37 ` N. Raghavendra
0 siblings, 0 replies; 7+ messages in thread
From: N. Raghavendra @ 2018-09-16 13:37 UTC (permalink / raw)
To: help-gnu-emacs
At 2018-09-16T09:43:26Z, Javier wrote:
> N. Raghavendra <nyraghu27132@gmail.com> wrote:
>> Is it possible to configure Emacs to use fonts from a specified
>> directory? ...
>
> /foo/dejavu/ should contain files fonts.dir, fonts.scale
> Otherwise create them
>
> mkfontscale /foo/dejavu/
> mkfontdir /foo/dejavu/
One can avoid these commands, e.g., by using Fontconfig patterns for the
fonts (https://www.gnu.org/software/emacs/manual/html_node/emacs/Fonts.html#index-fontconfig-1667).
In any case, your method changes the settings for other applications,
and I was looking for something which defines the settings just for
Emacs.
Regards,
Raghu.
--
N. Raghavendra <raghu@hri.res.in>, http://www.retrotexts.net/
Harish-Chandra Research Institute, http://www.hri.res.in/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Fonts from specified directory
2018-09-16 13:19 ` N. Raghavendra
@ 2018-09-16 13:40 ` Yuri Khan
2018-09-16 13:55 ` N. Raghavendra
0 siblings, 1 reply; 7+ messages in thread
From: Yuri Khan @ 2018-09-16 13:40 UTC (permalink / raw)
To: nyraghu27132, help-gnu-emacs
On Sun, Sep 16, 2018 at 8:20 PM N. Raghavendra <nyraghu27132@gmail.com> wrote:
> > On fontconfig/GNU/Linux, font file locations are specified by
> > /etc/fonts/fonts.conf and configuration files included by it. See “man
> > fonts-conf” for details.
>
> Thanks for the suggestion. Yes, I can use fontconfig to do it, but it
> will force the settings on other applications too. I was wondering if
> one can specify certain font directories just for Emacs. (For example,
> one can do this with TeX and friends, by setting the environment
> variable TEXFONTS.)
Why would you want to use updated fonts in Emacs but an older version
in other applications?
Anyway, try making a custom font configuration file to the lines of
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<include>/etc/fonts/fonts.conf</include>
<dir>/foo/dejavu</dir>
</fontconfig>
and starting Emacs with the FONTCONFIG_FILE environment variable
pointing at that.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Fonts from specified directory
2018-09-16 13:40 ` Yuri Khan
@ 2018-09-16 13:55 ` N. Raghavendra
0 siblings, 0 replies; 7+ messages in thread
From: N. Raghavendra @ 2018-09-16 13:55 UTC (permalink / raw)
To: help-gnu-emacs
At 2018-09-16T20:40:00+07:00, Yuri Khan wrote:
> Why would you want to use updated fonts in Emacs but an older version
> in other applications?
I don't have a good answer for that!
> ... and starting Emacs with the FONTCONFIG_FILE environment variable
> pointing at that.
Thanks for telling me about that environment variable. I'll try using
it.
Regards,
Raghu.
--
N. Raghavendra <raghu@hri.res.in>, http://www.retrotexts.net/
Harish-Chandra Research Institute, http://www.hri.res.in/
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2018-09-16 13:55 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <mailman.838.1537085537.1284.help-gnu-emacs@gnu.org>
2018-09-16 9:43 ` Fonts from specified directory Javier
2018-09-16 13:37 ` N. Raghavendra
2018-09-16 8:11 N. Raghavendra
2018-09-16 9:36 ` Yuri Khan
2018-09-16 13:19 ` N. Raghavendra
2018-09-16 13:40 ` Yuri Khan
2018-09-16 13:55 ` N. Raghavendra
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).