Re: [NTG-context] Non-standard font alternatives

2023-04-20 Thread Pawel Urbanski via ntg-context

I've found the following Github repository with the typscripts definitions:

https://github.com/r3n4ud/roboto-context


When I use this type-imp-roboto.mkiv file fonts are used and embedded 
when using Roboto in thes \setupbodyfont[].



When I use ebgaramond as the body font but use:

\switchtobodyfont[roboto,20pt] in the \setuphead[] call the font is not 
embedded and seems to be not used.



I am more optimistic but still confused what can be wrong.



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


Re: [NTG-context] Non-standard font alternatives

2023-04-19 Thread Pawel Urbanski via ntg-context

Dear Hraban,

No, it does not. I am attaching hte type file and the short test document.


Here are the links where one can download the fonts:

https://github.com/googlefonts/roboto/releases

https://fonts.google.com/specimen/Roboto+Slab

 I am wondering if 'hinted' or 'unhinted' release of Roboto found at 
Github matters.



Trust me, that your time ahd help if very much appriciated. I know how 
much time it may take to debug such issue - just for rewriting the files 
with small changes.




\usetypescriptfile[ebgaramond]
\usetypescriptfile[roboto]
\usebodyfont[roboto]
\setupbodyfont[roboto]

\setuphead[chapter]
[style={\switchtobodyfont[roboto,20pt]\ss}]

\starttext

     \startchapter[title=Whatever is the best title]
         \input tufte
     \stopchapter
\startchapter[title={Just a second title}]

Some random text.

\stopchapter

\stoptext
\definefontfeature[robotofeatures][
  mode=node,
  ccmp=yes, % character composition
  liga=yes, tlig=yes, % ligatures
  pnum=yes,
  cpsp=yes, % capital spacing
  kern=yes,
  language=dflt,
  protrusion=quality,
  expansion=quality,
]

\definefontfeature[smallcaps][ % use with \addff
  smcp=yes, % smallcaps
  % c2sc=yes, % caps to smallcaps
]

\starttypescript[sans][roboto,robotosans]
  \definefontsynonym[Roboto-Regular][name:robotoregular]
  \definefontsynonym[Roboto-Black][name:robotoblack]
  \definefontsynonym[Roboto-BlackItalic][name:robotoblackitalic]
  \definefontsynonym[Roboto-Bold][name:robotobold]
  \definefontsynonym[Roboto-BoldItalic][name:robotobolditalic]
  \definefontsynonym[Roboto-Italic][name:robotoitalic]
  \definefontsynonym[Roboto-Light][name:robotolight]
  \definefontsynonym[Roboto-LightItalic][name:robotolightitalic]
  \definefontsynonym[Roboto-Medium][name:robotomedium]
  \definefontsynonym[Roboto-MediumItalic][name:robotomediumitalic]
  \definefontsynonym[Roboto-Italic][name:robotoitalic]
%  \definefontsynonym[Roboto-Regular][name:robotoregular]
  \definefontsynonym[Roboto-Thin][name:robotothin]
  \definefontsynonym[Roboto-ThinItalic][name:robotothinitalic]
\stoptypescript

\starttypescript[sans][roboto,robotosans][name]
  \definefontsynonym [SansThin]         [Roboto-Thin]        
[features=robotofeatures]
  \definefontsynonym [SansThinItalic]   [Roboto-ThinItalic]  
[features=robotofeatures]
  \definefontsynonym [SansThinSlanted]  [Roboto-ThinItalic]  
[features=robotofeatures]
  \definefontsynonym [SansLight]        [Roboto-Light]       
[features=robotofeatures]
  \definefontsynonym [SansLightItalic]  [Roboto-LightItalic] 
[features=robotofeatures]
  \definefontsynonym [SansLightSlanted] [Roboto-LightItalic] 
[features=robotofeatures]
  \definefontsynonym [Sans]             [Roboto-Regular]     
[features=robotofeatures]
  \definefontsynonym [SansItalic]       [Roboto-Italic]      
[features=robotofeatures]
  \definefontsynonym [SansSlanted]      [Roboto-Italic]      
[features=robotofeatures]
  \definefontsynonym [SansCaps]         [Roboto-Regular]     
[features={robotofeatures,smallcaps}]
  \definefontsynonym [SansMedium]       [Roboto-Medium]      
[features=robotofeatures]
  \definefontsynonym [SansMediumItalic] 
[Roboto-MediumItalic][features=robotofeatures]
  \definefontsynonym 
[SansMediumSlanted][Roboto-MediumItalic][features=robotofeatures]
  \definefontsynonym [SansBold]         [Roboto-Bold]        
[features=robotofeatures]
  \definefontsynonym [SansBoldItalic]   [Roboto-BoldItalic]  
[features=robotofeatures]
  \definefontsynonym [SansBoldSlanted]  [Roboto-BoldItalic]  
[features=robotofeatures]
  \definefontsynonym [SansBlack]        [Roboto-Black]       
[features=robotofeatures]
  \definefontsynonym [SansBlackItalic]  [Roboto-BlackItalic] 
[features=robotofeatures]
  \definefontsynonym [SansBlackSlanted] [Roboto-BlackItalic] 
[features=robotofeatures]
\stoptypescript

\starttypescript[sans][roboto-light][name]
  \definefontsynonym [Sans]             [Roboto-Light]         
[features=robotofeatures]
  \definefontsynonym [SansItalic]       [Roboto-LightItalic]   
[features=robotofeatures]
  \definefontsynonym [SansSlanted]      [Roboto-LightItalic]   
[features=robotofeatures]
  \definefontsynonym [SansCaps]         [Roboto-Light]         
[features={robotofeatures,smallcaps}]
  \definefontsynonym [SansBold]         [Roboto-Medium]        
[features=robotofeatures]
  \definefontsynonym [SansBoldItalic]   [Roboto-MediumItalic]  
[features=robotofeatures]
  \definefontsynonym [SansBoldSlanted]  [Roboto-MediumItalic]  
[features=robotofeatures]
\stoptypescript

\starttypescript[sans][roboto-medium][name]
  \definefontsynonym [Sans]             [Roboto-Medium]     
[features=robotofeatures]
  \definefontsynonym [SansItalic]       [Roboto-MediumItalic]      
[features=robotofeatures]
  \definefontsynonym [SansSlanted]      [Roboto-MediumItalic]      
[features=robotofeatures]
  \definefontsynonym [SansCaps]         [Roboto-Medium]     
[features={robotofeatures,smallcaps}]
  \definefontsynonym [SansBold]         

Re: [NTG-context] Non-standard font alternatives

2023-04-19 Thread Henning Hraban Ramm via ntg-context

Am 19.04.23 um 16:53 schrieb Pawel Urbanski via ntg-context:

Dear Matthew,
I wrote you off the list in connection to the other thread where Hans 
helped me with using Roboto Flex.
I used your typescript definitions but the font is not embedded in the 
document.


** I've copied all the ttf font files to the recommended directory 
structure under: texmf-local/fonts/truetype.
** I've created a type-imp-roboto.mkiv file and saved it in the 
recommended location under: texmf-local/tex/.../mkiv/.
Using: \usetypescript or \usetypescriptfile or \usebodyfont [roboto] 
with setuphead does not work.


I use the following simplest setup command:
\setuphead[chapter][style={\switchtobodyfont[roboto,20pt]\ss}]


\switchtobodyfont[roboto,ss,20pt] is better than what you have; don’t 
know if it makes a difference.


Does \setupbodyfont[roboto] work for the main (i.e. body) font?

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


Re: [NTG-context] Non-standard font alternatives

2023-04-19 Thread Pawel Urbanski via ntg-context
Yes, I did - all the files are listed. I can attach my files if that can 
be of any help - in case when someone wants to be generous with time and 
wisdom.



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


Re: [NTG-context] Non-standard font alternatives

2023-04-19 Thread Henning Hraban Ramm via ntg-context

Am 19.04.23 um 16:53 schrieb Pawel Urbanski via ntg-context:

Dear Matthew,
I wrote you off the list in connection to the other thread where Hans 
helped me with using Roboto Flex.
I used your typescript definitions but the font is not embedded in the 
document.


** I've copied all the ttf font files to the recommended directory 
structure under: texmf-local/fonts/truetype.
** I've created a type-imp-roboto.mkiv file and saved it in the 
recommended location under: texmf-local/tex/.../mkiv/.
Using: \usetypescript or \usetypescriptfile or \usebodyfont [roboto] 
with setuphead does not work.


Did you run
mtxrun --generate
?

And did you check with
mtxrun --script fonts --list --all --pattern=roboto
?

If ConTeXt can’t find the files, nothing meaningful will happen.

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


Re: [NTG-context] Non-standard font alternatives

2023-04-19 Thread Pawel Urbanski via ntg-context
>
> Dear Matthew,
I wrote you off the list in connection to the other thread where Hans
helped me with using Roboto Flex.
I used your typescript definitions but the font is not embedded in the
document.

** I've copied all the ttf font files to the recommended directory
structure under: texmf-local/fonts/truetype.
** I've created a type-imp-roboto.mkiv file and saved it in the recommended
location under: texmf-local/tex/.../mkiv/.
Using: \usetypescript or \usetypescriptfile or \usebodyfont [roboto] with
setuphead does not work.

I use the following simplest setup command:
\setuphead[chapter][style={\switchtobodyfont[roboto,20pt]\ss}]

I will be glad to join forces and create the typescript file but maybe
missing something obvious. While I could use an inline definition suggested
by Hans in the other thread, Roboto is a great font and I or other people
would like to use it as a shared resource.

All the best and thanks for help and feedback,
Pawel
___
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
___


Re: [NTG-context] Non-standard font alternatives

2023-01-05 Thread Hans Hagen via ntg-context

On 12/14/2022 11:49 AM, Matthew McCabe wrote:


For anyone else looking to do something similar, since the typescript is just a 
tex file it seems if one places it in one’s local directory it will be 
accessible when ConTeXt generates the pdf. I saved it as type-imp-roboto.tex in 
my local directory and used ‘\usebodyfont[roboto]’ and 
‘\usebodyfont[roboto-light]’ to preload the fonts as recommended 
(\usetypescriptfile didn’t seem to be required).
you can also put the definitions in the style (depends on how often you 
reuse it)


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-

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


Re: [NTG-context] Non-standard font alternatives

2022-12-14 Thread Wolfgang Schuster via ntg-context

Matthew McCabe via ntg-context schrieb am 13.12.2022 um 09:15:

Hi list,

I'm looking to import a font with medium and light weights (in this case 
Roboto) and define font alternatives so one can quickly switch to light 
text just as one would switch to bold text. There is a stackexchange 
answer from Wolfgang 
(https://tex.stackexchange.com/questions/303648/context-font-weights) 
which details a solution to this problem for ConTeXt MkIV but despite my 
best efforts I haven't been able to get things to work for me. There is 
the Roboto typescript example on ConTeXt garden but it isn't exactly 
what I'm looking for as for the document I'm making I would prefer to be 
able to treat the font weights as alternatives rather than separate 
families since I will be switching often.


One can download the exact set of fonts I am using from 
https://fonts.google.com/specimen/Roboto


Here is my code:

[...]

\starttypescript [sans] [roboto]
   \definebodyfont [default] [rm]


Replace [rm] with [ss]:

\definebodyfont [default] [ss]


      [lf=SansLight sa 1,
       li=SansLightItalic sa 1,
       tf=Sans sa 1,
       it=SansItalic sa 1,
       md=SansMedium sa 1,
       mi=SansMediumItalic sa 1,
       bf=SansBold sa 1,
       bi=SansBoldItalic sa 1,
       sc=SansCaps sa 1]
\stoptypescript

\definetypeface[roboto][rm][sans][roboto][default]


Replace [rm] with [ss]:

\definetypeface [roboto] [ss] [sans] [roboto] [default]

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


Re: [NTG-context] Non-standard font alternatives

2022-12-14 Thread Matthew McCabe via ntg-context
> On 13 Dec 2022, at 7:53 pm, Hans Hagen via ntg-context  
> wrote:
> 
> On 12/13/2022 9:15 AM, Matthew McCabe via ntg-context wrote:
>> Hi list,
>> I'm looking to import a font with medium and light weights (in this case 
>> Roboto) and define font alternatives so one can quickly switch to light text 
>> just as one would switch to bold text. There is a stackexchange answer from 
>> Wolfgang 
>> (https://tex.stackexchange.com/questions/303648/context-font-weights 
>> ) which 
>> details a solution to this problem for ConTeXt MkIV but despite my best 
>> efforts I haven't been able to get things to work for me. There is the 
>> Roboto typescript example on ConTeXt garden but it isn't exactly what I'm 
>> looking for as for the document I'm making I would prefer to be able to 
>> treat the font weights as alternatives rather than separate families since I 
>> will be switching often.
> take a look at type-imp-plex.mkiv (just remove the \s! in your case)
> 
> basically you define two typefaces: normal and light and then just switch 
> between these, as in:
> 
> at the top of your document you say
> 
> \usebodyfont[plex]   % preloads
> \usebodyfont[plex-light] % preloads
> 
> \setupbodyfont[plex] % enables main font
> 
> and after that
> 
> {\switchtobodyfont[plex-light]  }
> 
> will do a consistent switch
> 
> Hans
> 
> 
> -
>  Hans Hagen | PRAGMA ADE
>  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
> 
> ___
> 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
> ___

Thanks for the reply and your help Hans, ok so if I understand correctly the 
canonical way to integrate light weight font is to define two typefaces. I 
wrote up a typescript for (Sans) Roboto based on the example typescript from 
ConTeXt garden using only the Sans variants and it’s working well.

For anyone else looking to do something similar, since the typescript is just a 
tex file it seems if one places it in one’s local directory it will be 
accessible when ConTeXt generates the pdf. I saved it as type-imp-roboto.tex in 
my local directory and used ‘\usebodyfont[roboto]’ and 
‘\usebodyfont[roboto-light]’ to preload the fonts as recommended 
(\usetypescriptfile didn’t seem to be required).

Here is my typescript, for the Sans Roboto font, pretty much picked out of the 
context garden example typescript for Roboto:

\definefontfeature[robotofeatures][
  mode=node,
  ccmp=yes, % character composition
  liga=yes, tlig=yes, % ligatures
  pnum=yes,
  cpsp=yes, % capital spacing
  kern=yes,
  language=dflt,
  protrusion=quality,
  expansion=quality,
]

\definefontfeature[smallcaps][ % use with \addff
  smcp=yes, % smallcaps
  % c2sc=yes, % caps to smallcaps
]

\starttypescript[sans][roboto,robotosans]
  \definefontsynonym[Roboto-Regular][name:robotoregular]
  \definefontsynonym[Roboto-Black][name:robotoblack]
  \definefontsynonym[Roboto-BlackItalic][name:robotoblackitalic]
  \definefontsynonym[Roboto-Bold][name:robotobold]
  \definefontsynonym[Roboto-BoldItalic][name:robotobolditalic]
  \definefontsynonym[Roboto-Italic][name:robotoitalic]
  \definefontsynonym[Roboto-Light][name:robotolight]
  \definefontsynonym[Roboto-LightItalic][name:robotolightitalic]
  \definefontsynonym[Roboto-Medium][name:robotomedium]
  \definefontsynonym[Roboto-MediumItalic][name:robotomediumitalic]
  \definefontsynonym[Roboto-Italic][name:robotoitalic]
  \definefontsynonym[Roboto-Regular][name:robotoregular]
  \definefontsynonym[Roboto-Thin][name:robotothin]
  \definefontsynonym[Roboto-ThinItalic][name:robotothinitalic]
\stoptypescript

\starttypescript[sans][roboto,robotosans][name]
  \definefontsynonym [SansThin] [Roboto-Thin]
[features=robotofeatures]
  \definefontsynonym [SansThinItalic]   [Roboto-ThinItalic]  
[features=robotofeatures]
  \definefontsynonym [SansThinSlanted]  [Roboto-ThinItalic]  
[features=robotofeatures]
  \definefontsynonym [SansLight][Roboto-Light]   
[features=robotofeatures]
  \definefontsynonym [SansLightItalic]  [Roboto-LightItalic] 
[features=robotofeatures]
  \definefontsynonym [SansLightSlanted] [Roboto-LightItalic] 
[features=robotofeatures]
  \definefontsynonym [Sans] [Roboto-Regular] 
[features=robotofeatures]
  

Re: [NTG-context] Non-standard font alternatives

2022-12-13 Thread Hans Hagen via ntg-context

On 12/13/2022 9:15 AM, Matthew McCabe via ntg-context wrote:

Hi list,

I'm looking to import a font with medium and light weights (in this case 
Roboto) and define font alternatives so one can quickly switch to light 
text just as one would switch to bold text. There is a stackexchange 
answer from Wolfgang 
(https://tex.stackexchange.com/questions/303648/context-font-weights 
) 
which details a solution to this problem for ConTeXt MkIV but despite my 
best efforts I haven't been able to get things to work for me. There is 
the Roboto typescript example on ConTeXt garden but it isn't exactly 
what I'm looking for as for the document I'm making I would prefer to be 
able to treat the font weights as alternatives rather than separate 
families since I will be switching often.

take a look at type-imp-plex.mkiv (just remove the \s! in your case)

basically you define two typefaces: normal and light and then just 
switch between these, as in:


at the top of your document you say

\usebodyfont[plex]   % preloads
\usebodyfont[plex-light] % preloads

\setupbodyfont[plex] % enables main font

and after that

{\switchtobodyfont[plex-light]  }

will do a consistent switch

Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-

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