ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <schuster.wolfgang@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Different font variants (normal <> condensed, light <> regular <> bold, etc.)
Date: Tue, 9 Jul 2013 17:58:41 +0200	[thread overview]
Message-ID: <48245450-540D-44BE-8504-C5E4AC6CDCAA@gmail.com> (raw)
In-Reply-To: <20130709132059.37f3ade4@zenlima.eu>

[-- Attachment #1: Type: text/plain, Size: 2838 bytes --]


Am 09.07.2013 um 13:20 schrieb Zenlima <post@zenlima.eu>:

> Hi,
> 
> I am trying to define the different variants of the Roboto font ([1]
> for sans and [2][3][4][5] for serif).
> 
> Now I am trying to define this for context but I have no idea how to
> define the condensed versions (plus how to access it later). And how
> do I enter and access the different weights next to regular and
> bold (light, thin, heavy)? And how to define the weight
> light as default (instead of regular)? I got so far:
> 
> --------8<--------------------------
> \enableregime[utf]
> 
> \definefontfeature[Latn-smallcaps][smcp=yes,script=latn,kern=yes]
> \definefontfeature[fakeitalic][default][slant=.25]
> 
> \definefontfeature[arab][mode=node,language=dflt,script=arab,init=yes,medi=yes,fina=yes,isol=yes,liga=yes,dlig=yes,rlig=yes,clig=yes,mark=yes,mkmk=yes,kern=yes,curs=yes]
> 
> \definefontsynonym
> [arab--scheherazade--serif][name:scheherazade][features=arab]
> \definefontsynonym[brai--6punktoj][name:6punktoj] %^1
> 
> \starttypescript[sans][roboto]
> \definefontfallback[Sans][brai--6punktoj][0x2800-0x283f][force=yes,check=no]
> \definefontfallback[Sans][arab--scheherazade--serif][0x0600-0x06ff,0x0750-0x077f,0xfb50-0xfdff,0xfe70-0xfefe][force=yes,check=no,rscale=1.9]
> \definefontsynonym[Sans][name:robotoregular][fallbacks=Sans]
> \definefontsynonym[SansBold][name:robotobold]
> \definefontsynonym[SansItalic][name:robotoitalic]
> \definefontsynonym[SansSlanted][name:robotoitalic]
> \definefontsynonym[SansBoldItalic][name:robotobolditalic]
> \definefontsynonym[SansBoldSlanted][name:robotobolditalic]
> \definefontsynonym[SansCaps][name:robotoregular][features=Latn-smallcaps]
> \stoptypescript
> 
> \starttypescript[serif][roboto] 
> \definefontfallback[Serif][brai--6punktoj][0x2800-0x283f][force=yes,check=no]
> \definefontfallback[Serif][arab--scheherazade--serif][0x0600-0x06ff,0x0750-0x077f,0xfb50-0xfdff,0xfe70-0xfefe][force=yes,check=no,rscale=1.9]
> \definefontsynonym[Serif][name:robotoslabregular][fallbacks=Serif]
> \definefontsynonym[SerifBold][name:robotoslabbold]
> \definefontsynonym[SerifItalic][name:robotoslabregular][features=fakeitalic]
> \definefontsynonym[SerifSlanted][name:robotoslabregular][features=fakeitalic]
> \definefontsynonym[SerifBoldItalic][name:robotoslabbold][features=fakeitalic]
> \definefontsynonym[SerifBoldSlanted][name:robotoslabbold][features=fakeitalic]
> \definefontsynonym[SerifCaps][name:robotoslabregular][features=Latn-smallcaps] 
> \stoptypescript
> 
> \definetypeface[fliesstext][rm][serif][roboto] 
> \definetypeface[fliesstext][ss][sans][roboto] 
> 
> \setupbodyfont[fliesstext,rm,11pt]
> 
> 
> ----8<------------------------------------------
> 
> Any help is appreciated :-)

Try the two attached files (untested):


[-- Attachment #2: roboto-test.tex --]
[-- Type: application/octet-stream, Size: 316 bytes --]

\starttext

\switchtobodyfont[roboto]

\rm\input ward\par
\ss\input ward

\blank

\switchtobodyfont[roboto-condensed]

\rm\input ward\par
\ss\input ward

\blank

\switchtobodyfont[roboto-medium]

\rm\input ward\par
\ss\input ward

\blank

\switchtobodyfont[roboto-light]

\rm\input ward\par
\ss\input ward

\stoptext

[-- Attachment #3: type-roboto.tex --]
[-- Type: application/octet-stream, Size: 1934 bytes --]

\starttypescriptcollection [roboto]

\starttypescript [sans] [roboto]
  \setups[font:fallback:sans]
  \definefontsynonym [Sans]           [file:robotoregular]
  \definefontsynonym [SansItalic]     [file:robotoitalic]
  \definefontsynonym [SansBold]       [file:robotobold]
  \definefontsynonym [SansBoldItalic] [file:robotobolditalic]
\stoptypescript

\starttypescript [sans] [roboto-condensed]
  \definefontsynonym [Sans]           [file:robotocondensed]
  \definefontsynonym [SansItalic]     [file:robotocondenseditalic]
  \definefontsynonym [SansBold]       [file:robotoboldcondensed]
  \definefontsynonym [SansBoldItalic] [file:robotoboldcondenseditalic]
\stoptypescript

\starttypescript [sans] [roboto-medium]
  \definefontsynonym [Sans]           [file:robotomedium]
  \definefontsynonym [SansItalic]     [file:robotomediumitalic]
  \definefontsynonym [SansBold]       [file:robotoblack]
  \definefontsynonym [SansBoldItalic] [file:robotoblackitalic]
\stoptypescript

\starttypescript [sans] [roboto-light]
  \definefontsynonym [Sans]           [file:robotolight]
  \definefontsynonym [SansItalic]     [file:robotolightitalic]
  \definefontsynonym [SansBold]       [file:robotoregular]
  \definefontsynonym [SansBoldItalic] [file:robotoitalic]
\stoptypescript

\starttypescript [serif] [roboto,roboto-condensed,roboto-medium]
  \definefontsynonym [Serif]     [file:robotoslabregular]
  \definefontsynonym [SerifBold] [file:robotoslabbold]
\stoptypescript

\starttypescript [serif] [roboto-light]
  \definefontsynonym [Serif]     [file:robotoslablight]
  \definefontsynonym [SerifBold] [file:robotoslabregular]
\stoptypescript

\starttypescript [roboto,roboto-condensed,roboto-medium,roboto-light]
  \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default] [features=default]
  \definetypeface [\typescriptone] [rm] [sans]  [\typescriptone] [default] [features=default]
\stoptypescript

\stoptypescriptcollection

[-- Attachment #4: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

  reply	other threads:[~2013-07-09 15:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-09 11:20 Zenlima
2013-07-09 15:58 ` Wolfgang Schuster [this message]
2013-07-11 10:02   ` Zenlima
2013-07-11 10:04   ` Zenlima
2013-07-11 18:41     ` Wolfgang Schuster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48245450-540D-44BE-8504-C5E4AC6CDCAA@gmail.com \
    --to=schuster.wolfgang@gmail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).