From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id CMNPCLWT+GSnFQAAG6o9tA:P1 (envelope-from ) for ; Wed, 06 Sep 2023 16:59:01 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id CMNPCLWT+GSnFQAAG6o9tA (envelope-from ) for ; Wed, 06 Sep 2023 16:59:01 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 20DD63BE24 for ; Wed, 6 Sep 2023 16:59:00 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=BFKhTNV0; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1694012341; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=G1/a9iJyZ+fA4ebDPk6GiLgfl1nhjgXJf1sMwFaLnwo=; b=NUWmm/rMHky7kHSw2z8AO4RAgtDWosImLEdb2SXO7QPDSX+5CF54op4oWc/g4sjhLaEP4i U7Cazcd9XoFYbpfhEYhic61RJYG5LglbZBM2pkL/MA+t7Pni5JyKZnOyFhjK5SuAPTLxiF SI1xFnB1plRVMbAtQIb5VN5XK2MS4JLnbYRl/aj5pUXX26qcNucIGEf15qyYPXmE3qkGUv x0hC4NFlnQc8YlcD1SH5l9SfUrnS/YnxXcRZakJhBCY93+GDSunNoSKBK/tyKZZKZDmIXX PCNSvdTHXtb9+4Ok1yguwO1LKA1pktEAhB5Cv1m18t+9yAfDDbOCMFw+i2uHEQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=BFKhTNV0; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net ARC-Seal: i=1; s=key1; d=yhetil.org; t=1694012341; a=rsa-sha256; cv=none; b=c55RgFSMnHXtq2NjpYyRKL5ii2gDujSIQMA3oZrfSaQgyu0eMJBniCqq/5LQn2ATxjHF0J FiG3Ym0mxyAQW81Peh+x6x71LEoQ5VsmKJczsZjmvcd7YUEYfRLB1XHOdb3GGLhXxwT8Wm 2Zm3GrgPcHUB2+sM+KABnRY/iRGme5b4We76i5gIBQTMIsafXN4kuMtz0P2Onw1EJeqAVk rWB+n7DHkeGGYk50vuZB5iE6SxzM2e4QJeiyAh34iYZFQBFZOsl6wG4Tz0MOcq4R5/2+TB ypNPL9iZ2wE68mvyTU0EFz/ZfXkC5p2ns+X0voyT57Dr6iW4W3oOm5aMrwTm1w== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qdtzH-00076C-5r; Wed, 06 Sep 2023 10:58:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qdtzF-00075m-JX for emacs-orgmode@gnu.org; Wed, 06 Sep 2023 10:58:33 -0400 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qdtzA-0001hF-H2 for emacs-orgmode@gnu.org; Wed, 06 Sep 2023 10:58:33 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 090D3240029 for ; Wed, 6 Sep 2023 16:58:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1694012305; bh=V/29YctKG9hDLzMQeGehOaQyUUNfNqd1wbiocYzN01E=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=BFKhTNV0El/o2gXsM/rBWagVaeq5GVqh6BSqcZhcqjaSqaoludc/bXJOrQKM7pC5Q Ggno2tVqB8ttbDlGL22xVYwRFM+XrfspG+8m+xS8WcsWAWj/+Fq/RgVlaZLXgTIBD/ yef4usLzB3XljXBl0yAzOVrCHvF+V4g3CFgKtEvdSJlIxuK+MuEkhdI25rtOt2EHT0 uHcqSgqDtihhU+EbcX+rWc/WjyQi//8afgoYoSobYfWSrjnKAGsQ3scMnIFzBAt3WF InFGl7uo5dxWWWcJExeEynxkbvwcCNVEDC6nGscLwO8sLQV58lrFUid238vnaej8vK 1ODvbV41aeDpw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Rglqh3K7jz6tm4; Wed, 6 Sep 2023 16:58:24 +0200 (CEST) From: =?utf-8?Q?Juan_Manuel_Mac=C3=ADas?= To: Ihor Radchenko Cc: Max Nikulin , emacs-orgmode@gnu.org, Ihor Radchenko Subject: Re: Fallback fonts in LaTeX export for non latin scripts In-Reply-To: <87a5tztzth.fsf@localhost> (Ihor Radchenko's message of "Wed, 06 Sep 2023 09:29:14 +0000") References: <878r9t7x7y.fsf@posteo.net> <87wmxbvd60.fsf@localhost> <877cpb8mkd.fsf@posteo.net> <877cpatfol.fsf@localhost> <878r9ocl17.fsf@posteo.net> <87bkejoh4l.fsf@localhost> <87il8ra554.fsf@posteo.net> <87jzt6weae.fsf@localhost> <87bkehshni.fsf@posteo.net> <874jk8xyfz.fsf@posteo.net> <87a5tztzth.fsf@localhost> Date: Wed, 06 Sep 2023 14:58:22 +0000 Message-ID: <8734zrgxgx.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.67.36.65; envelope-from=maciaschain@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Queue-Id: 20DD63BE24 X-Migadu-Scanner: mx1.migadu.com X-Migadu-Spam-Score: -6.94 X-Spam-Score: -6.94 X-TUID: W07pv+D+406c Ihor Radchenko writes: > Do I understand correctly that onchar=3Did will not break anything if text > is correctly marked with \selectlanguage{}? To load language features (hyphen rules, captions, etc.) there is no problem. But to load a font associated with a language, the font of the last declared language will always be loaded. Well, it is not a problem, because if in a document there are texts in Russian and Bulgarian, for example, the natural thing is that they go in the same font, since both languages share the Cyrillic script. But there may be cases when the author needs different fonts. In such a case, the user should not use the onchar =3D etc property: https://i.imgur.com/vmsCNkP.png In any case (to organize myself mentally) I thought that it could be done on two levels: - Level 0: The fonts associated with each script are loaded (from a defcustom list) if luatex is the current engine. And low-level code is generated in Lua with the luaotfload.add_fallback function. That code can be in a Lua file or directly within the preamble, enclosed in the \directlua primitive (mode=3Dharf means that HarfBuzz is used as otf rendering): \directlua {luaotfload.add_fallback("orgfallback", { "oldstandard:mode=3Dharf;script=3Dgrek;", "oldstandard:mode=3Dharf;script=3Dcyrl;", "freeserif:mode=3Dharf;script=3Darab;", "freeserif:mode=3Dharf;script=3Ddev2;", etc., etc. }) } And, to load the fallback fonts: \setmainfont{latinmodernroman}[RawFeature=3D{fallback=3Dorgfallback}] At this level per-language properties are not loaded, but at least readability is ensured. The user cannot modify the fonts associated with each script within the document, but can modify, of course, the defcustom. - Level 1: The user can load language properties and associate fonts with each language using Babel's high-level code (via keywords in Org, as we have commented in previous messages). Here you can also modify the default fonts (also, as we mentioned before): main, mono, sans and math. If the language is declared with an asterisk (for example: russian*) the onchar=3Detc property will be included in the preamble, and it would not be necessary to switch to russian explicitly. It is assumed that in this scenario the only language with Cyrillic script would be Russian. For language swithcing, in the rest of the cases, some babel command would have to be used using @@latex:@@, special blocks, etc. When Org already has its own language switching mechanism, this would be used instead. Wdyt? --=20 Juan Manuel Mac=C3=ADas=20 https://juanmanuelmacias.com https://lunotipia.juanmanuelmacias.com https://gnutas.juanmanuelmacias.com