ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* adjusting sans to serif; weird solution
@ 2015-11-04 11:17 massifr
  0 siblings, 0 replies; only message in thread
From: massifr @ 2015-11-04 11:17 UTC (permalink / raw)
  To: ntg-context

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-11-04 11:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-04 11:17 adjusting sans to serif; weird solution massifr

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).