From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Sergey Organov Newsgroups: gmane.emacs.help Subject: Re: How to enforce unicode font for all charsets? Date: Wed, 11 Mar 2020 08:10:39 +0300 Message-ID: <87a74niii8.fsf@osv.gnss.ru> References: <874kuwphsz.fsf@osv.gnss.ru> <83wo7s9sgt.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="121785"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Mar 11 06:23:05 2020 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jBtpg-000VVd-DP for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 11 Mar 2020 06:23:04 +0100 Original-Received: from localhost ([::1]:44260 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jBtpf-0007es-FG for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 11 Mar 2020 01:23:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59288) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jBtdp-0007vL-Sj for help-gnu-emacs@gnu.org; Wed, 11 Mar 2020 01:10:52 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jBtdo-0004LH-Ih for help-gnu-emacs@gnu.org; Wed, 11 Mar 2020 01:10:49 -0400 Original-Received: from mail.javad.com ([54.86.164.124]:48577) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jBtdm-0004Aq-DA; Wed, 11 Mar 2020 01:10:46 -0400 Original-Received: from osv (unknown [89.175.180.246]) by mail.javad.com (Postfix) with ESMTPSA id AFB523E8CB; Wed, 11 Mar 2020 05:10:41 +0000 (UTC) Authentication-Results: mail.javad.com; dkim=pass (1024-bit key; unprotected) header.d=javad.com header.i=@javad.com header.b=O80hU4Av; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=javad.com; s=default; t=1583903442; bh=SZdFWEJEBpUu04bgyJUAe/+5zmI9/vKMIz6mNtvtfIs=; h=Received:From:To:Subject; b=O80hU4Avuseiyc2vlDk8WQbONOKu6q5A1aInDbPrMOdtlzszHYnIUN8IM5+PLbLaN ipqbRrv9Vn5e3K4dALjf8ejXCRKHu0jiRsL8PdVSZzFD+Lnu20KYI9KoktWY+fm8t9 aekGnhVS41aMwc61hVEU9RdQ0SG/3TyQn6YGuJHU= Authentication-Results: ip-172-31-2-110; spf=pass (sender IP is 89.175.180.246) smtp.mailfrom=osv@javad.com smtp.helo=osv Received-SPF: pass (ip-172-31-2-110: connection is authenticated) Original-Received: from osv by osv with local (Exim 4.92) (envelope-from ) id 1jBtdf-0005uk-7C; Wed, 11 Mar 2020 08:10:39 +0300 In-Reply-To: <83wo7s9sgt.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 10 Mar 2020 16:48:02 +0200") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 54.86.164.124 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:122561 Archived-At: Eli Zaretskii writes: >> From: Sergey Organov >> Date: Tue, 10 Mar 2020 14:31:40 +0300 >> >> When there is some particular charset property on text, Emacs chooses >> to render it using font that has corresponding encoding, such as: >> >> x:-xos4-terminus-medium-r-normal--24-240-72-72-c-120-microsoft-cp1251 >> >> for windows-1251 charset. >> >> When there is no charset property, the font being used to display the >> same character is: >> >> xft:-PfEd-DejaVu Sans Mono-normal-normal-normal-*-23-*-*-*-m-0-iso10646-1 >> >> I'd like the latter font to be always used, no matter if and what charset >> property is active. How do I achieve this goal? > > Customize your fontset to specify that font for the charset for which > Emacs by default doesn't use it. You will have to add charsets as you > find them, there's no useful way of specifying a font for all of > them. Thanks, I was thinking along these lines indeed. The problem is I can't figure how exactly do I do it, provided the DejaVu Sans Mono is the font currently being set through M-x customize-face RET default, and I don't want to loose the ability to change this way the (only) font I'd like to use. I mean, it looks like I need to modify fontset-auto1, as M-x describe-fontset RET shows: Fontset: -PfEd-DejaVu Sans Mono-normal-normal-normal-*-23-*-*-*-m-0-fontset-auto1 [...] and after some more digging, I finally tried: (set-fontset-font "fontset-auto1" 'windows-1251 (font-xlfd-name (face-attribute 'default :font)) which evaluates to: "-PfEd-DejaVu Sans Mono-normal-normal-normal-*-23-*-*-*-m-0-iso10646-1" but doesn't seem to have any visible effect. And even if that worked, it wouldn't immediately pick subsequent customization of the default face anyway? What do I miss? > Moreover, specifying that font for any charset is probably not > a good idea, since no font covers all of Unicode. Maybe I should be able to express exactly this by specifying, say, "preferred font" for a fontset? I mean: "use this font, unless there is no suitable glyph, in which case turn back to the fancy methods of considering charsets". Actually, I probably do want to use only this font (and have empty rectangles or some such in case of missed glyphs). I mean some way to force Emacs to behave as if this font is the only available font in the entire system. Still no simple way? -- Sergey