On 6/22/2013 1:43 AM, Andres Conrado Montoya wrote:
Hello friends.
I'm trying to design a book using the typescript you can find at the
end of this message. I'm using the beautiful EBGaramond fonts from
Georg Duffner (http://www.georgduffner.at/ebgaramond/). This font
provides optical sizes to be used in different sizes (named "12" for
10.1pt or more, and "8" for 10 or less. These fonts automatically work
as expected in latex, thanks to a recent package included in CTAN
(ebgaramond package), selecting the correct font for the appropriate
size. However, the typescript I'm using selects the "8" size for
everything, without taking the type size into consideration. Is there
any way to make ConTeXt do this automatic selection of fonts regarding
of type size? I'm using version 2013.06.10 22:51.

We have no feature 'size' (or I must have forgotten about it). As there is no consistency in designsizes and there is always some esthetic choice involved no automatic mechanism is (and will be) build in.

However, as the traditional tex fonts come in designsizes we do have a way to deal with them via so called font goodies. I made you a goodie file for ebgaramond as well as typescript. (You need to convince Mojca to add the otf fonts to the distribution.)

Just put the goodie and typescript files in the base path and run mtxrun --generate after that. We need to choose a proper matching math font (or seek funding for a gust garamond math font project).

The demo file shows how to kick in

Hans

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
    tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------
return {
    name = "eb garamond",
    version = "1.00",
    comment = "Goodies that complement eb garamond.",
    author = "Hans Hagen",
    copyright = "ConTeXt development team",
    designsizes = {
        ["EBGaramond-Italic"] = {
            ["8pt"]  = "file:EBGaramond08-Italic",
            ["9pt"]  = "file:EBGaramond08-Italic",
            ["10pt"] = "file:EBGaramond08-Italic",
            ["11pt"] = "file:EBGaramond12-Italic",
            ["12pt"] = "file:EBGaramond12-Italic",
            default  = "file:EBGaramond12-Italic",
        },
        ["EBGaramond-Regular"] = {
            ["8pt"]  = "file:EBGaramond08-Regular",
            ["9pt"]  = "file:EBGaramond08-Regular",
            ["10pt"] = "file:EBGaramond08-Regular",
            ["11pt"] = "file:EBGaramond12-Regular",
            ["12pt"] = "file:EBGaramond12-Regular",
            default  = "file:EBGaramond12-Regular",
        },
        ["EBGaramond-SC"] = {
            ["8pt"]  = "file:EBGaramond08-SC",
            ["9pt"]  = "file:EBGaramond08-SC",
            ["10pt"] = "file:EBGaramond08-SC",
            ["11pt"] = "file:EBGaramond12-SC",
            ["12pt"] = "file:EBGaramond12-SC",
            default  = "file:EBGaramond12-SC",
        },
        ["EBGaramond-Bold"] = {
            default  = "file:EBGaramond12-Bold",
        },
        ["EBGaramond-AllSC"] = {
            default  = "file:EBGaramond12-AllSC",
        },
        ["EBGaramond-Initials"] = {
            default  = "file:EBGaramondInitials",
        },
        ["EBGaramond-InitialsF1"] = {
            default  = "file:EBGaramondInitialsF1",
        },
        ["EBGaramond-InitialsF2"] = {
            default  = "file:EBGaramondInitialsF2",
        },
    }
}


%D \module
%D   [       file=type-imp-ebgaramond,
%D        version=2013.06.22,
%D          title=\CONTEXT\ Typescript Macros,
%D       subtitle=EB Garamond,
%D         author=Hans Hagen,
%D           date=\currentdate,
%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

\definefontfeature
  [eb-garamond-normal]
  [default]
  [mode=node,ccmp=yes,calt=yes,
   liga=yes,dlig=yes,hlig=yes,
   kern=yes,mark=yes,mkmk=yes,
   onum=yes,pnum=yes,salt=yes,
   script=latn]

\definefontfeature
  [eb-garamond-smallcaps]
  [eb-garamond-normal]
  [smcp=yes,c2sc=yes]

\starttypescriptcollection[ebgaramond]

    \starttypescript [serif] [ebgaramond]
        \loadfontgoodies[ebgaramond]
        \setups[font:fallback:serif]
        \definefontsynonym [Serif]       [file:ebgaramond-regular] 
[features=eb-garamond-normal]
        \definefontsynonym [SerifItalic] [file:ebgaramond-italic]  
[features=eb-garamond-normal]
        \definefontsynonym [SerifBold]   [file:ebgaramond-bold]    
[features=eb-garamond-normal]
        \definefontsynonym [SerifCaps]   [Serif]                   
[features=eb-garamond-smallcaps]
    \stoptypescript

    \starttypescript[ebgaramond]
        \definetypeface [ebgaramond] [rm] [serif] [ebgaramond] [default] 
[designsize=auto]
        \definetypeface [ebgaramond] [tt] [mono]  [dejavu]     [default]
        \definetypeface [ebgaramond] [mm] [math]  [bonum]      [default]
    \stoptypescript

\stoptypescriptcollection
\loadtypescriptfile[ebgaramond]

\definefontfeature
  [quality]
  [expansion=quality,
   protrusion=quality]

\definefontfeature
  [eb-garamond-normal]
  [eb-garamond-normal,quality]


\definefontfeature
  [eb-garamond-smallcaps]
  [eb-garamond-smallcaps,quality]

\setupbodyfont[ebgaramond,12pt]

\setupcapitals[sc=yes]

\setupbodyfontenvironment[default][em=italic]

\setupinterlinespace[line=3.2ex]

\setupalign[lesshyphenation,hz,hanging]

\showframe

\starttext

    \dostepwiserecurse {8} {12} {1} {
        \switchtobodyfont[#1pt]
        \input tufte
        \blank
    }

\stoptext
___________________________________________________________________________________
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 via email to