ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: massifr@fastwebnet.it
To: ntg-context@ntg.nl
Subject: adjusting sans to serif; weird solution
Date: Wed, 04 Nov 2015 12:17:47 +0100	[thread overview]
Message-ID: <1865324.pV9qVKGxk0@max> (raw)

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

Hello list,
I'm using Garamond Premier Pro and Myriad Pro as serif and sans fonts.
I need to adjust their relative size so that Garamond 11pt looks like having
the same weight of Myriad Pro 11pt.

I found a good tradeoff reducing Myriad by a 0.85 factor.

To achieve that I've used "sa" (scaled at) in \definebodyfont
and "rscale" in \definetypeface (see the code below).

The weird thing is that body font size 11pt is sensible only to "rscale",
while body font sizes 15pt and 8.5pt are sensible only to "sa".
I suspect there's something I did not understand in ConTeXt fonts.

In the attachment you can see the four variations:
font-adjust-none: no adjustment, Myriad looks slightly bigger at 11, 15 and 8.5pt
font-adjust-only-rscale: only "rscale" adjustment, serif and sans look balanced at 11pt,  but not at 15 and 8.5pt
font-adjust-only-sa: only "sa" adjustment, serif and sans look balanced at 15 and 8.5pt, but not at 11pt
font-adjust-sa-rscale: serif and sans always look balanced

With sa AND rscale everything is ok, but WHY? What am I missing?

Another question: I expect ConTeXt to use GaramondCaption instead of 
Garamond at 8.5pt, but this does not happen. Why?

Here's the working code:

\starttypescript [serif] [mio]
  \definefontsynonym [Serif]             [name:GaramondPremrPro-Med]
  \definefontsynonym [SerifBold]         [name:GaramondPremrPro-Bd]
  \definefontsynonym [SerifItalic]       [name:GaramondPremrPro-MedIt]
  \definefontsynonym [SerifSlanted]      [name:GaramondPremrPro-MedIt]
  \definefontsynonym [SerifBoldItalic]   [name:GaramondPremrPro-BdIt]
  \definefontsynonym [SerifBoldSlanted]  [name:GaramondPremrPro-BdIt]
  \definefontsynonym [SerifCaps]         [name:GaramondPremrPro,smcp]
  \definefontsynonym [SerifCaption]      [name:GaramondPremrPro-MedCapt]
  \definefontsynonym [SerifCaptionItalic][name:GaramondPremrPro-MedItCapt]
  \definefontsynonym [SerifCaptionBold]  [name:GaramondPremrPro-BdCapt]
  \definefontsynonym [SerifCaptionBoldItalic][name:GaramondPremrPro-BdItCapt]

  \definebodyfont
   [15pt,11pt,10pt]
   [rm]
   [tf=Serif sa 1,
    it=SerifItalic sa 1,
    bf=SerifBold sa 1,
    bi=SerifBoldItalic sa 1]
  \definebodyfont
   [8.5pt]
   [rm]
   [tf=SerifCaption sa 1,
    it=SerifCaptionItalic sa 1,
    bf=SerifCaptionBold sa 1,
    bi=SerifCaptionBoldItalic sa 1]
\stoptypescript

\starttypescript [sans] [mio]
  \definefontsynonym [Sans]             [name:MyriadPro-Regular]
  \definefontsynonym [SansBold]         [name:MyriadPro-Bold]
  \definefontsynonym [SansItalic]       [name:MyriadPro-It]
  \definefontsynonym [SansSlanted]      [name:MyriadPro-It]
  \definefontsynonym [SansBoldItalic]   [name:MyriadPro-BoldIt]
  \definefontsynonym [SansBoldSlanted]  [name:MyriadPro-BoldIt]
  \definefontsynonym [SansCaps]         [name:MyriadPro-Regular]
  \definebodyfont
   [15pt,11pt,10pt,8.5pt]
   [ss]
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  % "sa" ADJUSTMENT: WORKS ONLY FOR 15pt AND 8.5pt
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   [tf=Sans sa 0.85,
    it=SansItalic sa 0.85,
    bf=SansBold sa 0.85,
    bi=SansBoldItalic sa 0.85,
    sl=SansSlanted sa 0.85,
    sc=SansCaps sa 0.85]
\stoptypescript

\definetypeface [mio]  [rm]  [serif] [mio] [default]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% "rscale" ADJUSTMENT: WORKS ONLY FOR 11pt
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\definetypeface [mio]  [ss]  [sans] [mio] [default][rscale=0.85]

\definebodyfontenvironment[mio][15pt][text=15pt, interlinespace=15pt]
\definebodyfontenvironment[mio][11pt][text=11pt, interlinespace=12pt]
\definebodyfontenvironment[mio][8.5pt][text=8.5pt, interlinespace=9.5pt]

\setupbodyfont[mio,rm,11pt]

\starttext
  \switchtobodyfont[mio,11pt]
  \rm 11pt: Serif text and \ss sans serif text.\par
  
  \blank
  
  \switchtobodyfont[mio,15pt]
  \rm 15pt: Serif text and \ss sans serif text.\par

  \blank
  
  \switchtobodyfont[mio,8.5pt]
  \rm 8.5pt: Serif text and \ss sans serif text.\par
\stoptext

[-- Attachment #2: font-adjust.zip --]
[-- Type: application/zip, Size: 35055 bytes --]

[-- Attachment #3: 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:[~2015-11-04 11:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1865324.pV9qVKGxk0@max \
    --to=massifr@fastwebnet.it \
    --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).