Re: Fonts: DejaVu vs Noto

From: Tijl Coosemans <tijl_at_FreeBSD.org>
Date: Fri, 06 Oct 2023 13:41:29 UTC
On Fri, 6 Oct 2023 09:51:29 +0200 Andrea Venturoli <ml@netfence.it> wrote:
> Hello.
> 
> I've got some software (e.g. xfce4-terminal) set to use "Monospace" 
> font: this used to map to "DejaVu" font on 2023Q3 port tree; however, 
> after the upgrade to 2023Q4, it now mats to "Noto".
> 
> Before (Q3):
>> % fc-match Monospace
>> DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book"  
> After (Q4):
>> % fc-match Monospace
>> NotoSansMono-Regular.ttf: "Noto Sans Mono" "Regular"  
> 
> I read about the change stemming from Fedora up to fontconfig...
> Fine.
> 
> 
> 
> However, in some situation I really want DejaVu instead of Noto: I 
> thought specifying it explicitly would solve, but it doesn't.
> 
> Before (Q3):
>> % fc-match DevaVu
>> DejaVuSans.ttf: "DejaVu Sans" "Book"  
> After (Q4):
>> % fc-match DejaVu
>> NotoSans-Regular.ttf: "Noto Sans" "Regular"  
> 
> This puzzles me and piss me off.
> I can I tell the system not to override my choice?
> 
>   bye & Thanks in advance
> 	av.
> 
> P.S.
> Of course I have dejavu-2.37_3 installed.

It looks like fc-match returns exact matches only and default
sans-serif otherwise.  So you have to run fc-match 'DejaVu Sans'.

You can override the default sans-serif font system-wide by creating
/usr/local/etc/fonts/local.conf and per user by creating
~/.config/fontconfig/fonts.conf with the following content:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<fontconfig>
  <description>Set preferable fonts for Latin</description>
	<alias>
		<family>sans-serif</family>
		<prefer>
			<family>DejaVu Sans</family>
		</prefer>
	</alias>
</fontconfig>