From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/84765 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: Simplefonts Date: Sat, 12 Oct 2013 19:39:15 +0200 Message-ID: <7D24BFCF-3023-47A2-A243-582C49B7FA79@gmail.com> References: <3288E803-9426-41F1-AA62-144E5A21A085@gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) Content-Type: multipart/mixed; boundary="===============2081943948==" X-Trace: ger.gmane.org 1381599561 10380 80.91.229.3 (12 Oct 2013 17:39:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 12 Oct 2013 17:39:21 +0000 (UTC) Cc: Zhichu Chen To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sat Oct 12 19:39:26 2013 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([5.39.185.229]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VV39x-00013x-9l for gctc-ntg-context-518@m.gmane.org; Sat, 12 Oct 2013 19:39:25 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 317EC10193; Sat, 12 Oct 2013 19:36:47 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id lZMkeV3R00br; Sat, 12 Oct 2013 19:36:44 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 118F6101DE; Sat, 12 Oct 2013 19:36:44 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id C41A0101DE for ; Sat, 12 Oct 2013 19:36:42 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id O6E9v3NW7UZc for ; Sat, 12 Oct 2013 19:36:41 +0200 (CEST) Original-Received: from filter4-ams.mf.surf.net (filter4-ams.mf.surf.net [192.87.102.72]) by balder.ntg.nl (Postfix) with ESMTP id 5D23D10193 for ; Sat, 12 Oct 2013 19:36:41 +0200 (CEST) Original-Received: from mail-ea0-x235.google.com (mail-ea0-x235.google.com [IPv6:2a00:1450:4013:c01::235]) by filter4-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id r9CHhSDQ008385 for ; Sat, 12 Oct 2013 19:43:28 +0200 Original-Received: by mail-ea0-f181.google.com with SMTP id d10so2475319eaj.26 for ; Sat, 12 Oct 2013 10:39:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=RwmYNkas0DeGs8pmbaRPdk1w7dMThlsCk3gzSk+BBAc=; b=effSCVtln/pZnm7HejVjm4DhEgN3/eH4+JEvP3HzAzz3pSznwpuT8LQX4iDZ55ZzCR fl87p65v8ZuwiKe9XYEnF3gHldzuHYi+iO2dPp0bhyLL8oqydDJSuqMVI3uij7QVEEAI 6z9JJG5DuSlCHUEtHl0mW+F4K7rbLpLDQsZNYoAsTh8uZgR1OwQ5FFeRaPNrlmm5//3c LSUFuRVBQVkYitG08XSbRFcBK/BbsRgDVwVhTg10fiz6yRvjPba8H2tAAO+UIu1WkTwk q1sXP7F+dCrwrL4NVnHVVt9KOvV1JAZo1wS36VhzNzsdXUDXg5bLaNG85juWE/EhvTnJ lb5w== X-Received: by 10.15.94.201 with SMTP id bb49mr40096371eeb.23.1381599557505; Sat, 12 Oct 2013 10:39:17 -0700 (PDT) Original-Received: from keima.localdomain (x2f219c3.dyn.telefonica.de. [2.242.25.195]) by mx.google.com with ESMTPSA id m54sm130040645eex.2.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 12 Oct 2013 10:39:16 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.1510) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=2a00:1450:4013:c01::235; country=IE X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 01KAhHstM - 48da0b8038cc - 20131012 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: ntg-context-bounces@ntg.nl X-Spam-Report: 5.0 points; * 3.2 RCVD_ILLEGAL_IP Received: contains illegal IP address * 0.0 HTML_MESSAGE BODY: HTML included in message * 1.8 MIME_QP_LONG_LINE RAW: Quoted-printable line longer than 76 chars Xref: news.gmane.org gmane.comp.tex.context:84765 Archived-At: --===============2081943948== Content-Type: multipart/alternative; boundary="Apple-Mail=_D77CCB4D-9FF1-46E1-B08B-CD7BC59E9A15" --Apple-Mail=_D77CCB4D-9FF1-46E1-B08B-CD7BC59E9A15 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 Am 12.10.2013 um 15:04 schrieb Zhichu Chen : > Hi Wolfgang, >=20 > Good to know that, but I might have some questions. >=20 >=20 > On Fri, Oct 11, 2013 at 2:02 AM, Wolfgang Schuster = wrote: > Hi all, >=20 > I=92m happy to announce a new version of the simplefonts code. Thew = new version of the code > is a complete rewrite and brings many changes. >=20 > 1. The module is now part of the core and no external module is needed = anymore. >=20 > 2. The commands to select a font have changed to commands which fit = better to context normal syntax. >=20 > 3. I removed the keys to enable font expansion and protrusion, when = you need them use \definefontfeature. >=20 >=20 > To use a font with the simplefonts code two ways are available. The = first method is to create > one or more typefaces and load it with \setupbodyfont. A complete = example for this is: >=20 > \definefontfamily [mainface] [serif] [DejaVu Serif] > \definefontfamily [mainface] [sans] [DejaVu Sans] > \definefontfamily [mainface] [mono] [DejaVu Sans Mono] [feature=3Dnone]= > It seems the keyword here is "features"? Only the plural version works = here in my newest beta.=20 Yes, the name of the key is =93features=94, the missing =93s=94 was a = typo. > \definefontfamily [mainface] [math] [TeX Gyre Pagella Math] >=20 > \setupbodyfont[mainface] >=20 > \starttext > \startlines > \rm DejaVu Serif > \ss DejaVu Sans > \tt DejaVu Sans Mono > \m{c^2 =3D a^2 + b^2} > \stoplines > \stoptext >=20 >=20 > The second method is similar to the old commands of the simplefonts = module (e.g. \setmainfont) > where the font is enabled after it was set and no \setupbodyfont is = necessary. Below is a example > for this method but I recommend to avoid this method because it=92s = slow when you set font a font > for each style in your document. >=20 > \setupfontfamily [serif] [DejaVu Serif] > \setupfontfamily [sans] [DejaVu Sans] > \setupfontfamily [mono] [DejaVu Sans Mono] [feature=3Dnone] > \setupfontfamily [math] [TeX Gyre Pagella Math] >=20 > \starttext > \startlines > \rm DejaVu Serif > \ss DejaVu Sans > \tt DejaVu Sans Mono > \m{c^2 =3D a^2 + b^2} > \stoplines > \stoptext >=20 >=20 > Another feature of simplefonts is the ability to set a fallback font = when you need certain glyphs > from a different font (e.g. for cyrillic ) which aren=92t available in = the mainfont of the document. > To set such a fallback font the code provides the = \definefallbackfamily command where you > can set in the fourth argument the range for the replacement = characters. >=20 > \definefallbackfamily [mainface] [serif] [DejaVu Serif] = [range=3Dcyrillic,force=3Dyes] > What if I want to use the CJK font? The code in "font-sel.mkvi" hints = I could use range=3Dchinese but it didn't work. I have to use interval = {0x00400-0x2FA1F} explicitly. When you take a look into char-def.lua you can see names certain = character ranges and =93range=3Dcyrillic=94 used such a name. For a chinese font you need = =93range=3D{cjkunifiedideographs,cjkunifiedideographsextensiona,=85}". Because the list with names is very long you do this setup only once = with the \definefontfamilypreset command, e.g. = \definefontfamilypreset[chinese][range=3D{cjkunifiedideographs,cjkunifiedi= deographsextensiona,=85}] and load this setup when you set the font with = \definefontfamilyfallback, e.g. \definefontfamilyfallback[][