ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>,
	"Hamid,Idris" <Idris.Hamid@ColoState.EDU>
Subject: [NTG-context] Re: Applying \sc for smallcaps across styles
Date: Sat, 19 Aug 2023 17:26:09 +0200	[thread overview]
Message-ID: <aaadfddb-2d6e-b6ce-5c2f-9d226ba97187@gmail.com> (raw)
In-Reply-To: <2d3aa5f8-2d72-431b-ad8a-bab90e5288c1@Spark>


[-- Attachment #1.1: Type: text/plain, Size: 2858 bytes --]

Hamid,Idris schrieb am 19.08.2023 um 16:03:
> Dear gang,
>
> Consider the following typescript template:
>
> \definefontfeature
>   [myfont-tf-sc]
>   [mode=node,script=latn,language=dflt,trep=no,
>    protrusion=quality,expansion=quality,
>    compose=yes,combine=yes,tlig=yes,
>    kern=yes,liga=yes,onum=yes,cpsp=yes,smcp=yes, % smcp activie
>    trnsl=force]
>
> % synonym mapping
> \starttypescript [serif] [myfont] [name]
>   \loadfontgoodies[myfontlfg]
>   \definefontsynonym [Serif]           [MyFontRegular] 
>  [features=myfont-tf]
>   \definefontsynonym [SerifItalic]     [MyFontItalic] 
>  [features=myfont-it]
>   \definefontsynonym [SerifBold]       [MyFontBold]  [features=myfont-tf]
>   \definefontsynonym [SerifBoldItalic] [MyFontBoldItalic] 
> [features=myfont-it]
>
>   \definefontsynonym [SerifCaps]           [MyFontRegular] 
>  [features=myfont-tf-sc]
>   \definefontsynonym [SerifCapsItalic]     [MyFontItalic] 
>  [features=myfont-it-sc]
>   \definefontsynonym [SerifCapsBold]       [MyFontBold] 
>  [features=myfont-tf-sc]
>   \definefontsynonym [SerifCapsBoldItalic] [MyFontBoldItalic] 
> [features=myfont-it-sc]
> \stoptypescript
>
> % font mapping
> \starttypescript [serif] [myfont]
>   \loadfontgoodies[myfontlfg]
>   \definefontsynonym [MyFontRegular]     [file:MyFont-Regular] % 
> [features=myfont-tf]
>   \definefontsynonym [MyFontItalic]      [file:MyFont-It]      % 
> [features=myfont-it]
>   \definefontsynonym [MyFontBold]        [file:MyFont-Bold]    % 
> [features=myfont-tf]
>   \definefontsynonym [MyFontBoldItalic]  [file:MyFont-BoldIt]  % 
> [features=myfont-it]
> \stoptypescript
>
> As is well known, \sc selects the small caps only from the Serif font, 
> not from SerifBold etc. But MyFont has smallcaps for every style. So 
> in the typescript we make that explicit and apply the 
> smcp=yes fontfeature to SerifCapsBold etc.
>
> But this does not work: \sc still only applies to Serif or SerifCaps.
>
> Now I can load a goodies file myfontlfg and do something like this:
>
> local smallcaps = {
>     smcp = yes,
> }
>
> But that does not change the behavior of \sc.
>
> Yes, there is an easy workaround:
>
> \definefontfeature[smallcaps][smcp=yes]
> \define\sc{\addff{smallcaps}}
>
> This works for all styles that have the smcp feature, but I don't like 
> having to redefine a system command.
>
> So the questions are:
>
> 1) Is there a recommended\better way to get \sc to work across all 
> styles?

\setupbodyfont[pagella]

\starttext

\tf Upright, \it Italic, \bf Bold and \bi Bolditalic

\style[style=smallcaps]{\tf Upright, \it Italic, \bf Bold and \bi 
Bolditalic}

\tf Upright, \it Italic, \bf Bold and \bi Bolditalic

\setsmallcaps\tf Upright, \it Italic, \bf Bold and \bi Bolditalic

\stoptext


[-- Attachment #1.2: Type: text/html, Size: 4369 bytes --]

[-- Attachment #2: Type: text/plain, Size: 495 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2023-08-19 15:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-19 14:03 [NTG-context] " Hamid,Idris
2023-08-19 15:26 ` Wolfgang Schuster [this message]
2023-08-19 18:36   ` [NTG-context] " Hamid,Idris
2023-08-19 19:01     ` Wolfgang Schuster
2023-08-19 19:14       ` Hamid,Idris
2023-08-19 20:17         ` Hamid,Idris
2023-08-19 17:36 ` Pablo Rodriguez
2023-08-19 18:56   ` Hamid,Idris

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=aaadfddb-2d6e-b6ce-5c2f-9d226ba97187@gmail.com \
    --to=wolfgang.schuster.lists@gmail.com \
    --cc=Idris.Hamid@ColoState.EDU \
    --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).