From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/84762 Path: news.gmane.org!not-for-mail From: Zhichu Chen Newsgroups: gmane.comp.tex.context Subject: Re: Simplefonts Date: Sat, 12 Oct 2013 21:04:27 +0800 Message-ID: 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 Content-Type: multipart/mixed; boundary="===============0404531076==" X-Trace: ger.gmane.org 1381583071 4729 80.91.229.3 (12 Oct 2013 13:04:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 12 Oct 2013 13:04:31 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sat Oct 12 15:04:36 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 1VUyrz-0005BL-It for gctc-ntg-context-518@m.gmane.org; Sat, 12 Oct 2013 15:04:35 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id A367810193; Sat, 12 Oct 2013 15:01:57 +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 Baz6YrZHHtqW; Sat, 12 Oct 2013 15:01:55 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 45477101DE; Sat, 12 Oct 2013 15:01:55 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 501D1101DE for ; Sat, 12 Oct 2013 15:01:53 +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 XZ6WG-9kbWpH for ; Sat, 12 Oct 2013 15:01:51 +0200 (CEST) Original-Received: from filter4-til.mf.surf.net (filter4-til.mf.surf.net [194.171.167.220]) by balder.ntg.nl (Postfix) with ESMTP id D82E610193 for ; Sat, 12 Oct 2013 15:01:51 +0200 (CEST) Original-Received: from mail-we0-x22e.google.com (mail-we0-x22e.google.com [IPv6:2a00:1450:400c:c03::22e]) by filter4-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id r9CD4RvO023109 for ; Sat, 12 Oct 2013 15:04:28 +0200 Original-Received: by mail-we0-f174.google.com with SMTP id u56so5386145wes.33 for ; Sat, 12 Oct 2013 06:04:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=xo2+C7VOkDPC0S0++2zHY6kA2AYt6j7RrEHPZtMUx/E=; b=TakubO7qRgmrm+mzHYLqs7qeiV61l7/SFYBI39yaAbehq6NNEKczH4TKcwLQPTM0p5 k9ZSoQNEL5ZTIKQfaOJulr5kolEDlIoBZUV/FXE012YMyAwNEdAiXW3ZoR9WLezDF1h2 J/vdTmLQGATCYjOl+IaaSW8LJiSJZ+C2bi4Ma14FPnP+0ah6+AVpGT4qOZtrNyexs+0W HTpLJSA8tC1B2AnNBRxKrPqk3gR5Iluf/rqUjXZetqFiz9Eq3oAcVuxP05JVW5Nd8R2N kI6BHswqxje4vbt9X47C0gvuO/CxMeabW9S76AEC3/CIXeshQiX/m7IkVfQumP5MhIJF c8pQ== X-Received: by 10.180.211.237 with SMTP id nf13mr7164858wic.55.1381583067614; Sat, 12 Oct 2013 06:04:27 -0700 (PDT) Original-Received: by 10.195.18.97 with HTTP; Sat, 12 Oct 2013 06:04:27 -0700 (PDT) In-Reply-To: <3288E803-9426-41F1-AA62-144E5A21A085@gmail.com> X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=2a00:1450:400c:c03::22e; country=IE X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0VKAd4rfU - 38adcdcdacf9 - 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 Xref: news.gmane.org gmane.comp.tex.context:84762 Archived-At: --===============0404531076== Content-Type: multipart/alternative; boundary=001a11c25f42f9123404e88adf19 --001a11c25f42f9123404e88adf19 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Wolfgang, Good to know that, but I might have some questions. On Fri, Oct 11, 2013 at 2:02 AM, Wolfgang Schuster < wolfgang.schuster@gmail.com> wrote: > Hi all, > > I=E2=80=99m happy to announce a new version of the simplefonts code. Thew= new > version of the code > is a complete rewrite and brings many changes. > > 1. The module is now part of the core and no external module is needed > anymore. > > 2. The commands to select a font have changed to commands which fit bette= r > to context normal syntax. > > 3. I removed the keys to enable font expansion and protrusion, when you > need them use \definefontfeature. > > > 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: > > \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. > \definefontfamily [mainface] [math] [TeX Gyre Pagella Math] > > \setupbodyfont[mainface] > > \starttext > \startlines > \rm DejaVu Serif > \ss DejaVu Sans > \tt DejaVu Sans Mono > \m{c^2 =3D a^2 + b^2} > \stoplines > \stoptext > > > The second method is similar to the old commands of the simplefonts modul= e > (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=E2=80=99s= slow > when you set font a font > for each style in your document. > > \setupfontfamily [serif] [DejaVu Serif] > \setupfontfamily [sans] [DejaVu Sans] > \setupfontfamily [mono] [DejaVu Sans Mono] [feature=3Dnone] > \setupfontfamily [math] [TeX Gyre Pagella Math] > > \starttext > \startlines > \rm DejaVu Serif > \ss DejaVu Sans > \tt DejaVu Sans Mono > \m{c^2 =3D a^2 + b^2} > \stoplines > \stoptext > > > 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=E2=80=99t 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. > > \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. And how can I assign the boldfont, italicfont and bolditalicfont? I'm currently using the Adobe Song Std as the regular font but it didn't come with a bold version or else, hence I might need this feature. > \definefontfamily [mainface] [serif] [TeX Gyre Pagella] > > \setupbodyfont[mainface] > > \starttext > > \input knuth > > =D0=A2=D1=80=D0=B0=D0=B4=D0=B8=D1=86=D0=B8=D0=BE=D0=BD=D0=BD=D0=B0=D1=8F = =D1=81=D0=B8=D1=81=D1=82=D0=B5=D0=BC=D0=B0=D1=82=D0=B8=D0=BA=D0=B0 =D0=BB= =D0=B8=D1=88=D0=B0=D0=B9=D0=BD=D0=B8=D0=BA=D0=BE=D0=B2 =D0=BE=D0=BA=D0=B0= =D0=B7=D1=8B=D0=B2=D0=B0=D0=B5=D1=82=D1=81=D1=8F =D0=B2=D0=BE =D0=BC=D0=BD= =D0=BE=D0=B3=D0=BE=D0=BC =D1=83=D1=81=D0=BB=D0=BE=D0=B2=D0=BD=D0=B0 =D0=B8 > > \stoptext > > > Wolfgang > > _________________________________________________________________________= __________ > If your question is of interest to others as well, please add an entry to > the Wiki! > > maillist : ntg-context@ntg.nl / > http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://tex.aanhet.net > archive : http://foundry.supelec.fr/projects/contextrev/ > wiki : http://contextgarden.net > > _________________________________________________________________________= __________ --=20 Best Regards Chen --001a11c25f42f9123404e88adf19 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Wolfgang,

Good to know that, but I mi= ght have some questions.


On Fri, Oct 11, 2013 at 2:02 AM, Wolfgang Schuster= <wolfgang.schuster@gmail.com> wrote:
Hi all,

I=E2=80=99m happy to announce a new version of the simplefonts code. Thew n= ew version of the code
is a complete rewrite and brings many changes.

1. The module is now part of the core and no external module is needed anym= ore.

2. The commands to select a font have changed to commands which fit better = to context normal syntax.

3. I removed the keys to enable font expansion and protrusion, when you nee= d them use \definefontfeature.


To use a font with the simplefonts code two ways are available. The first m= ethod is to create
one or more typefaces and load it with \setupbodyfont. A complete example f= or this is:

\definefontfamily [mainface] [serif] [DejaVu Serif]
\definefontfamily [mainface] [sans] =C2=A0[DejaVu Sans]
\definefontfamily [mainface] [mono] =C2=A0[DejaVu Sans Mono] [feature=3Dnon= e]
It seems the keyword here is "features"? = Only the plural version works here in my newest beta.
\definefontfamily [mainface] [math] =C2=A0[TeX Gyre Pagella Math]

\setupbodyfont[mainface]

\starttext
\startlines
\rm DejaVu Serif
\ss DejaVu Sans
\tt DejaVu Sans Mono
\m{c^2 =3D a^2 + b^2}
\stoplines
\stoptext


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 necessa= ry. Below is a example
for this method but I recommend to avoid this method because it=E2=80=99s s= low when you set font a font
for each style in your document.

\setupfontfamily [serif] [DejaVu Serif]
\setupfontfamily [sans] =C2=A0[DejaVu Sans]
\setupfontfamily [mono] =C2=A0[DejaVu Sans Mono] [feature=3Dnone]
\setupfontfamily [math] =C2=A0[TeX Gyre Pagella Math]

\starttext
\startlines
\rm DejaVu Serif
\ss DejaVu Sans
\tt DejaVu Sans Mono
\m{c^2 =3D a^2 + b^2}
\stoplines
\stoptext


Another feature of simplefonts is the ability to set a fallback font when y= ou need certain glyphs
from a different font (e.g. for cyrillic ) which aren=E2=80=99t available i= n the mainfont of the document.
To set such a fallback font the code provides the \definefallbackfamily com= mand where you
can set in the fourth argument the range for the replacement characters.
\definefallbackfamily [mainface] [serif] [DejaVu Serif] [range=3Dcyrillic,f= orce=3Dyes]
What if I want to use the CJK font? The co= de in=C2=A0 "font-sel.mkvi" hints I could use range=3Dchinese but= it didn't work. I have to use interval {0x00400-0x2FA1F} explicitly.
And how can I assign the boldfont, italicfont and bolditalic= font? I'm currently using the Adobe Song Std as the regular font but it= didn't come with a bold version or else, hence I might need this featu= re.
\definefontfamily =C2=A0 =C2=A0 [mainface] [serif] [TeX Gyre Pagella]

\setupbodyfont[mainface]

\starttext

\input knuth

=D0=A2=D1=80=D0=B0=D0=B4=D0=B8=D1=86=D0=B8=D0=BE=D0=BD=D0=BD=D0=B0=D1=8F = =D1=81=D0=B8=D1=81=D1=82=D0=B5=D0=BC=D0=B0=D1=82=D0=B8=D0=BA=D0=B0 =D0=BB= =D0=B8=D1=88=D0=B0=D0=B9=D0=BD=D0=B8=D0=BA=D0=BE=D0=B2 =D0=BE=D0=BA=D0=B0= =D0=B7=D1=8B=D0=B2=D0=B0=D0=B5=D1=82=D1=81=D1=8F =D0=B2=D0=BE =D0=BC=D0=BD= =D0=BE=D0=B3=D0=BE=D0=BC =D1=83=D1=81=D0=BB=D0=BE=D0=B2=D0=BD=D0=B0 =D0=B8<= br>
\stoptext


Wolfgang
___________________________________________________________________________= ________
If your question is of interest to others as well, please add an entry to t= he Wiki!

maillist : ntg-context@ntg.nl / <= a href=3D"http://www.ntg.nl/mailman/listinfo/ntg-context" target=3D"_blank"= >http://www.ntg.nl/mailman/listinfo/ntg-context
webpage =C2=A0: http= ://www.pragma-ade.nl / http://tex.aanhet.net
archive =C2=A0: http://foundry.supelec.fr/projects/contextrev/
wiki =C2=A0 =C2=A0 : http://contextgarden.net
___________________________________________________________________________= ________



--
Best RegardsChen
--001a11c25f42f9123404e88adf19-- --===============0404531076== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ --===============0404531076==--