From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id UJLnCIK8+WQKLAAA9RJhRA:P1 (envelope-from ) for ; Thu, 07 Sep 2023 14:05:22 +0200 Received: from aspmx1.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id UJLnCIK8+WQKLAAA9RJhRA (envelope-from ) for ; Thu, 07 Sep 2023 14:05:22 +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 651EB369F3 for ; Thu, 7 Sep 2023 14:05:21 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=Gj15pMA4; 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=1694088322; 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=a0Aj0wiblCtGM/qt41hyj5G2chLN6nPs1KIVZEo+uR0=; b=MpLqPmkiXApyqQI6DAKYmi/bSiBb9MmO+4eGaIJhJDUrmRPuuZyt6f7nNWe1SYOECvzoQx cG//gQL/JuHhb4/zh52K8JDlUgX4T3rr2ystfgMItlrzjE3H2HthqI1JomY48lUMvfFb+/ PQ3pIZkth2fndLp/TBAvCS0zhEw9TT1qdzrlvKFIeSNu6d368pVYsEqHvM6sPhWWnI8NTv 4q0TVI+tYfwv8E5xuczQ56tDtBXqfg69bTbrYakGsVM+AFb/W3MdCU0x+WWNOFWbAzE+pE yhP8U4zovsWFAP1dMdButqKoKJOPc5GOm09/gvRYlWIn8hSzJGFJKjSXytDK7Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1694088322; a=rsa-sha256; cv=none; b=eiVhSW7qO3WtuI2SgsAkEFpZ9NhwFCZJTdpnFOhMCR3GMgbFFvsgHCOVRxouh5UGBZfOEs N8l3iPF+vvStD0Nk58DlUbEB4BI0xrjPEaSq9FIE+IHyoKw4Dj7DNHiu1QkvLuTAJb/ZEw IXo8mEtnXCWqvBw/QrrKjk1xmQ3GO31aB0VEsAWViVP2lyR+igIjpYbjN31pKf4vgS1gKC iYWe91TP4xvkWw0Ac5MGqhYYlokrLEab4MYAY+b+JeS3Ioe5mMxxIqoJlyIq4Ux4NOPOVD 7w5q0S5xw00vlktMBp47f5oOtfWYXnzkUVIBDoxXYdYL69BagP/LmfKGjfeVFg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=Gj15pMA4; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qeDkI-0007PN-FP; Thu, 07 Sep 2023 08:04:26 -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 1qeDkG-0007Oy-DQ for emacs-orgmode@gnu.org; Thu, 07 Sep 2023 08:04:24 -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 1qeDkB-0004qz-Im for emacs-orgmode@gnu.org; Thu, 07 Sep 2023 08:04:24 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id C1C17240028 for ; Thu, 7 Sep 2023 14:04:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1694088255; bh=ogzlj3uVY0DUsTthK9g+TaIW6r2GQxo9Ju+ZTpkZdaU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=Gj15pMA4veQV0FkfiyO98nJJ9O5o11TAuAYPh3WsFdnxwjtvrwtNHEPn9blFCWS7O ev4hiQ/pIEWvGL8uUZle59KYzfnoPL6FYl4dG4MuY2MtIXd6kM12r/nrs/e+j7TuSz NrFG8PwwwXRxNrkZD7aKnMrj4npl6LJ4V0H5n6vDg5dd9SrQdzTTzW+IfDj/4V0RLx 8I6aCN397Me3uwupM8nPpbiIzfwBjZcBIYhNrutHj5pEp7pOyCgemZrDglbWLJEdHI QJ+YLUzsYrn5hvcte/CPcvOFN76gf9M67U8s9QbG0t/ekgZR7TzGeczUFom36WTalz qmFkGrhlAFXEg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4RhHwH1dP3z9rxQ; Thu, 7 Sep 2023 14:04:15 +0200 (CEST) From: =?utf-8?Q?Juan_Manuel_Mac=C3=ADas?= To: Ihor Radchenko Cc: Max Nikulin , emacs-orgmode@gnu.org Subject: Re: Fallback fonts in LaTeX export for non latin scripts In-Reply-To: <878r9ip9kg.fsf@localhost> (Ihor Radchenko's message of "Thu, 07 Sep 2023 10:22:07 +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> <8734zrgxgx.fsf@posteo.net> <878r9ip9kg.fsf@localhost> Date: Thu, 07 Sep 2023 12:04:12 +0000 Message-ID: <87jzt2w5oj.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-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: mx2.migadu.com X-Spam-Score: -9.94 X-Migadu-Queue-Id: 651EB369F3 X-Migadu-Spam-Score: -9.94 X-TUID: +2bsPlGpmha3 Ihor Radchenko writes: > May we explicitly set the needed font around language environments? > > Something like > > \setfontforrussian > \selectlanguage{russian} > .... > > \setfontforbulgarian > \selectlanguage{bulgarian} > .... There's no need. With \babelfont you can associate a font with a language (declared with both the classic syntax and \babelprovide. And when you use \selectlanguage, \foreignlanguage or any other babel command or environment to switch languages, the associated font is activated for that language. For example: \babelprovide[import]{russian} \babelprovide[import]{bulgarian} \babelfont[russian]{rm}[]{Old Standard} \babelfont[bulgarian]{rm}[]{Freeserif}=20 and then: \selectlanguage{russian} ... \selectlanguage{bulgarian} ... \babelprovide supports several properties. Adding the onchar=3Dids fonts/letters property equates language and script, and everything in that script is associated with a font. This would only make sense to use when there is only one language in the document that has that script, as we discussed before. In case like russian/bulgarian, the source of the last babelprovide is overwritten for all cases where that script appears. > >> 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): >> ... > > Sounds reasonable. > >> - 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? > > I am not sure if I like "russian*" idea. May you explain a bit more > about how onchar works? What if language characters are intersecting, > and not using exactly the same char sets? Basically, it's like I said above. According to the Babel Manual: #+begin_quote onchar=3D ids | fonts | letters This option is much like an =E2=80=98event=E2=80=99 called when a character= belonging to the script of this locale is found (as its name implies, it acts on characters, not on spaces). There are currently two =E2=80=98actions=E2=80= =99, which can be used at the same time (separated by a space): with ids the \language and the \localeid are set to the values of this locale; with fonts, the fonts are changed to those of this locale (as set with \babelfont). Characters can be added or modified with \babelcharproperty. [...] Option letters restricts the =E2=80=98actions=E2=80=99 to letters, in= the TEX sense (i. e., with catcode 11). Digits and punctuation are then considered part of current locale (as set by a selector). This option is useful when the main script is non-Latin and there is a secondary one whose script is Latin. #+end_quote --=20 Juan Manuel Mac=C3=ADas=20 https://juanmanuelmacias.com https://lunotipia.juanmanuelmacias.com https://gnutas.juanmanuelmacias.com