From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id +H3FCl9dzWLTogAAbAwnHQ (envelope-from ) for ; Tue, 12 Jul 2022 13:39:11 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id CKXFCl9dzWIxTQAA9RJhRA (envelope-from ) for ; Tue, 12 Jul 2022 13:39:11 +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 947B83D089 for ; Tue, 12 Jul 2022 13:39:10 +0200 (CEST) Received: from localhost ([::1]:43872 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBEEP-0002oT-Nr for larch@yhetil.org; Tue, 12 Jul 2022 07:39:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34556) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBED1-0002n6-0a for emacs-orgmode@gnu.org; Tue, 12 Jul 2022 07:37:43 -0400 Received: from mout02.posteo.de ([185.67.36.66]:42267) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBECy-0001yv-M1 for emacs-orgmode@gnu.org; Tue, 12 Jul 2022 07:37:42 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 03E9724010C for ; Tue, 12 Jul 2022 13:37:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1657625858; bh=mOuYTH/QLXJnl0AKGmbWuoiqqC0E6WMnzSohVYL2nGM=; h=From:To:Cc:Subject:Date:From; b=DCm03DsvLoU2uXCMyAkrLifPakQa1Hf8F0JgLCaLYBUQgvH0kaIgRtud7KYuvOa1k hTbj6A1CXsmdRsu5SJba6imyLjCResKEow9nm8H5Le1qZna+WHPA/jV6tjKX96v/ci qewfXTnbYzgoTIE5YYQdpPHX1ujauUfa+Sv9V0wJxoNKgS4XAzxhdQv/jeCY7bHqwS jbzsXaPBTI4szZ93tq5oLEBbSsasap3uAma9kD1glgJBSB4XtneQJcXmd7Da82HHu9 /qiwE/cSfJdCCvfKa2ibMXEFxvEKquDECIkQ/OI9j5vWfiYBWs35Rt3Jg/CweV1O+Z h1t9toKjgqi5A== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4LhzJJ5Hkcz9rxM; Tue, 12 Jul 2022 13:37:36 +0200 (CEST) From: =?utf-8?Q?Juan_Manuel_Mac=C3=ADas?= To: Stefan Nobis Cc: orgmode , Timothy , Ihor Radchenko , Maxim Nikulin Subject: Re: fontsets References: <87ilo7ztm3.fsf@posteo.net> <87ilo7tp78.fsf@tsdye.online> <87o7xy8t4g.fsf@posteo.net> <87a69i8ha1.fsf@posteo.net> <87tu7qnij4.fsf@posteo.net> <87r12ssonv.fsf_-_@posteo.net> <87pmicqtko.fsf@localhost> <87pmiblo2v.fsf@gmail.com> <87sfn7g0ei.fsf@posteo.net> <87o7xvleks.fsf@gmail.com> <8735f7qp26.fsf@posteo.net> Date: Tue, 12 Jul 2022 11:37:34 +0000 In-Reply-To: (Stefan Nobis's message of "Tue, 12 Jul 2022 09:12:02 +0200") Message-ID: <87lesysgsh.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.66; envelope-from=maciaschain@posteo.net; helo=mout02.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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1657625951; 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=L74v/4Nn3hDSBkQtqWFxD1y3ECn0CWp3bEyYgZ2e8KE=; b=o+EVGO6LLPyj5FUcmTOquARgG18Eb55kn+U6GntCSqaSdDo10dW4H+RHAJ5m8yx5KmjxfQ 83YSHkc11ph5ZwqZQl1jC2xjPD+VJulVlb9FzLqJovgyWtbLNtVIsfVQBdKvXdxYXwYzwS ABqWhfRyhgxNwuSRc4tmw9Ec1TAnBHvp4i7pWFlCHd4uGJkjhpuFL6pSbiiGuXH1gft+bG HyL1ERkltVtEHL8wvv0CdKtN63WCFowIXLTPOObZx/NPO2p20eDPiF/rvz4V/wGHmf6Ad8 9pj6pCasaXS7p62ozu8tQnE4lw4+HhlcRehIEFMUw8CGKTx8Vh7X1GJdSScBug== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1657625951; a=rsa-sha256; cv=none; b=AO3XSfjdZnb4J3ptYrWnDhSCoQHSC34TqYVpKfuRARBS6Vz4s2I9tlJcSKfCjNI8PPGOJW c4w0JPaW1om87N+VhgbEfx/n/sPFo7fxRxk0pj8pypOoDD5HkOvdZ8I23tqYJZa7UmQKkV AFW6eNCHXqEFR0nAAs9zgWVLcLnnheWWV8hqc4pNpBOAQhMwT/zF+jHmjXycvtBMbvxdDS P56OEUwnjrkPpCdDX8CFRxo6k1KFQ2/yHBzyGHXwe1He0PEz1y1Fnckekau7GGiEkwUonZ MuqjObV3zCiTPFIMw2YNfmEglYyxpGkpYbq7M02ujYw8RVrDpbM9ONc2nBDaig== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=DCm03Dsv; dmarc=pass (policy=none) header.from=posteo.net; 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" X-Migadu-Spam-Score: -4.15 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=DCm03Dsv; dmarc=pass (policy=none) header.from=posteo.net; 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" X-Migadu-Queue-Id: 947B83D089 X-Spam-Score: -4.15 X-Migadu-Scanner: scn1.migadu.com X-TUID: qqZxgDqL1KHM Stefan Nobis writes: > Hmmm... maybe add optional extra config/output option to the fontset, > like so: > > =E2=94=8C=E2=94=80=E2=94=80=E2=94=80=E2=94=80 > =E2=94=82 ;; Fonts > =E2=94=82 ((myfonta . ((pdflatex . "etc.") (lualatex ...) (html ...) ...)) > =E2=94=82 (myfontb ...) > =E2=94=82 ...) > =E2=94=82 ;; Fontsets > =E2=94=82 ((myfontset . > =E2=94=82 ((sans . myfonta) > =E2=94=82 (serif . myfontb) > =E2=94=82 (mono . myfontc) > =E2=94=82 (extra . ((lualatex . "\\defaultfontfeatures{Scale=3DMatchLo= wercase}") > =E2=94=82 (html "some CSS...")...)) > =E2=94=82 ...)) > =E2=94=82 ...) > =E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94=80 > > This way it may be possible to build a fontset library of fonts that > blend well together, including some necessary fine-tuning. I think it's a good idea. And I definitely like Timothy's idea of fontsets, but I still think that LuaLaTeX and XelaTeX should be unified in some way. Perhaps one or two default fontsets could be added. It was commented in some previous message about the possibility of checking if a font is present in the system. To add some extra information, TeX live 2022 includes a lua script, luafindfont, which runs luaotfload in the background. It is very useful because, in addition to system fonts, it also returns results from TeX live fonts. I use this script via helm, and I wrote this to extract a list of candidates: #+begin_src emacs-lisp (defun build-luafindfont-candidates-list (candidate) (interactive) (let* ((query (shell-command-to-string (concat "luafindfont " candidate))) (str (with-temp-buffer (insert query) (goto-char (point-min)) (let ((from (save-excursion (re-search-forward "1\\." nil t) (beginning-of-line) (point))) (to (save-excursion (goto-char (point-max)) (point)))) (save-restriction (narrow-to-region from to) (buffer-string))))) (str-clean (split-string (with-temp-buffer (insert str) (replace "[[:digit:]]+\\.\s+" "") (replace "\\(.+\\)\\(\\.otf\\|\\.ttf\\)\s+" "") (replace "\s+" " -- ") (buffer-string)) "\n" t))) (setq luafindfont-list (mapcar 'identity str-clean)))) #+end_src On the other hand, fontspec includes the \IfFontExistsTF command. According to the fontspec documentation: ------ \IfFontExistsTF{=E2=9F=A8font name=E2=9F=A9}{=E2=9F=A8true branch=E2=9F=A9}= {=E2=9F=A8false branch=E2=9F=A9} The conditional \IfFontExistsTF is provided to test whether the =E2=9F=A8fo= nt name=E2=9F=A9 exists or is loadable. If it is, the =E2=9F=A8true branch=E2=9F=A9 code is executed; = otherwise, the =E2=9F=A8false branch=E2=9F=A9 code is. This command can be slow since the engine may resort to scanning the filesy= stem for a missing font. Nonetheless, it has been a popular request for users who wish= to define =E2=80=98fallback fonts=E2=80=99 for their documents for greater portability. In this command, the syntax for the =E2=9F=A8font name=E2=9F=A9 is a restri= cted/simplified version of the font loading syntax used for \fontspec and so on. Fonts to be loaded by fil= ename are detected by the presence of an appropriate extension (.otf, etc.), and paths should = be included inline. E.g.: \IfFontExistsTF{cmr10}{T}{F} \IfFontExistsTF{Times New Roman}{T}{F} \IfFontExistsTF{texgyrepagella-regular.otf}{T}{F} \IfFontExistsTF{/Users/will/Library/Fonts/CODE2000.TTF}{T}{F} ------- Best regards, Juan Manuel=20