ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
To: ntg-context@ntg.nl
Subject: Re: Auto selecting optical sizes for a font
Date: Sat, 22 Jun 2013 14:07:22 +0200	[thread overview]
Message-ID: <51C5937A.3000002@wxs.nl> (raw)
In-Reply-To: <CAGhDZhBcyb+czPVSp0Qp712=95C85i7HyRco5nsneaWNG4xaAQ@mail.gmail.com>

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

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

[-- Attachment #2: ebgaramond.lfg --]
[-- Type: text/plain, Size: 1729 bytes --]

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",
        },
    }
}



[-- Attachment #3: type-imp-ebgaramond.tex --]
[-- Type: text/plain, Size: 1589 bytes --]

%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

[-- Attachment #4: designsizes-003.tex --]
[-- Type: text/plain, Size: 591 bytes --]

\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

[-- Attachment #5: 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
___________________________________________________________________________________

  parent reply	other threads:[~2013-06-22 12:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-21 23:43 Andres Conrado Montoya
2013-06-22 12:04 ` Pablo Rodríguez
2013-06-22 12:07 ` Hans Hagen [this message]
     [not found] <mailman.1409.1371913028.2084.ntg-context@ntg.nl>
2013-06-23 22:28 ` Georg Duffner
2013-06-24  8:02   ` Keith J. Schultz
2013-06-24 17:44     ` Hans Hagen
2013-06-24 17:42   ` Hans Hagen
     [not found] <mailman.1416.1372062425.2084.ntg-context@ntg.nl>
2013-06-24  9:49 ` Georg Duffner
2013-06-24 17:50   ` Hans Hagen
2013-06-25  4:16 Andres Conrado Montoya
2013-06-25  8:32 ` Hans Hagen
2013-06-25 21:16 Andres Conrado

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=51C5937A.3000002@wxs.nl \
    --to=pragma@wxs.nl \
    --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).