From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/94685 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: Define font based on language Date: Sun, 08 May 2016 19:05:43 +0200 Message-ID: <572F71E7.8000609@gmail.com> References: <57026958.8070405@dlubal.cz> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4853310439483980452==" X-Trace: ger.gmane.org 1462727127 1713 80.91.229.3 (8 May 2016 17:05:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 8 May 2016 17:05:27 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sun May 08 19:05:09 2016 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1azS8i-0004ZE-RN for gctc-ntg-context-518@m.gmane.org; Sun, 08 May 2016 19:05:08 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 4769DC008; Sun, 8 May 2016 19:05:02 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VMK_aMr50i3v; Sun, 8 May 2016 19:05:01 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id 7EEF9BFF6; Sun, 8 May 2016 19:05:01 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 5F9C1BFCC for ; Sun, 8 May 2016 19:05:00 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9IobYFMhdi-1 for ; Sun, 8 May 2016 19:04:59 +0200 (CEST) Original-Received: from mail-wm0-f51.google.com (mail-wm0-f51.google.com [74.125.82.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id EDB4EBFAC for ; Sun, 8 May 2016 19:04:49 +0200 (CEST) Original-Received: by mail-wm0-f51.google.com with SMTP id v200so17065140wmv.1 for ; Sun, 08 May 2016 10:04:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to; bh=YVUX3FjcnI5zCrA0pPzJzrVJbBPFMLVL7lrUQziB15I=; b=esTMZQln0ImzCNIbHYxQTeRxRxFnix/p08/iY12A8/+tljMyQIr24quqHMw40oZCdd V5eJeWtCRx4ppjd929imZ82fx9EWQZ7jS1/OfNvcgVRTLTH0zyXmtaTlPrjfTs4NNL2J CFmEh40ezK1tRd0RE+RzFYMXJljeRMeytfbKh8YxsWkCyYwHsVtkC0GatYhKniCZ1Md9 oacvkpGaqk0clXe0xO3Qa8RRxVljlXaUIwo379I5v61uCk5HVMAxDPWz93cTCHqQ5wDl 1TISZMCC8CeSjwenvhfZTgmcjsXdfrJyNpohusxMYj7v4c8dctXMPpnR+a5g+GqhN7lk t+Jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to; bh=YVUX3FjcnI5zCrA0pPzJzrVJbBPFMLVL7lrUQziB15I=; b=RJy1wwqb1VZzD6gdeK/AbVQIEYo5/vK+Tv8hhArbTU8anp+Z8q22JBJAhAu1CIrwpl +1VYls4FuDsVQG8xV61/VQ8qDJUJqmXUgGjDztECz4xJCeavj2vEzngP5nPeUlGRfxsI UJtX+T1kaoOXpfiHQfDaHhI208kVKxJ6Xd8jjAn41OdlHWQI0Vfku5DbGfohq80Zs82G 5bNX1GquJ3ujaLSdP7cP3vT8yu6PGxPvQdgw3jZo5KmyGw8gSQUhnAuevT5vAB4tBDWj XaUETYXsgcesjKZlw7UBwmrdcoNmmfRwHoCd5v1PrTLOUXA7+sTQ5xStmMMUz1Px3j5u d8fQ== X-Gm-Message-State: AOPr4FXJ2swZkPaJrMkr67Y2XlnYqSJzMe//bWdhGhJvMsOIgFe93eAA7hwA1Sni4jNKzQ== X-Received: by 10.28.37.129 with SMTP id l123mr7638200wml.1.1462727089615; Sun, 08 May 2016 10:04:49 -0700 (PDT) Original-Received: from keima.localdomain (x2f2b910.dyn.telefonica.de. [2.242.185.16]) by smtp.gmail.com with ESMTPSA id ck9sm26370508wjc.22.2016.05.08.10.04.48 for (version=TLSv1/SSLv3 cipher=OTHER); Sun, 08 May 2016 10:04:48 -0700 (PDT) User-Agent: Postbox 4.0.8 (Macintosh/20151105) In-Reply-To: <57026958.8070405@dlubal.cz> X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 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" Xref: news.gmane.org gmane.comp.tex.context:94685 Archived-At: This is a multi-part message in MIME format. --===============4853310439483980452== Content-Type: multipart/alternative; boundary="------------060408080104010003050705" This is a multi-part message in MIME format. --------------060408080104010003050705 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable > Michal Ondrej=C3=A1=C5=A1 > 4. April 2016 um 15:17 > Hello > > I need some help regarding font definitions. > > The situation is like this: > > \definefont > [issuefont] > [SansRegular at 14pt] > .... > {\issuefont \labeltext{issue} \crlf \documentvariable{issue}} > > I need to get chinese text into the issue variable, but for that I=20 > need to change the font. I need something like this: > > \def\chooseissufont{% > \translate > [zh=3D{Sim Sun}, > en=3D{SansRegular}]} > > \definefont > [issuefont] > [\chooseissuefont at 14pt] > > Using "zh" is ok, I managed to somehow make ConTeXt accept the "zh"=20 > language code. It's not perfect but it's for another topic. I get the=20 > text in this way, but the sizing doesn't work. The text is too small=20 > in all languages. You can use ConTeXt=E2=80=99s fallback mechanism to pull missing glyphs f= rom=20 other fonts. \definefallbackfamily [mainface] [rm] [MS Mincho]=20 [range=3Dcjkunifiedideographs] \definefontfamily [mainface] [rm] [Latin Modern Roman] \setupbodyfont[mainface] \starttext People=E2=80=99s Republic of China (=E4=B8=AD=E5=8D=8E=E4=BA=BA=E6=B0=91=E5= =85=B1=E5=92=8C=E5=9B=BD) \stoptext Wolfgang --------------060408080104010003050705 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
4.= =20 April 2016 um 15:17
Hello

I need some help regarding font definitions.

The situation is like this:

\definefont
[issuefont]
[SansRegular at 14pt]
....
{\issuefont \labeltext{issue} \crlf \documentvariable{issue}}

I need to get chinese text into the issue variable, but for that I=20 need=20 to change the font. I need something like this:

\def\chooseissufont{%
\translate
[zh=3D{Sim Sun},
=C2=A0en=3D{SansRegular}]}

\definefont
[issuefont]
[\chooseissuefont at 14pt]

Using "zh" is ok, I managed to somehow make ConTeXt accept the "zh"=20 language code. It's not perfect but it's for another topic. I get the=20 text in this way, but the sizing doesn't work. The text is too small in=20 all languages.
You can use ConTeXt=E2=80=99s fallback mechanism to pull missing glyphs f= rom=20 other fonts.

\definefallbackfamily [mainface] [rm] [MS Mincho]=20 [range=3Dcjkunifiedideographs]
\definefontfamily=C2=A0=C2=A0=C2=A0=C2=A0 [mainface] [rm] [Latin Modern R= oman]

\setupbodyfont[mainface]

\starttext
People=E2=80=99s Republic of China (=E4=B8=AD=E5=8D=8E=E4=BA=BA=E6=B0=91=E5= =85=B1=E5=92=8C=E5=9B=BD)
\stoptext

Wolfgang
--------------060408080104010003050705-- --===============4853310439483980452== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly90ZXguYWFuaGV0Lm5ldAphcmNoaXZlICA6IGh0dHA6Ly9mb3VuZHJ5LnN1cGVsZWMu ZnIvcHJvamVjdHMvY29udGV4dHJldi8Kd2lraSAgICAgOiBodHRwOi8vY29udGV4dGdhcmRlbi5u ZXQKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX18= --===============4853310439483980452==--