ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <schuster.wolfgang@googlemail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Problem with font mapping
Date: Thu, 26 Nov 2009 13:27:22 +0100	[thread overview]
Message-ID: <06A41F0E-364E-4F8C-B6F0-FA5A9EEACAD6@googlemail.com> (raw)
In-Reply-To: <86d68cc30911250727xcbb007elc822b887a3d54c30@mail.gmail.com>


Am 25.11.2009 um 16:27 schrieb Mika Ritola:

> Hello again,
> 
> I seem to be running into all sorts of font problems. Now my document has suddenly turned bold. For example, running the following code results in "Test." being rendered in bold characters.

A few things have changed in ConTeXt font mechanism and I'm going to adapt simplefonts
to the new code (will take a while) but there are now many new features available,
take for example the new spec-interface which could be used to write this:

\starttypescript[Xserif][all][name]

    \definefontsynonym [Serif]            [spec:\ctxlua{tex.sprint(string.lower(string.gsub("\typescripttwo","[^a-zA-Z0-9]","")))}-normal-normal] [features=default]
    \definefontsynonym [SerifItalic]      [spec:\ctxlua{tex.sprint(string.lower(string.gsub("\typescripttwo","[^a-zA-Z0-9]","")))}-normal-italic] [features=default]
    \definefontsynonym [SerifSlanted]     [spec:\ctxlua{tex.sprint(string.lower(string.gsub("\typescripttwo","[^a-zA-Z0-9]","")))}-normal-italic] [features=default]
    \definefontsynonym [SerifBold]        [spec:\ctxlua{tex.sprint(string.lower(string.gsub("\typescripttwo","[^a-zA-Z0-9]","")))}-bold-normal]   [features=default]
    \definefontsynonym [SerifBoldItalic]  [spec:\ctxlua{tex.sprint(string.lower(string.gsub("\typescripttwo","[^a-zA-Z0-9]","")))}-bold-italic]   [features=default]
    \definefontsynonym [SerifBoldSlanted] [spec:\ctxlua{tex.sprint(string.lower(string.gsub("\typescripttwo","[^a-zA-Z0-9]","")))}-bold-italic]   [features=default]
    \definefontsynonym [SerifCaps]        [spec:\ctxlua{tex.sprint(string.lower(string.gsub("\typescripttwo","[^a-zA-Z0-9]","")))}-normal-normal] [features=smallcaps]

\stoptypescript

\starttypescript[Xsans][all][name]

    \definefontsynonym [Sans]            [spec:\ctxlua{tex.sprint(string.lower(string.gsub("\typescripttwo","[^a-zA-Z0-9]","")))}-normal-normal] [features=default]
    \definefontsynonym [SansItalic]      [spec:\ctxlua{tex.sprint(string.lower(string.gsub("\typescripttwo","[^a-zA-Z0-9]","")))}-normal-italic] [features=default]
    \definefontsynonym [SansSlanted]     [spec:\ctxlua{tex.sprint(string.lower(string.gsub("\typescripttwo","[^a-zA-Z0-9]","")))}-normal-italic] [features=default]
    \definefontsynonym [SansBold]        [spec:\ctxlua{tex.sprint(string.lower(string.gsub("\typescripttwo","[^a-zA-Z0-9]","")))}-bold-normal]   [features=default]
    \definefontsynonym [SansBoldItalic]  [spec:\ctxlua{tex.sprint(string.lower(string.gsub("\typescripttwo","[^a-zA-Z0-9]","")))}-bold-italic]   [features=default]
    \definefontsynonym [SansBoldSlanted] [spec:\ctxlua{tex.sprint(string.lower(string.gsub("\typescripttwo","[^a-zA-Z0-9]","")))}-bold-italic]   [features=default]
    \definefontsynonym [SansCaps]        [spec:\ctxlua{tex.sprint(string.lower(string.gsub("\typescripttwo","[^a-zA-Z0-9]","")))}-normal-normal] [features=smallcaps]

\stoptypescript

\starttypescript[Xmono][all][name]

    \definefontsynonym [Mono]            [spec:\ctxlua{tex.sprint(string.lower(string.gsub("\typescripttwo","[^a-zA-Z0-9]","")))}-normal-normal] [features=default]
    \definefontsynonym [MonoItalic]      [spec:\ctxlua{tex.sprint(string.lower(string.gsub("\typescripttwo","[^a-zA-Z0-9]","")))}-normal-italic] [features=default]
    \definefontsynonym [MonoSlanted]     [spec:\ctxlua{tex.sprint(string.lower(string.gsub("\typescripttwo","[^a-zA-Z0-9]","")))}-normal-italic] [features=default]
    \definefontsynonym [MonoBold]        [spec:\ctxlua{tex.sprint(string.lower(string.gsub("\typescripttwo","[^a-zA-Z0-9]","")))}-bold-normal]   [features=default]
    \definefontsynonym [MonoBoldItalic]  [spec:\ctxlua{tex.sprint(string.lower(string.gsub("\typescripttwo","[^a-zA-Z0-9]","")))}-bold-italic]   [features=default]
    \definefontsynonym [MonoBoldSlanted] [spec:\ctxlua{tex.sprint(string.lower(string.gsub("\typescripttwo","[^a-zA-Z0-9]","")))}-bold-italic]   [features=default]
    \definefontsynonym [MonoCaps]        [spec:\ctxlua{tex.sprint(string.lower(string.gsub("\typescripttwo","[^a-zA-Z0-9]","")))}-normal-normal] [features=smallcaps]

\stoptypescript

\starttypescript[Xserif][default][size]
  \definebodyfont
  [4pt,5pt,6pt,7pt,8pt,9pt,10pt,11pt,12pt,14.4pt,17.3pt] [rm]
  [default]
\stoptypescript

\starttypescript[Xsans][default][size]
  \definebodyfont
    [4pt,5pt,6pt,7pt,8pt,9pt,10pt,11pt,12pt,14.4pt,17.3pt]
    [ss] [default]
\stoptypescript

\starttypescript [Xmono][default][size]
  \definebodyfont
    [4pt,5pt,6pt,7pt,8pt,9pt,10pt,11pt,12pt,14.4pt,17.3pt]
    [tt] [default]
\stoptypescript

\starttypescript[Xserif][dtp][size]
  \definebodyfont
    [5pt,6pt,7pt,8pt,9pt,10pt,11pt,12pt,13pt,14pt,16pt,18pt,22pt,28pt]
    [rm] [default]
\stoptypescript

\starttypescript[Xsans][dtp][size]
  \definebodyfont
    [5pt,6pt,7pt,8pt,9pt,10pt,11pt,12pt,13pt,14pt,16pt,18pt,22pt,28pt]
    [ss] [default]
\stoptypescript

\starttypescript[Xmono][dtp][size]
  \definebodyfont
    [5pt,6pt,7pt,8pt,9pt,10pt,11pt,12pt,13pt,14pt,16pt,18pt,22pt,28pt]
    [tt] [default]
\stoptypescript

% this is the relevant part for the users

\definetypeface[mainface][rm][Xserif][TeX Gyre Pagella][default]
\definetypeface[mainface][ss][Xsans] [TeX Gyre Heros]  [default][rscale=0.9]
\definetypeface[mainface][tt][Xmono] [TeX Gyre Cursor] [default][rscale=1.1]

\setupbodyfont[mainface]

\starttext

\rm\tf roman \it italic \bf bold \bi bolditalic \sc smallcaps

\ss\tf roman \it italic \bf bold \bi bolditalic \sc smallcaps

\tt\tf roman \it italic \bf bold \bi bolditalic \sc smallcaps

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


  parent reply	other threads:[~2009-11-26 12:27 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-25 15:27 Mika Ritola
2009-11-25 16:47 ` Hans Hagen
2009-11-25 18:52   ` Mika Ritola
2009-11-26 10:39     ` Hans Hagen
2009-11-27  9:31       ` Metapost and mkiv Alan BRASLAU
2009-11-27  9:53         ` Hans Hagen
2009-11-27 13:54         ` Willi Egger
2009-11-28 18:28           ` Alan BRASLAU
2009-11-29  8:03             ` Taco Hoekwater
2009-11-26 12:27 ` Wolfgang Schuster [this message]
2009-11-26 15:01   ` Problem with font mapping Hans Hagen
2009-11-26 15:43     ` Wolfgang Schuster
2009-11-26 15:49       ` Hans Hagen

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=06A41F0E-364E-4F8C-B6F0-FA5A9EEACAD6@googlemail.com \
    --to=schuster.wolfgang@googlemail.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).