[NTG-context] what am I missing in the typescript?

2024-05-15 Thread madiazm . eoicc
Hi all,
I'm trying to configure my document to use Libertinus font for the general text 
and Cormorant for the headings, but I can't get the cormorant-font applied 
(neither in the text self). The Libertinus fonts get loaded without problems 
but for cormorant I don't get even a message in log, as if it was invisible.
What am I missing? here my script:


 
\definefontfeature[Libertinusfeatures][
  mode=node,
  ccmp=yes, % character composition
  liga=yes, tlig=yes, % ligatures
  tnum=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[serif][libertinus]
\definefontsynonym[LibertinusSerif-Regular]   
[file:/fonts/LibertinusSerif-Regular.otf]
\definefontsynonym[LibertinusSerif-Italic]
[file:/fonts/LibertinusSerif-Italic.otf]
\definefontsynonym[LibertinusSerif-Bold]  
[file:/fonts/LibertinusSerif-Semibold.otf]
\definefontsynonym[LibertinusSerif-BoldItalic]
[file:/fonts/LibertinusSerif-SemiboldItalic.otf]
\definefontsynonym[LibertinusSerif-Slanted]   
[file:/fonts/LibertinusSerif-Italic.otf]
\stoptypescript

\starttypescript[serif][libertinus][name]

\definefontsynonym [Serif] [LibertinusSerif-Regular]
[features=Libertinusfeatures]
\definefontsynonym [SerifRegular]  [LibertinusSerif-Regular]
[features=Libertinusfeatures]
\definefontsynonym [SerifItalic]   [LibertinusSerif-Italic] 
[features=Libertinusfeatures]
\definefontsynonym [SerifSlanted]  [LibertinusSerif-Italic]   
[features=Libertinusfeatures]
\definefontsynonym [SerifCaps] [LibertinusSerif-Regular]
[features={Libertinusfeatures,smallcaps}]
\definefontsynonym [SerifBold] [LibertinusSerif-Bold]   
[features=Libertinusfeatures]
\definefontsynonym [SerifBoldItalic]   [LibertinusSerif-BoldItalic]   
[features=Libertinusfeatures]
\definefontsynonym [SerifBoldSlanted]  [LibertinusSerif-BoldItalic] 
[features=Libertinusfeatures]

\stoptypescript



% SANS

\starttypescript[sans][libertinussans]
\definefontsynonym[LibertinusSans-Regular]
[file:/fontsSans/LibertinusSans-Regular.otf]
\definefontsynonym[LibertinusSans-Italic] 
[file:/fontsSans/LibertinusSans-Italic.otf]
\definefontsynonym[LibertinusSans-Bold]   
[file:/fontsSans/LibertinusSans-Bold.otf]
\stoptypescript


\starttypescript[sans][libertinussans][name]
\definefontsynonym [Sans] [LibertinusSans-Regular]
[features=Libertinusfeatures]
\definefontsynonym [SansItalic]   [LibertinusSans-Italic] 
[features=Libertinusfeatures]
\definefontsynonym [SansSlanted]  [LibertinusSans-Italic] 
[features=Libertinusfeatures]
\definefontsynonym [SansCaps] [LibertinusSans-Regular]
[features={Libertinusfeatures,smallcaps}]
\definefontsynonym [SansBold] [LibertinusSans-Bold]
[features=Libertinusfeatures]
\stoptypescript

%MONO

\starttypescript[mono][libertinusmono]
\definefontsynonym[LibertinusMono-Regular]
[file:/fontsMono/LibertinusMono-Regular.otf]
\stoptypescript


\starttypescript[mono][libertinusmono][name]
\definefontsynonym [Mono] [LibertinusMono-Regular]
[features=none]
\stoptypescript

%CORMORANT

\starttypescript[serif][cormorant]
\definefontsynonym[Cormorant-Regular][file:/fonts/Cormorant-Regular.otf]
\stoptypescript


\starttypescript[serif][cormorant][name]
\definefontsynonym [SerifRegular] [Cormorant-Regular]
[features=default]
\stoptypescript

% FAMILY



\starttypescript[miFuente]
\definetypeface [miFuente] [rm] [serif] [libertinus] [default]
\definetypeface [miFuente] [ss] [sans]  [libertinussans] [default]
\definetypeface [miFuente] [tt] [mono]  [libertinusmono] [default]
\stoptypescript

\starttypescript[miCorm]
\definetypeface [miCorm] [rm] [serif] [cormorant] [default]
\stoptypescript


\setupbodyfont[miFuente, 12pt]


\starttext


\startsection[title=Aspectos generales]

Esta guía contiene toda la documentación necesaria para administrar la {\it 
prueba unificada de certificación} que ha diseñado la comisión de alemán. Se 
ruega al profesorado que se familiarice con las secciones del documento a 
través del índice y acuda a ellas según vaya siendo necesario, de manera que se 
pueda {\bf administrar y corregir} la prueba de la manera más satisfactoria 
posible.

%%% trying to get cormorant working...

\startsubsection[title=Organización de carpetas]
{\switchtobodyfont[miCorm] {\tfc la fuente Cormorant no funciona}}
\stopsubsection



Las carpetas aparecen nombradas {\ss por idioma}, nivel y set de pruebas, no 
apareciendo ninguna referencia a convocatorias ni tampoco fechas. Sí aparece la 
referencia a la convocatoria en cada una de las guías de administración para 
los diferentes niveles.
La carpeta correspondiente a cada nivel contiene las distintas

[NTG-context] Re: Applying \sc for smallcaps across styles

2023-08-19 Thread Hamid,Idris
Many thanks. From font-pre.mkiv:

\definealternativestyle [\v!smallcaps] [\setsmallcaps] [\setsmallcaps]
:
\unexpanded\def\setsmallcaps{\doaddfeature{f:smallcaps}}

So on the wiki we should say that \sc is a deprecated/legacy command that no 
longer makes sense in an opentype-features world. New users should no longer 
use it.

Best wishes
Idris

--
Professor Idris Samawi Hamid
Department of Philosophy
Colorado State University
Fort Collins, CO 80523
On Aug 19, 2023, 9:26 AM -0600, Wolfgang Schuster 
, wrote:

** Caution: EXTERNAL Sender **

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

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

[NTG-context] Re: Applying \sc for smallcaps across styles

2023-08-19 Thread Wolfgang Schuster

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

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

[NTG-context] Applying \sc for smallcaps across styles

2023-08-19 Thread Hamid,Idris
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?
2) Are there any edits you would recommend to the above typescript template?

Once we're clear on this, will update this quite obsolete page:
https://wiki.contextgarden.net/Bold_small_caps

Thank you in advance.

Best wishes
Idris

PS Sometimes these inquiries may appear more verbose than needed. That is 
because I'm trying to write as clearly as possible, not only for the experts 
and masters, but also for beginners and intermediate users who may run into 
these things one day, search the archives, etc..

--
Professor Idris Samawi Hamid
Department of Philosophy
Colorado State University
Fort Collins, CO 80523
___
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
___

[NTG-context] Font switching, default features, and a request

2023-08-13 Thread Hamid,Idris
Dear gang,

Consider the following example:

==

\setupdirections[bidi=global,method=one]

\startTEXpage[offset=1em,width=14in]
\definedfont[almfixed*arabic]
\switchtobodyfont[almfixed*arabic]
\switchtobodyfont[almfixed]

% \addff{arabic}

\startbuffer[]
\startlines
الثَّعْلَبُ الْأَسْمَرُ السَّرِيعُ يَقْفِزُ فَوْقَ الْكَلْبِ الْكَسُولِ!
The quick brown fox jumps over the lazy dog!
\stoplines
\stopbuffer

{\tfxx \type{\tfxx} \getbuffer}

{\tfx \type{\tfx} \getbuffer}

\type{\tf} \getbuffer

{\tfa \type{\tfa} \getbuffer}

{\tfb \type{\tfb} \getbuffer}

{\tfc \type{\tfc} \getbuffer}

{\tfd \type{\tfd} \getbuffer}
\stopTEXpage
==

There are three font switches to choose from:

==
\definedfont[almfixed*arabic]
\switchtobodyfont[almfixed*arabic]
\switchtobodyfont[almfixed]
==

Let's toggle one at a time:

1) \definedfont[almfixed*arabic]

a) gives us the correct bidi output, but only for the \tf size
b) is ignored for every other size switch.

a) and b) are expected behavior.

2) \switchtobodyfont[almfixed]

a) gives us Arabic-script bidi output,
b) exhibits no Arabic-script features
c) gives the same result for each size switch

This means that the fontfeature "arabic" -- already predefined in ConTeXt 
(font-pre.mkiv) -- is not explicitly applied.

Curiously, invoking

\addff{arabic}

does not affect the output. Why is it that \addff{arabic} does not work here?

3) \switchtobodyfont[almfixed*arabic]

suppresses the font entirely and we're back to Latin Modern for all sizes. 
Assuming that this is expected behavior, it appears to follow that fontfeatures 
cannot be invoked for \switchtobodyfont and the like, only from within the 
typescript read by \switchtobodyfont etc.
===

REQUEST:

Since ALMFixed is already distributed with ConTeXt, could Hans make the 
fontfeature "arabic" default for this font? That is

\switchtobodyfont[almfixed]

should automatically

a) give us Arabic-script bidi output (already there),
b) exhibit Arabic-script features (missing)
c) gives the same result for each size switch (already there)

(Indeed, it would be useful to have *arabic-predefined typescripts/bodyfonts 
for a few other commonly available/used Arabic fonts as well. Would be willing 
to make a list at some point, test, etc.)

Thank you in advance for considering this request.

Best wishes
Idris

--
Professor Idris Samawi Hamid
Department of Philosophy
Colorado State University
Fort Collins, CO 80523
___
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]         [Roboto-Black

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

Re: [NTG-context] LMTX: reimplementing texquotes as OTF feature

2022-11-12 Thread Leah Neukirchen via ntg-context
Hans Hagen via ntg-context  writes:

> can you show what is wrong and what it should be with
>
> fonts.handlers.otf.addfeature {
> name = "germantexlig",
> type = "ligature",
> data = {
> ['“'] = { "`", "`" },
> ['”'] = { "'", "'" },
> ['„'] = { '"', "`" },
> ['“'] = { '"', "'" },
> ['‘'] = { "`" },
> ['’'] = { "'" }
> }
> }

Since `` and "' map to the same character, only "' works.
The table has only 5 entries, not 6!  (This took me a while to realize. ;))

> best not use an existign feature because we accumulate ... features
> come in order (you can force order if needed as you probably saw in
> one of the test files)
>
> \definefontfeature[ltest][germantexlig=yes,trep=no] \addff{ltest}

I think "texlig" and "texsub" aren't existing features.  But even
renaming doesn't help.

I've attached the working Schola screenshot and the broken LModern
behavior.


-- 
Leah Neukirchenhttps://leahneukirchen.org/
___
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] LMTX: reimplementing texquotes as OTF feature

2022-11-11 Thread Hans Hagen via ntg-context

On 11/11/2022 10:19 PM, Leah Neukirchen via ntg-context wrote:

Hi,

as Hans recommended in the last video meeting, I tried to implement
the texquotes feature using OTF features, and hit two problems:

1) To support German quotes as well, I have two ligatures that end
up as the same glyph:
   `` -> “
   "' -> “
This can't be in the same ligature feature, as it will overwrite
the table entry with a duplicate key.

After some fiddling, I decided to map "' to a Unicode PUA symbol
and then add a second feature that maps this symbol to “ using
the substitute feature.  This works for TeX Gyre Schola.
But perhaps someone knows a nicer way.

2) This approach doesn't work for lmodern or palatino, I still
get "' as inch-sign/quote there... anything else I need to tweak
for these fonts?


\startluacode
 fonts.handlers.otf.addfeature {
 name = "texlig",
 type = "ligature",
 data = {
 ['“'] = { "`", "`" },
 ['”'] = { "'", "'" },
 ['„'] = { '"', "`" },
 [''] = { '"', "'" },
 ['‘'] = { "`" },
 ['’'] = { "'" }
 }
 }
 fonts.handlers.otf.addfeature {
 name = "texsub",
 type = "substitute",
 data = {
 [''] = '“',
 }
 }
\stopluacode

% with lmodern or palatino it breaks
\setupbodyfont[schola]

\definefontfeature[ltest][texlig=yes,texsub=yes,trep=no]
\addff{ltest}

\starttext

``foo'' `foo' "`foo"' 19" rack

\stoptext

can you show what is wrong and what it should be with

fonts.handlers.otf.addfeature {
name = "germantexlig",
type = "ligature",
data = {
['“'] = { "`", "`" },
['”'] = { "'", "'" },
['„'] = { '"', "`" },
['“'] = { '"', "'" },
['‘'] = { "`" },
['’'] = { "'" }
}
}

best not use an existign feature because we accumulate ... features come 
in order (you can force order if needed as you probably saw in one of 
the test files)


\definefontfeature[ltest][germantexlig=yes,trep=no] \addff{ltest}


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


[NTG-context] LMTX: reimplementing texquotes as OTF feature

2022-11-11 Thread Leah Neukirchen via ntg-context
Hi,

as Hans recommended in the last video meeting, I tried to implement
the texquotes feature using OTF features, and hit two problems:

1) To support German quotes as well, I have two ligatures that end
   up as the same glyph:
  `` -> “
  "' -> “
   This can't be in the same ligature feature, as it will overwrite
   the table entry with a duplicate key.

   After some fiddling, I decided to map "' to a Unicode PUA symbol
   and then add a second feature that maps this symbol to “ using
   the substitute feature.  This works for TeX Gyre Schola.
   But perhaps someone knows a nicer way.

2) This approach doesn't work for lmodern or palatino, I still
   get "' as inch-sign/quote there... anything else I need to tweak
   for these fonts?


\startluacode
fonts.handlers.otf.addfeature {
name = "texlig",
type = "ligature",
data = {
['“'] = { "`", "`" },
['”'] = { "'", "'" },
['„'] = { '"', "`" },
[''] = { '"', "'" },
['‘'] = { "`" },
['’'] = { "'" }
}
}
fonts.handlers.otf.addfeature {
name = "texsub",
type = "substitute",
data = {
[''] = '“',
    }
}
\stopluacode

% with lmodern or palatino it breaks
\setupbodyfont[schola]

\definefontfeature[ltest][texlig=yes,texsub=yes,trep=no]
\addff{ltest}

\starttext

``foo'' `foo' "`foo"' 19" rack

\stoptext


Thanks,
-- 
Leah Neukirchenhttps://leahneukirchen.org/
___
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] Add ssty to libertinus

2021-10-20 Thread Hans Hagen via ntg-context

On 10/20/2021 1:01 PM, Mikael Sundqvist via ntg-context wrote:

Hi,

looking at the output of

\setupbodyfont[libertinus]
%\setupmathematics[stylealternative={ssty}]
\starttext
%\addff{ssty}
$y'=f'$
\switchtobodyfont[newcomputermodern-book]
$y'=f'$
\stoptext


ssty doesn't kick in as we're in textstyle here (and even then \addff 
doesn't work in math mode; ssty is applied when we load a font, if at 
all because not all characters in a math font have a ssty feature 
definition)



I think that the primes in libertinus are too small. Indeed, looking
in the font, they look like the output. In lualatex* I get larger
primes, and as far as I understand it is because unicode-math enables
ssty.


it's a design decision ... (imo the tex and math font community never 
could make up its mind about primes so it will always be a pain) .. 
looks like here the creator assumed a script design size for text size



I was not able to do so with \addff{ssty} or with
\setupmathematics[stylealternative={ssty}]. What do I miss?

Best regards, Mikael

*The file I used in lualatex was this:
\documentclass{article}
\usepackage{fontspec}
\usepackage{unicode-math}
\setmathfont{LibertinusMath-Regular.otf}
\begin{document}
$u'f'$
\end{document}
whatever latex does to make these primes large is unlikely going to 
happen in context ... at some point, when these fonts stay as they are 
(all math fonts seem to have issues, but different ones) we can write 
font goodie files to 'fix them' at the font level, adding all kind of 
hacks to the context math handler is just stimulating 'not fixing a font'


\setupbodyfont[cambria]
\starttext
$y'=f'$
$\textstyle\prime$
$\scriptstyle\prime$
$\scriptscriptstyle\prime$
\switchtobodyfont[libertinus]
$y'=f'$
$\textstyle\prime$
$\scriptstyle\prime$
$\scriptscriptstyle\prime$
\switchtobodyfont[newcomputermodern-book]
$y'=f'$
$\textstyle\prime$
$\scriptstyle\prime$
$\scriptscriptstyle\prime$
\stoptext

-
  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 / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Add ssty to libertinus

2021-10-20 Thread Mikael Sundqvist via ntg-context
Hi,

looking at the output of

\setupbodyfont[libertinus]
%\setupmathematics[stylealternative={ssty}]
\starttext
%\addff{ssty}
$y'=f'$
\switchtobodyfont[newcomputermodern-book]
$y'=f'$
\stoptext

I think that the primes in libertinus are too small. Indeed, looking
in the font, they look like the output. In lualatex* I get larger
primes, and as far as I understand it is because unicode-math enables
ssty.

I was not able to do so with \addff{ssty} or with
\setupmathematics[stylealternative={ssty}]. What do I miss?

Best regards, Mikael

*The file I used in lualatex was this:
\documentclass{article}
\usepackage{fontspec}
\usepackage{unicode-math}
\setmathfont{LibertinusMath-Regular.otf}
\begin{document}
$u'f'$
\end{document}
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Unicode normalization and Hebrew in ConTeXt

2021-08-17 Thread Joey McCollum via ntg-context
Thankfully, it looks like this was just a problem with my implementation of
the OpenType feature and not with ConTeXt's handling of it! (I worried that
it might be ConTeXt when I saw that XeLaTeX was handing the feature
correctly.) Hans graciously helped me identify the problem, and everything
looks good now!

Joey

On Tue, Aug 17, 2021 at 8:56 AM Joey McCollum 
wrote:

> Shouldn't dlig automatically be enabled under the "hebrew" feature set? In
> font-pre.mkiv, hebrew inherits from semitic-complete, which sets dlig=yes.
>
> Still, if I explicitly add dlig, as in the following example, things
> change, but they still aren't right:
>
> ```
>
> \starttypescriptcollection[keteryg]
>
> \starttypescript[serif][keteryg]
>
> \definefontsynonym[Serif][file:../fonts/KeterYG/KeterYG-Medium.ttf][features=hebrew]
> % all the necessary Hebrew features, including dlig
>
> \stoptypescript
>
>
> \starttypescript[keteryg]
>
> \definetypeface[keteryg][rm][serif][keteryg][default]
>
> \stoptypescript
>
> \stoptypescriptcollection
>
>
> %Set up the main font:
>
> \setupbodyfont[keteryg]
>
> %Set up right-to-left alignment:
>
> \setupalign[r2l]
>
> %Explicitly add dlig (in case it wasn't there already):
>
> \definefontfeature[plus-dlig][dlig=yes]
>
>
> \starttext
>
> \addff{plus-dlig}
>
> שֹׂבַע
>
> עָשׂוֹר
>
> קֹשֶׁט
>
> שֹׁשַׁנִּים
>
> עָשׂוֹר
>
> מֹשֶׁה
>
> שַׁלֹשׁ
>
> \stoptext ``` In examples 1, 3, 4, and 6, the *holam *of the preceding
> letter (which should have been stripped in the contextual substitution)
> just seems to have been moved farther up. In fact, the output looks like it
> would look if I turned off the reordercombining feature. (And indeed, if I
> manually reorder the glyphs to the Hebrew Layout Intelligence order, then
> the results look like they did when I just used the "hebrew" feature.)
>
>
> I may have forgotten to attach the font file I was using for this test. If
> that is the case, it is available at
> https://github.com/jjmccollum/Keter-YG.
>
>
> Joey
>
> On Tue, Aug 17, 2021 at 5:19 AM Hans Hagen  wrote:
>
>> On 8/17/2021 2:07 AM, Joey McCollum wrote:
>>
>> > Sorry to bring this up after over a year, but I just noticed something
>> > that doesn't seem right. I implemented some contextual substitutions in
>> > my own fork of the Keter YG Hebrew font (.ttf file attached) under the
>> > "dlig" feature that should do the following two things:
>> but you don't enable dlig
>>
>> -
>>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 / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Unicode normalization and Hebrew in ConTeXt

2021-08-17 Thread Joey McCollum via ntg-context
Shouldn't dlig automatically be enabled under the "hebrew" feature set? In
font-pre.mkiv, hebrew inherits from semitic-complete, which sets dlig=yes.

Still, if I explicitly add dlig, as in the following example, things
change, but they still aren't right:

```

\starttypescriptcollection[keteryg]

\starttypescript[serif][keteryg]

\definefontsynonym[Serif][file:../fonts/KeterYG/KeterYG-Medium.ttf][features=hebrew]
% all the necessary Hebrew features, including dlig

\stoptypescript


\starttypescript[keteryg]

\definetypeface[keteryg][rm][serif][keteryg][default]

\stoptypescript

\stoptypescriptcollection


%Set up the main font:

\setupbodyfont[keteryg]

%Set up right-to-left alignment:

\setupalign[r2l]

%Explicitly add dlig (in case it wasn't there already):

\definefontfeature[plus-dlig][dlig=yes]


\starttext

\addff{plus-dlig}

שֹׂבַע

עָשׂוֹר

קֹשֶׁט

שֹׁשַׁנִּים

עָשׂוֹר

מֹשֶׁה

שַׁלֹשׁ

\stoptext ``` In examples 1, 3, 4, and 6, the *holam *of the preceding
letter (which should have been stripped in the contextual substitution)
just seems to have been moved farther up. In fact, the output looks like it
would look if I turned off the reordercombining feature. (And indeed, if I
manually reorder the glyphs to the Hebrew Layout Intelligence order, then
the results look like they did when I just used the "hebrew" feature.)


I may have forgotten to attach the font file I was using for this test. If
that is the case, it is available at https://github.com/jjmccollum/Keter-YG.


Joey

On Tue, Aug 17, 2021 at 5:19 AM Hans Hagen  wrote:

> On 8/17/2021 2:07 AM, Joey McCollum wrote:
>
> > Sorry to bring this up after over a year, but I just noticed something
> > that doesn't seem right. I implemented some contextual substitutions in
> > my own fork of the Keter YG Hebrew font (.ttf file attached) under the
> > "dlig" feature that should do the following two things:
> but you don't enable dlig
>
> -
>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 / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] new upload lmtx

2021-06-18 Thread Hans Hagen

Hi,

End of the week so time to wrap up.

(1) As follow up on the primt/quote discussions I played a bit with 
additional font features. We already had a partial case feature but that 
one is also better. The camelcaser is more an experiment (and example).


% \definefontfeature[primes] [primes=yes]
% \definefontfeature[uppercasing][uppercasing=yes]
% \definefontfeature[lowercasing][lowercasing=yes]
% \definefontfeature[camelcasing][camelcasing=yes]

\setupbodyfont[dejavu]

\starttext

\startTEXpage[align={tolerant,stretch},offset=1ex]
{\addff{camelcasing} \samplefile{tufte}\par}
{\addff{uppercasing} \samplefile{tufte}\par}
{\addff{lowercasing} \samplefile{tufte}\par}
{\addff{primes} 123'345''\par}
\stopTEXpage

\stoptext

(2) (Pablo:) There is some pogress with facing floats that Thomas will 
check out for real usage. So, still experimental.


(3) Already for some 'mails' I mention playing with modifiers in math. 
The openup varianst are now a bit more tolerant in the sense that they 
work for more classes.


For a while I hav ebeen wondering about the prescripts and to what 
extend they should be controlled independent. For instance, we can mess 
with \Umathsupshiftup and such to get some displacement and it can even 
be done local, but still ... these are normally kind of font drive. So I 
decided to add a few more parameters, like \Umathextrasupshift   for 
each of the four possible scripts. For convenience I added \supsubscr,

\subsupscr, \supscr, and \subscr commands with an optional argument.

Basically we can now control quite a lot also because all defaults can 
be also influenced with \Umath*variant if needed; I probably need to 
check again if there are any (traditional tex math) hardwired 
properties. I know that not all of that is really needed (also because 
much of tex math is chisseled in stone and not supposed to be controlled 
although in context i suppose we have a bit more freedom) but it simply 
fit in the luametatex effort to do so.


Of course there might be math fields that need such things (so I might 
add some more modifiers, also because it's kind of fun to do).


Hans

 test file for math stuff 

\setupbodyfont[newcomputermodern-book]

\enableexperiments[math.extensibles]

\starttext

% \displaylimits
% \limits
% \nolimits
% \ordlimits (maybe replace that one now or maybe no longer needed anyway)

% \Umathadapttoleft \Umathadapttoright
% \Umathaxis \Umathnoaxis
% \Umathphantom \Umathvoid
% \Umathopenupheight  \Umathopenupdepth  
% \Umathlimits \Umathnolimits

% we can influence the location of sript with the open up modifiers but
% how about a different pre/post scripts anchoring ... as a first step
% i added these \Umathextra..shift parameters but maybe we need some more
% (we have this script control mode already, so maybe we need one for the
% prescripts too .. next todo i guess) .. we need examples of usage (like
% chemistry) .. maybe we also need a way to set the whole lot of styles
% at once .. again user demand driven)

\startTEXpage
$
x^1_2^^3__4
  = \normalmathop{x}^1_2^^3__4
  = \normalmathop{x}\Umathopenupheight5mm^1_2^^3__4
  = x\Umathopenupheight5mm\Umathopenupdepth2mm^1_2^^3__4
  = {\frozen\Umathsupshiftup\textstyle10pt x^1}
  = {x\frozen\Umathsupshiftup\textstyle10pt^1}
  = {\frozen\Umathsupshiftup\textstyle12pt x^1_2^^3__4}
  = {\frozen\Umathsupshiftup\textstyle12pt 
x\Umathopenupheight5mm^1_2^^3__4}

$
\stopTEXpage

\startTEXpage
$
x^1_2^^3__4
  =
\frozen\Umathextrasupshift   \textstyle2pt
\frozen\Umathextrasubshift   \textstyle4pt
\frozen\Umathextrasuppreshift\textstyle6pt
\frozen\Umathextrasubpreshift\textstyle8pt
x^1_2^^3__4
\frozen\Umathextrasupshift   \textstyle\zeropoint
\frozen\Umathextrasubshift   \textstyle\zeropoint
\frozen\Umathextrasuppreshift\textstyle\zeropoint
\frozen\Umathextrasubpreshift\textstyle\zeropoint
  =
\mathord {
\frozen\Umathextrasupshift   \textstyle2pt
\frozen\Umathextrasubshift   \textstyle4pt
\frozen\Umathextrasuppreshift\textstyle6pt
\frozen\Umathextrasubpreshift\textstyle8pt
x^1_2^^3__4
}
  =
x^1_2^^3__4
$
\stopTEXpage

% a few helpers ... do we need more like that ... we realy want to avoid
% ugly low level messing around (these \, etc are also kind of ugly)

\startTEXpage
$
x\supscr   [2pt]{1}
 \subscr   [3pt]{2}
  = x\supsubscr[2pt]{1}{2}
  = x\supsubscr[2pt]{1}{2}\supsubprescr{1}{2}
  = x\supsubscr[2pt]{1}{2}\supsubprescr[5pt]{1}{2}
  = x\subsupscr[2pt]{2}{1}
  = x\supscr{1}
 \subscr   [2pt]{2}
  = x\supsubscr {1}{2}
  = x\subsupscr {2}{1}
$
\stopTEXpage

\startTEXpage[offset=5mm]
\startformula
x = \integral^1_2 \mathinner{\vrule height 10mm depth 10mm width 5mm} =
x = \integral^1_2 \mathinner{\vrule height 20mm depth 20mm width 5mm} =
x = \integral^1_2 \mathinner{\vrule height 30mm depth 30mm width 5mm} =
x = \integral^1_2

Re: [NTG-context] Straight Quotes / Curly Quotes

2021-06-18 Thread Hans Hagen

On 6/18/2021 5:48 PM, Thangalin wrote:

The csquotes package can curl straight quotes:

https://ctan.org/pkg/csquotes <https://ctan.org/pkg/csquotes>

I don't know how smart its smart quote feature is, though, with respect 
to apostrophes.


me neither and as we always had lots of quote related stuff on board i'm 
also not going to explore it ... when apostrophes get translated as you 
do but with active characters it's no fun (ok, we still have a few in 
context like ~ and |)


just for fun i made

   {\addff{primes} 123'345''\par}

use primes ... in a next upload

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 / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Let chapter start on odd page and make the even page before show an image

2020-05-29 Thread Henning Hraban Ramm
In a similar setup I wanted to start every chapter with image and short vita 
the author and came up with the following (of course not without help from our 
wizards):


\definefont[ChapterFont][Sans*default at 30pt]

\startsetups normalheader
  % default numbers of my bodyfont are oldstyle
  
\setupheadertexts[chapter][{\addff{normnum}\pagenumber}][{\addff{normnum}\pagenumber}][]
\stopsetups

\startsetups noheader
  \setupheadertexts[][][][]
\stopsetups


\startsetups bigchapter
  \setupalign[flushleft,hz,hanging,verytolerant,nothyphenated]
  \doifelse{\structureuservariable{image}}{}{% if image empty
  }{%
\directsetup{noheader}
\vbox{%
  {\ChapterFont\structurevariable{title}\par}%
  \blank[big]
  
\externalfigure[img/\structureuservariable{image}][width=0.8\textwidth]\par
}
\doifnot{\structureuservariable{vita}}{}{% if vita
  \vfill
  \vbox{%
{\tf\ss\structureuservariable{vita}}
  }%
}%
\page[right]
\vbox{%
  \doifnot{\structureuservariable{subtitle}}{}{% if subtitle
{\definedfont[SerifItalic*eka at 30pt]\structureuservariable{subtitle}}
  }%
}%
  }%
  \blank[3*big]
  \directsetup{normalheader}
  \setupalign[width,hz,hanging,hyphenated]% reset alignment
\stopsetups


\setuphead[chapter][
  page=left,
  number=no,
  command=\gobbletwoarguments,
  before=,
  after={\directsetup{bigchapter}},
  style={\ChapterFont},
]


This is the result:
https://www.dreiviertelhaus.de/editionka/lauf-los-buch/
(see preview images linked at the bottom)


Best, Hraban
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Disappearing font feature

2019-12-22 Thread Hans Hagen
italic,features},
   bf={style:thinitalic,features},
   bi={style:lightitalic,features},
   it={style:bookitalic,features}]
\definefontfamily[it-two]
  [sansserif]
  [Jost]
  [tf={style:mediumitalic,features},
   bf={style:semiitalic,features},
   bi={style:bolditalic,features},
   it={style:heavyitalic,features}]
\definefontfamily[it-three]
  [sansserif]
  [Jost]
  [tf={style:blackitalic,features},
   bf={style:blackitalic,features},
   bi={style:blackitalic,features},
   it={style:blackitalic,features}]

\startbuffer [Sampler]
  A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
  a b c d e f g h i j k l m n o p q r s t u v w x y z à ë í ô ç
  1 2 3 4 5 6 7 8 9 0 ` \texttilde\ - = !  @ \# \$ \letterpercent\ ^ \&
  * ( ) _ + [ ] \textbackslash\ ; ' , . / \{ \} \| : " < > ?
  \fontname\font
\blank   [line]
\stopbuffer

\setupalign  [middle]
  
\setupbodyfont   [up-one,13pt]


\starttext
\obeylines

\ss\tf\getbuffer [Sampler]
\ss\bf\getbuffer [Sampler]
\ss\bi\getbuffer [Sampler]
\ss\it\getbuffer [Sampler]
\switchtobodyfont[up-two]
\ss\tf\getbuffer [Sampler]
\ss\bf\getbuffer [Sampler]
\ss\bi\getbuffer [Sampler]
\ss\it\getbuffer [Sampler]
\switchtobodyfont[up-three]
\ss\tf\getbuffer [Sampler]
\page
\switchtobodyfont[it-one]
\ss\tf\getbuffer [Sampler]
\ss\bf\getbuffer [Sampler]
\ss\bi\getbuffer [Sampler]
\switchtobodyfont[it-two]
\ss\tf\getbuffer [Sampler]
\ss\bf\getbuffer [Sampler]
\ss\bi\getbuffer [Sampler]
\ss\it\getbuffer [Sampler]
\switchtobodyfont[it-three]
\ss\tf\getbuffer [Sampler]
\stoptext


Assistance or explanation is welcome. This is just for a sampler -- the 
font with just three weights when used in a real project is fine. I do 
not know if the problem is with the font or with ConTeXt or with my 
expectations.

i donloaded the fonts from

https://github.com/indestructible-type/Jost/tree/master/Finished/otf

and this shows what you run into:

\definefont [JHair]  [jost-100-hairline*default]
\definefont [JHairI] [jost-100-hairlineitalic*default]

\definefontfeature[ss01][ss01=yes]

\startbuffer[ss01]
\hbox\bgroup
\char   97\relax
\char  224\relax
\char  225\relax
\char  226\relax
\char  227\relax
\char  228\relax
\char  229\relax
\char  257\relax
\char  259\relax
\char  261\relax
\char 1072\relax
\egroup
\stopbuffer

\starttext
\startlines
{\type{default } \JHair \getbuffer[ss01]}
    {\type{enabled } \JHair \addff{ss01}\getbuffer[ss01]}
{\type{disabled} \JHair \subff{ss01}\getbuffer[ss01]}
{\type{default } \JHairI\getbuffer[ss01]}
    {\type{enabled } \JHairI\addff{ss01}\getbuffer[ss01]}
{\type{disabled} \JHairI\subff{ss01}\getbuffer[ss01]}
\stoplines
\stoptext

btw, this happens often, like with oldstyle, the wished default is the 
hard coded default so one has to enable/disable


now, what you miss is that you define a font without applying any 
features ...


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 / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] ligatures/substituation at word boundaries

2017-07-28 Thread Hans Hagen

On 7/27/2017 8:09 PM, Ulrike Fischer wrote:

Is it possible to refer in fonts.handlers.otf.addfeature to the word
boundary? The luatex manual speaks of a virtual "left_boundary"
char, but I couldn't find a way to use it.

\startluacode
 fonts.handlers.otf.addfeature {
 name = "ltest",
 type = "ligature",
 data = {
 ['1'] = { "a", "b" },
 ['2'] = { "d", "a" },
 }
 }
\stopluacode

%how to replace only the start a

\startluacode
 fonts.handlers.otf.addfeature {
 name = "wtest",
 type = "ligature",
 data = {
 ['1'] = { "left_boundary", "a" },
 }
 }
\stopluacode

\definefontfeature[wtest][wtest=yes]
\definefontfeature[ltest][ltest=yes]
\starttext

 \definedfont[file:dejavu-serif.ttf*default]%


 {\addff{ltest} ababa\par}

 {\addff{wtest} ababa\par}


\stoptext
It is possible to check against spaces in contextual lookups. There 
isn't something like left boundary. I added some test code to the beta 
but keep in mind that this will only work with self-made features. (I 
have to check performance impact because I don't like making contextual 
lookups measurable slower due to some hardly used feature. First test 
show that it behaves ok.) In the test code below 0xFFFC is the boundary 
(this 0xFFFC check is the new thing). I adapted a few more things in the 
loader so best check that out too.


I'll upload a beta.

Hans

\starttext

\startluacode
fonts.handlers.otf.addfeature {
name= "test-a",
type= "chainsubstitution",
lookups = {
{
type = "substitution",
data = {
["a"] = "A",
["b"] = "B",
["c"] = "C",
["d"] = "D",
},
},
{
type = "ligature",
data = {
['1'] = { "a", "b" },
['2'] = { "c", "d" },
},
},
},
data = {
rules = {
{
before  = { { " ", 0xFFFC } },
current = { { "a" }, { "b" } },
lookups = { 2 },
},
{
current = { { "c" }, { "d" } },
after   = { { 0xFFFC, " " } },
lookups = { 2 },
},
{
current = { { "a" } },
after   = { { "b" } },
lookups = { 1 },
},
{
current = { { "c" } },
after   = { { "d" } },
lookups = { 1 },
},
},
},
}

fonts.handlers.otf.addfeature {
name= "test-b",
type= "chainsubstitution",
lookups = {
{
type = "ligature",
data = {
['1'] = { "a", "b" },
['2'] = { "c", "d" },
},
},
},
data = {
rules = {
{
-- the space is redundant as 0xFFFC contains it
before  = { { " ", 0xFFFC } },
current = { { "a" }, { "b" } },
lookups = { 1 },
},
{
current = { { "c" }, { "d" } },
-- the space is redundant as 0xFFFC contains it
after   = { { 0xFFFC, " " } },
lookups = { 1 },
},
},
},
}

fonts.handlers.otf.addfeature {
name= "test-c",
type= "chainsubstitution",
lookups = {
{
type = "ligature",
data = {
['1'] = { "a", "b" },
['2'] = { "c", "d" },
},
},
},
data = {
rules = {
{
before  = { { " " } },
current = { { "a" }, { "b" } },
lookups = { 1 },
},
{
current = { { "c" }, { "d" } },
after   = { { " " } },
   

[NTG-context] ligatures/substituation at word boundaries

2017-07-27 Thread Ulrike Fischer
Is it possible to refer in fonts.handlers.otf.addfeature to the word
boundary? The luatex manual speaks of a virtual "left_boundary"
char, but I couldn't find a way to use it. 

\startluacode
fonts.handlers.otf.addfeature {
name = "ltest",
type = "ligature",
data = {
['1'] = { "a", "b" },
['2'] = { "d", "a" },
}
}
\stopluacode

%how to replace only the start a

\startluacode
fonts.handlers.otf.addfeature {
name = "wtest",
type = "ligature",
data = {
['1'] = { "left_boundary", "a" },
}
}
\stopluacode

\definefontfeature[wtest][wtest=yes]
\definefontfeature[ltest][ltest=yes]
\starttext

\definedfont[file:dejavu-serif.ttf*default]%


{\addff{ltest} ababa\par}

{\addff{wtest} ababa\par}


\stoptext





-- 
Ulrike Fischer 
http://www.troubleshooting-tex.de/

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] fixed spacing

2017-07-17 Thread Floris van Manen
No, i don’t want them in a table in columns.
Rather i want the stretching space after the comma only.

.F


> On 17 Jul 2017, at 22:05, Rik Kabel <cont...@rik.users.panix.com> wrote:
> 
> On 2017-07-17 15:23, Floris van Manen wrote:
>> dear List,
>> 
>> I try to put a set of numbers into a block text.
>> I want to keep the spacing within the items fixed
>> x-y:~z,
>> How do i do that?
>> The attached code does not seem to treat the fixed space as fixed.
>> 
>> Thanks
>> .Floris
>> 
>> 
>> \definepapersize[iiwii][width=125mm, height=125mm]
>> \setuppapersize[iiwii]
>> \setupbodyfont[7pt]
>> \setuplayout[backspace=3mm,
>> topspace=3mm,
>> width=70mm,
>> header=0mm,
>> footer=0mm,
>> height=119mm]
>> \starttext
>> 
>> \starttext
>> {\tfxx\framed[width=42mm,align={width,nothyphenated,verytolerant},frame=off]
>> {0-1:~28, 1-2:~1686, 0-2:~1710, 8-9:~3484, 7-8:~15862, 7-9:~17152, 
>> 1-3:~90632, 0-3:~90645, 2-3:~90840, 7-6:~98762, 6-8:~100082, 6-9:~103544, 
>> 4-0:~106926, 4-1:~106949, 4-2:~107546, 4-3:~192211, 3-6:~990165, 
>> 2-6:~1040810, 3-7:~1041891, 1-6:~1042032, 0-6:~1042060, 3-8:~1055123, 
>> 3-9:~1057765, 2-7:~1086097, 1-7:~1087411, 0-7:~1087439, 2-8:~1099942, 
>> 1-8:~1101249, 0-8:~1101277, 2-9:~1102409, 1-9:~1103718, 0-9:~1103746, 
>> 4-6:~1138989, 4-7:~1180436, 4-8:~1194617, 4-9:~1196971, 5-3:~1729640, 
>> 4-5:~1756438, 5-0:~1761922, 5-1:~1761941, 5-2:~1763565, 5-6:~2459757, 
>> 5-7:~2548510, 5-8:~2555440, 5-9:~2558871
>> }}
>> 
>> {\tfxx\framed[width=42mm,align={width,nothyphenated},frame=off]
>> {0-1:~28, 1-2:~1686, 0-2:~1710, 8-9:~3484, 7-8:~15862, 7-9:~17152, 
>> 1-3:~90632, 0-3:~90645, 2-3:~90840, 7-6:~98762, 6-8:~100082, 6-9:~103544, 
>> 4-0:~106926, 4-1:~106949, 4-2:~107546, 4-3:~192211, 3-6:~990165, 
>> 2-6:~1040810, 3-7:~1041891, 1-6:~1042032, 0-6:~1042060, 3-8:~1055123, 
>> 3-9:~1057765, 2-7:~1086097, 1-7:~1087411, 0-7:~1087439, 2-8:~1099942, 
>> 1-8:~1101249, 0-8:~1101277, 2-9:~1102409, 1-9:~1103718, 0-9:~1103746, 
>> 4-6:~1138989, 4-7:~1180436, 4-8:~1194617, 4-9:~1196971, 5-3:~1729640, 
>> 4-5:~1756438, 5-0:~1761922, 5-1:~1761941, 5-2:~1763565, 5-6:~2459757, 
>> 5-7:~2548510, 5-8:~2555440, 5-9:~2558871
>> }}
>> 
>> \stoptext
>> 
> 
>   • Use tabular numbers and hard-code all of the spaces you need:
> \definefontfeature[default][default][tnum=yes]
> or
> \definefontfeature[ff:tnum][tnum=yes] ... \addff{ff:tnum} or 
> \feature[+][ff:tnum] where appropriate.
> 
>   • Put the numbers in a table and right-align the number columns (see 
> http://wiki.contextgarden.net/TABLE#Using_character_alignment if you need 
> decimal alignment).
> --
> Rik
>   • Both
> 
> =
> ___
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> ___



signature.asc
Description: Message signed with OpenPGP using GPGMail
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] fixed spacing

2017-07-17 Thread Rik Kabel

On 2017-07-17 15:23, Floris van Manen wrote:

dear List,

I try to put a set of numbers into a block text.
I want to keep the spacing within the items fixed
x-y:~z,
How do i do that?
The attached code does not seem to treat the fixed space as fixed.

Thanks
.Floris


\definepapersize[iiwii][width=125mm, height=125mm]
\setuppapersize[iiwii]
\setupbodyfont[7pt]
\setuplayout[backspace=3mm,
 topspace=3mm,
 width=70mm,
 header=0mm,
 footer=0mm,
 height=119mm]
\starttext

\starttext
{\tfxx\framed[width=42mm,align={width,nothyphenated,verytolerant},frame=off]
{0-1:~28, 1-2:~1686, 0-2:~1710, 8-9:~3484, 7-8:~15862, 7-9:~17152, 1-3:~90632, 
0-3:~90645, 2-3:~90840, 7-6:~98762, 6-8:~100082, 6-9:~103544, 4-0:~106926, 
4-1:~106949, 4-2:~107546, 4-3:~192211, 3-6:~990165, 2-6:~1040810, 3-7:~1041891, 
1-6:~1042032, 0-6:~1042060, 3-8:~1055123, 3-9:~1057765, 2-7:~1086097, 
1-7:~1087411, 0-7:~1087439, 2-8:~1099942, 1-8:~1101249, 0-8:~1101277, 
2-9:~1102409, 1-9:~1103718, 0-9:~1103746, 4-6:~1138989, 4-7:~1180436, 
4-8:~1194617, 4-9:~1196971, 5-3:~1729640, 4-5:~1756438, 5-0:~1761922, 
5-1:~1761941, 5-2:~1763565, 5-6:~2459757, 5-7:~2548510, 5-8:~2555440, 
5-9:~2558871
}}

{\tfxx\framed[width=42mm,align={width,nothyphenated},frame=off]
{0-1:~28, 1-2:~1686, 0-2:~1710, 8-9:~3484, 7-8:~15862, 7-9:~17152, 1-3:~90632, 
0-3:~90645, 2-3:~90840, 7-6:~98762, 6-8:~100082, 6-9:~103544, 4-0:~106926, 
4-1:~106949, 4-2:~107546, 4-3:~192211, 3-6:~990165, 2-6:~1040810, 3-7:~1041891, 
1-6:~1042032, 0-6:~1042060, 3-8:~1055123, 3-9:~1057765, 2-7:~1086097, 
1-7:~1087411, 0-7:~1087439, 2-8:~1099942, 1-8:~1101249, 0-8:~1101277, 
2-9:~1102409, 1-9:~1103718, 0-9:~1103746, 4-6:~1138989, 4-7:~1180436, 
4-8:~1194617, 4-9:~1196971, 5-3:~1729640, 4-5:~1756438, 5-0:~1761922, 
5-1:~1761941, 5-2:~1763565, 5-6:~2459757, 5-7:~2548510, 5-8:~2555440, 
5-9:~2558871
}}

\stoptext


1. Use tabular numbers and hard-code all of the spaces you need:
   \definefontfeature[default][default][tnum=yes]
   or
   \definefontfeature[ff:tnum][tnum=yes] ... \addff{ff:tnum} or
   \feature[+][ff:tnum] where appropriate.

2. Put the numbers in a table and right-align the number columns (see
   http://wiki.contextgarden.net/TABLE#Using_character_alignment if you
   need decimal alignment).

--
Rik

1. Both


=

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Change kerning between math characters (prime and left parenthesis)

2017-06-02 Thread Mikael P. Sundqvist
On Fri, Jun 2, 2017 at 4:24 PM, Hans Hagen <pra...@wxs.nl> wrote:
> On 6/2/2017 10:59 AM, Mikael P. Sundqvist wrote:
>>
>> Hi!
>>
>> Now that the bug with primes is fixed in ConTeXt, I wonder if there is
>> a way to change the kerning between certain characters in mathematics
>> (in case one is not happy with the output from the font)? After
>> reading in fonts-mkiv.pdf this is what I came up with:
>
>
> you can also play withj:
>
> return {
> name = "cambria-math",
> mathematics = {
>kerns = {
>   [0x1D453] = {
>   force = true,
>   topright = {
>   {
>   kern = 1000,
>   },
>   },
>   bottomright = {
>   {
>   kern = 1000,
>   },
>   },
>   },
>   },
> },
> }
>
> currently you need to enable this:
>
> \enabledirectives[fontgoodies.mathkerning]
>
> keep in mind that some cambria (not all) have such staircase kerns which is
> why force is needed in order to overload
>
>> \startluacode
>> fonts.handlers.otf.addfeature {
>> name = "kerntest",
>> type = "kern",
>> data = {
>> [0x61] = { [0x62] = -150 }, -- a and b in text
>> [0x1d44e] = { [0x1d44f] = -150 }, -- mathematical italic small a and b
>> [0x02032] = { [0x00028] = -150 }, -- prime and left parenthesis
>> }
>> }
>> \stopluacode
>>
>> \definefontfeature[kerntest][kerntest=yes]
>>
>> \definefontfamily[lucidaopentype][rm][Lucida Bright OT]
>> \definefontfamily[lucidaopentype][mm][Lucida Bright Math OT]
>>
>> \setupbodyfont[lucidaopentype,10pt]
>>
>>
>> \startTEXpage[offset=3pt]
>> abba $abba f'(x)$
>>
>> \addff{kerntest}
>>
>> abba $abba f'(x)$
>>
>> I prefer $f'\mkern-3mu(x)$
>> \stopTEXpage
>>
>> The output is attached as a png file. As you see the kerning works as
>> expected in text mode, but not at all in math mode, even not for the a
>> and b (which I hope I entered correctly).
>>
>> Something like the third line is what I'm after, but not having to use
>> \mkern in all places. Is it possible?
>>
>> /Mikael
>>
>> PS: This is a cross post of the question
>> https://tex.stackexchange.com/q/372857/52406, where I got the
>> suggestion to ask on the list.
>>
>>
>>
>>
>> ___
>> 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://context.aanhet.net
>> archive  : https://bitbucket.org/phg/context-mirror/commits/
>> wiki : http://contextgarden.net
>>
>> ___
>>
>
>
> --
>
> -
>   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 /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> ___

Thank you Hans, that works.

Is there also a similar way to use the "kernpairs" instead of "kerns"?
I get no effect, even after adding force = true and
\enabledirectives[fontgoodies.mathkerning].

/Mikael
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Change kerning between math characters (prime and left parenthesis)

2017-06-02 Thread Hans Hagen

On 6/2/2017 10:59 AM, Mikael P. Sundqvist wrote:

Hi!

Now that the bug with primes is fixed in ConTeXt, I wonder if there is
a way to change the kerning between certain characters in mathematics
(in case one is not happy with the output from the font)? After
reading in fonts-mkiv.pdf this is what I came up with:


you can also play withj:

return {
name = "cambria-math",
mathematics = {
   kerns = {
  [0x1D453] = {
  force = true,
  topright = {
  {
  kern = 1000,
  },
  },
  bottomright = {
  {
  kern = 1000,
  },
  },
  },
  },
},
}

currently you need to enable this:

\enabledirectives[fontgoodies.mathkerning]

keep in mind that some cambria (not all) have such staircase kerns which 
is why force is needed in order to overload



\startluacode
fonts.handlers.otf.addfeature {
name = "kerntest",
type = "kern",
data = {
[0x61] = { [0x62] = -150 }, -- a and b in text
[0x1d44e] = { [0x1d44f] = -150 }, -- mathematical italic small a and b
[0x02032] = { [0x00028] = -150 }, -- prime and left parenthesis
}
}
\stopluacode

\definefontfeature[kerntest][kerntest=yes]

\definefontfamily[lucidaopentype][rm][Lucida Bright OT]
\definefontfamily[lucidaopentype][mm][Lucida Bright Math OT]

\setupbodyfont[lucidaopentype,10pt]


\startTEXpage[offset=3pt]
abba $abba f'(x)$

\addff{kerntest}

abba $abba f'(x)$

I prefer $f'\mkern-3mu(x)$
\stopTEXpage

The output is attached as a png file. As you see the kerning works as
expected in text mode, but not at all in math mode, even not for the a
and b (which I hope I entered correctly).

Something like the third line is what I'm after, but not having to use
\mkern in all places. Is it possible?

/Mikael

PS: This is a cross post of the question
https://tex.stackexchange.com/q/372857/52406, where I got the
suggestion to ask on the list.



___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___




--

-
  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 / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Change kerning between math characters (prime and left parenthesis)

2017-06-02 Thread Mikael P. Sundqvist
On Fri, Jun 2, 2017 at 1:39 PM, Mikael P. Sundqvist <mic...@gmail.com> wrote:
> On Fri, Jun 2, 2017 at 11:39 AM, Mathias Schickel
> <m...@fa.uni-tuebingen.de> wrote:
>> Hi Mikael,
>>
>> math fonts are a bit different from text fonts. This means that you need 
>> special methods to influence them. Because I once had a similar concern like 
>> you I asked Hans to implement a way to influence kerning in math fonts 
>> between certain glyphs. I have attached an lfg-file that shows how to use it.
>>
>> To enable a goodie file like the one attached you have to define your 
>> typescript like
>>
>> \starttypescript [\s!math][cambriaown][\s!all]
>> \loadfontgoodies[cambriaown-math]
>> \definefontsynonym[\s!MathRoman][Cambria-Math]   
>>
>> [\s!features={\s!math\mathsizesuffix},\s!designsize=\s!auto,\s!goodies=cambriaown-math]
>> \stoptypescript
>>
>> I hope this helps!
>>
>> Best
>> Mathias
>>
>>
>>
>>
>>
>>> Am 02.06.2017 um 10:59 schrieb Mikael P. Sundqvist <mic...@gmail.com>:
>>>
>>> Hi!
>>>
>>> Now that the bug with primes is fixed in ConTeXt, I wonder if there is
>>> a way to change the kerning between certain characters in mathematics
>>> (in case one is not happy with the output from the font)? After
>>> reading in fonts-mkiv.pdf this is what I came up with:
>>>
>>> \startluacode
>>> fonts.handlers.otf.addfeature {
>>> name = "kerntest",
>>> type = "kern",
>>> data = {
>>> [0x61] = { [0x62] = -150 }, -- a and b in text
>>> [0x1d44e] = { [0x1d44f] = -150 }, -- mathematical italic small a and b
>>> [0x02032] = { [0x00028] = -150 }, -- prime and left parenthesis
>>> }
>>> }
>>> \stopluacode
>>>
>>> \definefontfeature[kerntest][kerntest=yes]
>>>
>>> \definefontfamily[lucidaopentype][rm][Lucida Bright OT]
>>> \definefontfamily[lucidaopentype][mm][Lucida Bright Math OT]
>>>
>>> \setupbodyfont[lucidaopentype,10pt]
>>>
>>>
>>> \startTEXpage[offset=3pt]
>>> abba $abba f'(x)$
>>>
>>> \addff{kerntest}
>>>
>>> abba $abba f'(x)$
>>>
>>> I prefer $f'\mkern-3mu(x)$
>>> \stopTEXpage
>>>
>>> The output is attached as a png file. As you see the kerning works as
>>> expected in text mode, but not at all in math mode, even not for the a
>>> and b (which I hope I entered correctly).
>>>
>>> Something like the third line is what I'm after, but not having to use
>>> \mkern in all places. Is it possible?
>>>
>>> /Mikael
>>>
>>> PS: This is a cross post of the question
>>> https://tex.stackexchange.com/q/372857/52406, where I got the
>>> suggestion to ask on the list.
>>> ___
>>> 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://context.aanhet.net
>>> archive  : https://bitbucket.org/phg/context-mirror/commits/
>>> wiki : http://contextgarden.net
>>> ___
>>
>>
>> ___
>> 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://context.aanhet.net
>> archive  : https://bitbucket.org/phg/context-mirror/commits/
>> wiki : http://contextgarden.net
>> ___
>
> Thank you very much for your reply, Mathias!
>
> I'm not sure I get it, though. I find that there is already a file
> lucida-opentype-math.lfg in the distribution.
>
> Just experimenting, I added to this file an entry with kernpairs (see
> below), to see if I could make a change with a and b (if I cannot
> manage that, I don't see how I could get the prime and parenthesis
> case to work).
>
> %%% start of my new lucida-opentype-math.lfg
> - kern_250 = { bottomright = { { kern = -250 } }, force = true }
>
> return {
> nam

Re: [NTG-context] Change kerning between math characters (prime and left parenthesis)

2017-06-02 Thread Mikael P. Sundqvist
On Fri, Jun 2, 2017 at 11:39 AM, Mathias Schickel
<m...@fa.uni-tuebingen.de> wrote:
> Hi Mikael,
>
> math fonts are a bit different from text fonts. This means that you need 
> special methods to influence them. Because I once had a similar concern like 
> you I asked Hans to implement a way to influence kerning in math fonts 
> between certain glyphs. I have attached an lfg-file that shows how to use it.
>
> To enable a goodie file like the one attached you have to define your 
> typescript like
>
> \starttypescript [\s!math][cambriaown][\s!all]
> \loadfontgoodies[cambriaown-math]
> \definefontsynonym[\s!MathRoman][Cambria-Math]
>   
> [\s!features={\s!math\mathsizesuffix},\s!designsize=\s!auto,\s!goodies=cambriaown-math]
> \stoptypescript
>
> I hope this helps!
>
> Best
> Mathias
>
>
>
>
>
>> Am 02.06.2017 um 10:59 schrieb Mikael P. Sundqvist <mic...@gmail.com>:
>>
>> Hi!
>>
>> Now that the bug with primes is fixed in ConTeXt, I wonder if there is
>> a way to change the kerning between certain characters in mathematics
>> (in case one is not happy with the output from the font)? After
>> reading in fonts-mkiv.pdf this is what I came up with:
>>
>> \startluacode
>> fonts.handlers.otf.addfeature {
>> name = "kerntest",
>> type = "kern",
>> data = {
>> [0x61] = { [0x62] = -150 }, -- a and b in text
>> [0x1d44e] = { [0x1d44f] = -150 }, -- mathematical italic small a and b
>> [0x02032] = { [0x00028] = -150 }, -- prime and left parenthesis
>> }
>> }
>> \stopluacode
>>
>> \definefontfeature[kerntest][kerntest=yes]
>>
>> \definefontfamily[lucidaopentype][rm][Lucida Bright OT]
>> \definefontfamily[lucidaopentype][mm][Lucida Bright Math OT]
>>
>> \setupbodyfont[lucidaopentype,10pt]
>>
>>
>> \startTEXpage[offset=3pt]
>> abba $abba f'(x)$
>>
>> \addff{kerntest}
>>
>> abba $abba f'(x)$
>>
>> I prefer $f'\mkern-3mu(x)$
>> \stopTEXpage
>>
>> The output is attached as a png file. As you see the kerning works as
>> expected in text mode, but not at all in math mode, even not for the a
>> and b (which I hope I entered correctly).
>>
>> Something like the third line is what I'm after, but not having to use
>> \mkern in all places. Is it possible?
>>
>> /Mikael
>>
>> PS: This is a cross post of the question
>> https://tex.stackexchange.com/q/372857/52406, where I got the
>> suggestion to ask on the list.
>> ___
>> 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://context.aanhet.net
>> archive  : https://bitbucket.org/phg/context-mirror/commits/
>> wiki : http://contextgarden.net
>> ___
>
>
> ___
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> ___

Thank you very much for your reply, Mathias!

I'm not sure I get it, though. I find that there is already a file
lucida-opentype-math.lfg in the distribution.

Just experimenting, I added to this file an entry with kernpairs (see
below), to see if I could make a change with a and b (if I cannot
manage that, I don't see how I could get the prime and parenthesis
case to work).

%%% start of my new lucida-opentype-math.lfg
- kern_250 = { bottomright = { { kern = -250 } }, force = true }

return {
name = "lucida-opentype-math",
version = "1.00",
comment = "Goodies that complement lucida opentype.",
author = "Hans Hagen",
copyright = "ConTeXt development team",
mathematics = {
alternates = {
italic   = { feature = 'ss01', value = 1, comment =
"Mathematical Alternative Lowercase Italic" },
arrow= { feature = 'ss02', value = 1, comment =
"Mathematical Alternative Smaller Arrows" },
operator = { feature = 'ss03',

Re: [NTG-context] Change kerning between math characters (prime and left parenthesis)

2017-06-02 Thread Mathias Schickel
Hi Mikael,

math fonts are a bit different from text fonts. This means that you need 
special methods to influence them. Because I once had a similar concern like 
you I asked Hans to implement a way to influence kerning in math fonts between 
certain glyphs. I have attached an lfg-file that shows how to use it.

To enable a goodie file like the one attached you have to define your 
typescript like

\starttypescript [\s!math][cambriaown][\s!all]
\loadfontgoodies[cambriaown-math]
\definefontsynonym[\s!MathRoman][Cambria-Math]  
[\s!features={\s!math\mathsizesuffix},\s!designsize=\s!auto,\s!goodies=cambriaown-math]
\stoptypescript

I hope this helps!

Best
Mathias



cambriaown-math.lfg
Description: Binary data



> Am 02.06.2017 um 10:59 schrieb Mikael P. Sundqvist <mic...@gmail.com>:
> 
> Hi!
> 
> Now that the bug with primes is fixed in ConTeXt, I wonder if there is
> a way to change the kerning between certain characters in mathematics
> (in case one is not happy with the output from the font)? After
> reading in fonts-mkiv.pdf this is what I came up with:
> 
> \startluacode
> fonts.handlers.otf.addfeature {
> name = "kerntest",
> type = "kern",
> data = {
> [0x61] = { [0x62] = -150 }, -- a and b in text
> [0x1d44e] = { [0x1d44f] = -150 }, -- mathematical italic small a and b
> [0x02032] = { [0x00028] = -150 }, -- prime and left parenthesis
> }
> }
> \stopluacode
> 
> \definefontfeature[kerntest][kerntest=yes]
> 
> \definefontfamily[lucidaopentype][rm][Lucida Bright OT]
> \definefontfamily[lucidaopentype][mm][Lucida Bright Math OT]
> 
> \setupbodyfont[lucidaopentype,10pt]
> 
> 
> \startTEXpage[offset=3pt]
> abba $abba f'(x)$
> 
> \addff{kerntest}
> 
> abba $abba f'(x)$
> 
> I prefer $f'\mkern-3mu(x)$
> \stopTEXpage
> 
> The output is attached as a png file. As you see the kerning works as
> expected in text mode, but not at all in math mode, even not for the a
> and b (which I hope I entered correctly).
> 
> Something like the third line is what I'm after, but not having to use
> \mkern in all places. Is it possible?
> 
> /Mikael
> 
> PS: This is a cross post of the question
> https://tex.stackexchange.com/q/372857/52406, where I got the
> suggestion to ask on the list.
> ___
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> ___

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] Change kerning between math characters (prime and left parenthesis)

2017-06-02 Thread Mikael P. Sundqvist
Hi!

Now that the bug with primes is fixed in ConTeXt, I wonder if there is
a way to change the kerning between certain characters in mathematics
(in case one is not happy with the output from the font)? After
reading in fonts-mkiv.pdf this is what I came up with:

\startluacode
fonts.handlers.otf.addfeature {
name = "kerntest",
type = "kern",
data = {
[0x61] = { [0x62] = -150 }, -- a and b in text
[0x1d44e] = { [0x1d44f] = -150 }, -- mathematical italic small a and b
[0x02032] = { [0x00028] = -150 }, -- prime and left parenthesis
}
}
\stopluacode

\definefontfeature[kerntest][kerntest=yes]

\definefontfamily[lucidaopentype][rm][Lucida Bright OT]
\definefontfamily[lucidaopentype][mm][Lucida Bright Math OT]

\setupbodyfont[lucidaopentype,10pt]


\startTEXpage[offset=3pt]
abba $abba f'(x)$

\addff{kerntest}

abba $abba f'(x)$

I prefer $f'\mkern-3mu(x)$
\stopTEXpage

The output is attached as a png file. As you see the kerning works as
expected in text mode, but not at all in math mode, even not for the a
and b (which I hope I entered correctly).

Something like the third line is what I'm after, but not having to use
\mkern in all places. Is it possible?

/Mikael

PS: This is a cross post of the question
https://tex.stackexchange.com/q/372857/52406, where I got the
suggestion to ask on the list.
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] frac font feature doesn't work as expected

2017-04-05 Thread luigi scarso
On Wed, Apr 5, 2017 at 10:15 AM, Ulrike Fischer <ne...@nililand.de> wrote:
> \starttext
>
> \font\test={file:linlibertine_r.otf:+frac}
> \test 1/2 3/4 5/6 7/8 9/10 11/12 31415/27182 1000/100
> \stoptext
>
> gives as output
>
> ½ 3¾ 5⅚ 7⅜ 9/10 1⅟12 31415/27182 1000/100


\usetypescriptfile[libertine]
\setupbodyfont[libertine,12pt]
\definefontfeature[frac][frac=yes]

\starttext

{\addff{frac}  1/2 3/4 5/6 7/8 9/10 11/12 31415/27182 1000/100}
\stoptext

if you see
fonts   > otf chain > feature 'frac', type
'gsub_contextchain', chain lookup 's_s_7':  is not yet supported (1)
then ... it need to be supported.

( I have a local patch (by Hnas) that gives
¹⁄₂ ³⁄₄ ⁵⁄₆ ⁷⁄₈ ⁹⁄₁₀ ¹¹⁄₁₂ ³¹⁴¹⁵⁄₂₇₁₈₂ ¹⁰⁰⁰⁄₁₀₀
with the otf fonts from
http://www.ctan.org/tex-archive/fonts/libertine
)

-- 
luigi
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] issue with OT feature lfbd

2017-02-25 Thread Hans Hagen

On 2/25/2017 5:14 PM, Pablo Rodriguez wrote:

Dear list,

I have the following sample:

\showframe
\definefontfeature[leftbounds][lfbd=yes]
\definefontfamily[mainface][rm][Linux Libertine O]
\setupbodyfont[mainface, 150pt]
\starttext
\startTEXpage[offset=1ex]
Wer War?

\addff{leftbounds}
Wer War?

Wer\subff{leftbounds} War?
\stopTEXpage
\stoptext

I’m afraid that the OT feature lfbd is applied in all the line.
Otherwise, the second and the third lines would have the same spacing
between words.

Could anyone confirm this or am I missing something?


the fact that it won't work as you expect ... in fact there is some 
experimental code that was never adapted to the new font reader ... i'll 
fix that .. then you can do


\definefontfeature[default][default][protrusion=yes,opbd=yes]

\definefontfamily[mainface][rm][Linux Libertine O]
\setupbodyfont[mainface]

\setupalign[hanging]

\showframe

\starttext
\definedfont[linlibertine_r.otf*default]
\input tufte
\stoptext

as it needs it hook into protrusion (be dealt with in line breaking)

But still it's useless as that font only has left W V - and right v - 
defined so rather minimalistic and incomplete. Probably a left over from 
some experiment.


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 / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] issue with OT feature lfbd

2017-02-25 Thread Pablo Rodriguez
Dear list,

I have the following sample:

\showframe
\definefontfeature[leftbounds][lfbd=yes]
\definefontfamily[mainface][rm][Linux Libertine O]
\setupbodyfont[mainface, 150pt]
\starttext
\startTEXpage[offset=1ex]
Wer War?

\addff{leftbounds}
Wer War?

Wer\subff{leftbounds} War?
\stopTEXpage
\stoptext

I’m afraid that the OT feature lfbd is applied in all the line.
Otherwise, the second and the third lines would have the same spacing
between words.

Could anyone confirm this or am I missing something?

Many thanks for your help,

Pablo
-- 
http://www.ousia.tk
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] frac opentype feature broken by \setbreakpoints[compound]

2017-02-14 Thread Hans Hagen

On 2/13/2017 4:47 PM, MF wrote:

Hello list,
I found an interference between the "frac" opentype feature and
\setbreakpoints[compound], which make the former fail when you have a
numerator more than 2 digit wide.

I found it with Adobe Garamond Premier Pro: with
\setbreakpoints[compound], when the fraction had a 3-digit (or more)
numerator, the denominator stayed high as the numerator (like a
superscript).

Here I replaced Garamond Premier Pro with the freely available "Lato"
font, to let you reproduce the problem.
The outcome is different, but still erroneous:
\setbreakpoints[compound] makes ConTeXt ignore the "frac" feature at
all.

Please try this:

\definefontfeature[frac][frac=yes]
\definefontfamily[default][rm][lato][features=frac]
\setupbodyfont[default,rm,11pt]

\setbreakpoints[compound]

\starttext

\addff{frac} 1/3, 1/100, 1/1000, {\setbreakpoints[reset]1633/100},
2345/12.

\stoptext

A workaround is a local \setbreakpoints[reset] limited to the fraction.


i'll add this:

\definefontfeature[f:fractions][frac=yes]

\definealternativestyle [fractions]  [\setfractions\resetbreakpoints] 
[\setfractions\resetbreakpoints]


\unexpanded\def\setfractions{\doaddfeature{f:fractions}}


\addff{frac} 1/3, 1/100, 1/1000, {\resetbreakpoints 1633/100}, 2345/12.

\fractions{1/3, 1/100, 1/1000, 1633/100, 2345/12}.


Keep in mind that often the fractions feature sis incomplete and can 
even give weird side effects when applied to a whole stretch of text so 
limiting the scope is wise anyway


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 / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] frac opentype feature broken by \setbreakpoints[compound]

2017-02-13 Thread MF
Hello list,
I found an interference between the "frac" opentype feature and
\setbreakpoints[compound], which make the former fail when you have a
numerator more than 2 digit wide.

I found it with Adobe Garamond Premier Pro: with
\setbreakpoints[compound], when the fraction had a 3-digit (or more)
numerator, the denominator stayed high as the numerator (like a
superscript).

Here I replaced Garamond Premier Pro with the freely available "Lato"
font, to let you reproduce the problem.
The outcome is different, but still erroneous:
\setbreakpoints[compound] makes ConTeXt ignore the "frac" feature at
all.

Please try this:

\definefontfeature[frac][frac=yes]
\definefontfamily[default][rm][lato][features=frac]
\setupbodyfont[default,rm,11pt]

\setbreakpoints[compound]

\starttext

\addff{frac} 1/3, 1/100, 1/1000, {\setbreakpoints[reset]1633/100},
2345/12.

\stoptext

A workaround is a local \setbreakpoints[reset] limited to the fraction.

Best regards,
Massi
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] URL styling in btx bibliography

2017-02-04 Thread Alan Braslau
On Sat, 4 Feb 2017 09:10:33 -0700
Alan Braslau <alan.bras...@cea.fr> wrote:

> On Fri, 3 Feb 2017 17:26:35 -0500
> Rik Kabel <cont...@rik.users.panix.com> wrote:
> 
> > Is there a user-level control for the styling of urls in the new 
> > bibliography system? I use
> > 
> > \setupurl[style=\addff{f:ns}\ss]
> > 
> > (where f:ns is a fontfeature definition for lining/new style
> > numerals) for the rest of the document. The bibliography honors this
> > formatting for urls present in bibtex note entries, but persists in
> > serif and oldstyle (the document defaults) for urls provided by
> > bibtex url entries.
> 
> The bibliography specifications use the command \hyphenatedurl{} to
> flush the url (or doi) field.
> 
> Alan

Hans,

This should probably be replaced by \url[]?

Alan

\unexpanded\def\url[#label]% move \hyphenatedurl to lua end (is already lua)
{\dontleavehmode
   \begingroup
   \useurlstyleandcolor\c!style\c!color
   \hyphenatedurl{\clf_geturl{#label}}%
   \endgroup}
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] URL styling in btx bibliography

2017-02-04 Thread Alan Braslau
On Fri, 3 Feb 2017 17:26:35 -0500
Rik Kabel <cont...@rik.users.panix.com> wrote:

> Is there a user-level control for the styling of urls in the new 
> bibliography system? I use
> 
> \setupurl[style=\addff{f:ns}\ss]
> 
> (where f:ns is a fontfeature definition for lining/new style
> numerals) for the rest of the document. The bibliography honors this
> formatting for urls present in bibtex note entries, but persists in
> serif and oldstyle (the document defaults) for urls provided by
> bibtex url entries.

The bibliography specifications use the command \hyphenatedurl{} to
flush the url (or doi) field.

Alan
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] URL styling in btx bibliography

2017-02-03 Thread Rik Kabel

ConTeXters,

Is there a user-level control for the styling of urls in the new 
bibliography system? I use


   \setupurl[style=\addff{f:ns}\ss]

(where f:ns is a fontfeature definition for lining/new style numerals) 
for the rest of the document. The bibliography honors this formatting 
for urls present in bibtex note entries, but persists in serif and 
oldstyle (the document defaults) for urls provided by bibtex url entries.


--
Rik

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Changing decimals points to Persian ones via font features

2016-08-08 Thread Hans Hagen

On 8/8/2016 5:24 PM, Mohammad Hossein Bateni wrote:

Thanks, Hans!

I see; this does work except for the trouble of annotating with \digits
macro.  Would it be possible if I wrote a processor in Lua to do the work?

nodes.tasks.appendaction ("processors", "before", "fix_persian_mathperiod")

Can I find out if a node is inside math?  If I look at the corresponding
font, how can I find out if this is a math font or not?


it's doable but then you also have to fight exceptions and that is no fun



I take it that in math fonts, kerning does not work, either?  In my
case, the Persian decimal separator usually has a part below the
baseline that extends to the left, and because all (Persian) digits are
above the baseline, I get an ugly space in the middle.  If kerning is
not possible at all, I can try to change the dimensions of Persian
decimal separator symbol because the kern is always necessary.  Is it
possible to change the dimensions of the symbol or is that also fixed
and unchangeable?


probably best is to collect all that info, also for different math 
fonts, and then cook up some virtual font support for it (across fonts), 
if only because digits is one aspect if bidi math and there is more needed



Thanks a lot!
—MHB



On Mon, Aug 8, 2016 at 10:44 AM, Hans Hagen <pra...@wxs.nl
<mailto:pra...@wxs.nl>> wrote:

On 8/2/2016 9:54 PM, Mohammad Hossein Bateni wrote:

Could the problem be because math fonts use mode=base instead of
mode=node?  Or is it because in math fonts, the digits and/or
full-stop
have different codes?


math fonts are defined and then don't change i.e. they are quite
static and all juggling with individual symbols of sequences is done
using predictable methods

—MHB

On Mon, Aug 1, 2016 at 9:46 AM, Mohammad Hossein Bateni
<bat...@gmail.com <mailto:bat...@gmail.com>
<mailto:bat...@gmail.com <mailto:bat...@gmail.com>>> wrote:

Dear list,

I want to add a customized font feature to the math font, to
automatically change the decimal point (unicode 0x2E) to the
Arabic/Farsi version (unicode 0x66B).  This will go well
with the
mapping from Latin digits to Farsi digits (done in a sample with
mathdigits fallback).

For instance, I want to code in $123.45$ and get a result like
۱۲۳٫۴۵.  However, I do not want to simply map 0x2E to 0x66B,
because
then "full stop" outside a number will also change.  In
particular,
I'd like to have the mapping only when full-stop is preceded and
succeeded by a digit.  This will, among other things, leave the
end-of-equation periods unchanged.

Here is how I tried to achieve it.


\startluacode
digits = { 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
0x38, 0x39 }
-- 0x66B instead of 0x2F gives an error!
replacements = { [0x002E] = { 0x2F } }
fonts.handlers.otf.addfeature {
  name = "mpf",
  type = "chainsubstitution",
  lookups = { {
type = "multiple",
data = replacements,
  } },
  data = {
rules = {
  {
current = { { 0x002E } },
after   = { digits },
before  = { digits },
lookups = { 1 },
  }
}
  }
}
\stopluacode

\definefontfeature[mathperiod][mpf=yes]

\resetfontfallback [mathdigits]


%\definefontfallback[mathdigits][dejavusansmono][digitsextendedarabicindic][check=yes,force=yes,offset=digitsnormal]

\definefontsynonym


[MathRoman][name:modern][features={math\mathsizesuffix,mathperiod},goodies=lm-math,fallbacks=mathdigits]

\starttext
$123.45.$

123.45.

\addff{mathperiod}
123.45.
\stoptext


Though this font feature works outside math, it does not seem to
have any effect within the math font.  Why is that?  Can we
add font
feature to the math font?  Are the character codes different?

Notice that I could not get it to work, so I commented out the
fallback for Persian digits, to make things simpler.  To get the
proof of concept, I am trying to change period to forward
slash (see
below).

Is the syntax I use for having two features in
\defontfontsynonym
correct?  Actually, I did try with only mathperiod and it
does not
work, either.

When I change 0x2F (slash) to 0x066B in "

Re: [NTG-context] Changing decimals points to Persian ones via font features

2016-08-08 Thread Mohammad Hossein Bateni
Thanks, Hans!

I see; this does work except for the trouble of annotating with \digits
macro.  Would it be possible if I wrote a processor in Lua to do the work?

nodes.tasks.appendaction ("processors", "before", "fix_persian_mathperiod")

Can I find out if a node is inside math?  If I look at the corresponding
font, how can I find out if this is a math font or not?


I take it that in math fonts, kerning does not work, either?  In my case,
the Persian decimal separator usually has a part below the baseline that
extends to the left, and because all (Persian) digits are above the
baseline, I get an ugly space in the middle.  If kerning is not possible at
all, I can try to change the dimensions of Persian decimal separator symbol
because the kern is always necessary.  Is it possible to change the
dimensions of the symbol or is that also fixed and unchangeable?

Thanks a lot!
—MHB



On Mon, Aug 8, 2016 at 10:44 AM, Hans Hagen <pra...@wxs.nl> wrote:

> On 8/2/2016 9:54 PM, Mohammad Hossein Bateni wrote:
>
>> Could the problem be because math fonts use mode=base instead of
>> mode=node?  Or is it because in math fonts, the digits and/or full-stop
>> have different codes?
>>
>
> math fonts are defined and then don't change i.e. they are quite static
> and all juggling with individual symbols of sequences is done using
> predictable methods
>
> —MHB
>>
>> On Mon, Aug 1, 2016 at 9:46 AM, Mohammad Hossein Bateni
>> <bat...@gmail.com <mailto:bat...@gmail.com>> wrote:
>>
>> Dear list,
>>
>> I want to add a customized font feature to the math font, to
>> automatically change the decimal point (unicode 0x2E) to the
>> Arabic/Farsi version (unicode 0x66B).  This will go well with the
>> mapping from Latin digits to Farsi digits (done in a sample with
>> mathdigits fallback).
>>
>> For instance, I want to code in $123.45$ and get a result like
>> ۱۲۳٫۴۵.  However, I do not want to simply map 0x2E to 0x66B, because
>> then "full stop" outside a number will also change.  In particular,
>> I'd like to have the mapping only when full-stop is preceded and
>> succeeded by a digit.  This will, among other things, leave the
>> end-of-equation periods unchanged.
>>
>> Here is how I tried to achieve it.
>>
>>
>> \startluacode
>> digits = { 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39
>> }
>> -- 0x66B instead of 0x2F gives an error!
>> replacements = { [0x002E] = { 0x2F } }
>> fonts.handlers.otf.addfeature {
>>   name = "mpf",
>>   type = "chainsubstitution",
>>   lookups = { {
>> type = "multiple",
>> data = replacements,
>>   } },
>>   data = {
>> rules = {
>>   {
>> current = { { 0x002E } },
>> after   = { digits },
>> before  = { digits },
>> lookups = { 1 },
>>   }
>> }
>>   }
>> }
>> \stopluacode
>>
>>     \definefontfeature[mathperiod][mpf=yes]
>>
>> \resetfontfallback [mathdigits]
>> %\definefontfallback[mathdigits][dejavusansmono][digitsexten
>> dedarabicindic][check=yes,force=yes,offset=digitsnormal]
>>
>> \definefontsynonym
>> [MathRoman][name:modern][features={math\mathsizesuffix,mathp
>> eriod},goodies=lm-math,fallbacks=mathdigits]
>>
>> \starttext
>> $123.45.$
>>
>> 123.45.
>>
>> \addff{mathperiod}
>> 123.45.
>> \stoptext
>>
>>
>> Though this font feature works outside math, it does not seem to
>> have any effect within the math font.  Why is that?  Can we add font
>> feature to the math font?  Are the character codes different?
>>
>> Notice that I could not get it to work, so I commented out the
>> fallback for Persian digits, to make things simpler.  To get the
>> proof of concept, I am trying to change period to forward slash (see
>> below).
>>
>> Is the syntax I use for having two features in \defontfontsynonym
>> correct?  Actually, I did try with only mathperiod and it does not
>> work, either.
>>
>> When I change 0x2F (slash) to 0x066B in "replacements", I get an
>> error as follows.
>>
>>
>> fonts   > otf chain > feature 'mpf', type
>> 'gsub_contextchain', chain lookup 'mpf': rule 1 matches at char
>> U+0002E (period) for (1,1,

Re: [NTG-context] Changing decimals points to Persian ones via font features

2016-08-08 Thread Hans Hagen

On 8/2/2016 9:54 PM, Mohammad Hossein Bateni wrote:

Could the problem be because math fonts use mode=base instead of
mode=node?  Or is it because in math fonts, the digits and/or full-stop
have different codes?


math fonts are defined and then don't change i.e. they are quite static 
and all juggling with individual symbols of sequences is done using 
predictable methods



—MHB

On Mon, Aug 1, 2016 at 9:46 AM, Mohammad Hossein Bateni
<bat...@gmail.com <mailto:bat...@gmail.com>> wrote:

Dear list,

I want to add a customized font feature to the math font, to
automatically change the decimal point (unicode 0x2E) to the
Arabic/Farsi version (unicode 0x66B).  This will go well with the
mapping from Latin digits to Farsi digits (done in a sample with
mathdigits fallback).

For instance, I want to code in $123.45$ and get a result like
۱۲۳٫۴۵.  However, I do not want to simply map 0x2E to 0x66B, because
then "full stop" outside a number will also change.  In particular,
I'd like to have the mapping only when full-stop is preceded and
succeeded by a digit.  This will, among other things, leave the
end-of-equation periods unchanged.

Here is how I tried to achieve it.


\startluacode
digits = { 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39 }
-- 0x66B instead of 0x2F gives an error!
replacements = { [0x002E] = { 0x2F } }
fonts.handlers.otf.addfeature {
  name = "mpf",
  type = "chainsubstitution",
  lookups = { {
type = "multiple",
data = replacements,
  } },
  data = {
rules = {
  {
current = { { 0x002E } },
after   = { digits },
before  = { digits },
lookups = { 1 },
  }
}
  }
}
\stopluacode

\definefontfeature[mathperiod][mpf=yes]

\resetfontfallback [mathdigits]

%\definefontfallback[mathdigits][dejavusansmono][digitsextendedarabicindic][check=yes,force=yes,offset=digitsnormal]

\definefontsynonym

[MathRoman][name:modern][features={math\mathsizesuffix,mathperiod},goodies=lm-math,fallbacks=mathdigits]

    \starttext
$123.45.$

123.45.

\addff{mathperiod}
123.45.
\stoptext


Though this font feature works outside math, it does not seem to
have any effect within the math font.  Why is that?  Can we add font
feature to the math font?  Are the character codes different?

Notice that I could not get it to work, so I commented out the
fallback for Persian digits, to make things simpler.  To get the
proof of concept, I am trying to change period to forward slash (see
below).

Is the syntax I use for having two features in \defontfontsynonym
correct?  Actually, I did try with only mathperiod and it does not
work, either.

When I change 0x2F (slash) to 0x066B in "replacements", I get an
error as follows.


fonts   > otf chain > feature 'mpf', type
'gsub_contextchain', chain lookup 'mpf': rule 1 matches at char
U+0002E (period) for (1,1,1) chars, lookuptype 'gsub_multiple'

error:
...ext/tex/texmf-context/tex/context/base/mkiv/font-ots.lua:1232:
attempt to index field '?' (a nil value)

tex error   > tex error on line 1 in file
/Users/bateni/farsitex/context/bostan/examples/mathfa/1.tex: ?

\page ->\par
 \dosingleempty \page_breaks_process
\strc_pagenumbers_flush_final_page ...\else \page

[\p_strc_pagenumbers_page ...
\dostoptext ...\strc_pagenumbers_flush_final_page
  \page \the
\everystoptext ...
l.1 \dostoptext

\clf_stoptext ->\luafunction \16>>clf_stoptext

l.46 \stoptext



Best,
MHB




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




--

-
  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 / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / h

Re: [NTG-context] Changing decimals points to Persian ones via font features

2016-08-08 Thread Hans Hagen

On 8/1/2016 3:46 PM, Mohammad Hossein Bateni wrote:

Dear list,

I want to add a customized font feature to the math font, to
automatically change the decimal point (unicode 0x2E) to the
Arabic/Farsi version (unicode 0x66B).  This will go well with the
mapping from Latin digits to Farsi digits (done in a sample with
mathdigits fallback).

For instance, I want to code in $123.45$ and get a result like ۱۲۳٫۴۵.
However, I do not want to simply map 0x2E to 0x66B, because then "full
stop" outside a number will also change.  In particular, I'd like to
have the mapping only when full-stop is preceded and succeeded by a
digit.  This will, among other things, leave the end-of-equation periods
unchanged.

Here is how I tried to achieve it.


\startluacode
digits = { 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39 }
-- 0x66B instead of 0x2F gives an error!
replacements = { [0x002E] = { 0x2F } }
fonts.handlers.otf.addfeature {
  name = "mpf",
  type = "chainsubstitution",
  lookups = { {
type = "multiple",
data = replacements,
  } },
  data = {
rules = {
  {
current = { { 0x002E } },
after   = { digits },
before  = { digits },
lookups = { 1 },
  }
}
  }
}
\stopluacode

\definefontfeature[mathperiod][mpf=yes]

\resetfontfallback [mathdigits]
%\definefontfallback[mathdigits][dejavusansmono][digitsextendedarabicindic][check=yes,force=yes,offset=digitsnormal]

\definefontsynonym
[MathRoman][name:modern][features={math\mathsizesuffix,mathperiod},goodies=lm-math,fallbacks=mathdigits]

\starttext
$123.45.$

123.45.

\addff{mathperiod}
123.45.
\stoptext


Though this font feature works outside math, it does not seem to have
any effect within the math font.  Why is that?  Can we add font feature
to the math font?  Are the character codes different?

Notice that I could not get it to work, so I commented out the fallback
for Persian digits, to make things simpler.  To get the proof of
concept, I am trying to change period to forward slash (see below).

Is the syntax I use for having two features in \defontfontsynonym
correct?  Actually, I did try with only mathperiod and it does not work,
either.

When I change 0x2F (slash) to 0x066B in "replacements", I get an error
as follows.


fonts   > otf chain > feature 'mpf', type 'gsub_contextchain',
chain lookup 'mpf': rule 1 matches at char U+0002E (period) for (1,1,1)
chars, lookuptype 'gsub_multiple'

error: ...ext/tex/texmf-context/tex/context/base/mkiv/font-ots.lua:1232:
attempt to index field '?' (a nil value)

tex error   > tex error on line 1 in file
/Users/bateni/farsitex/context/bostan/examples/mathfa/1.tex: ?

\page ->\par
 \dosingleempty \page_breaks_process
\strc_pagenumbers_flush_final_page ...\else \page

[\p_strc_pagenumbers_page ...
\dostoptext ...\strc_pagenumbers_flush_final_page
  \page \the
\everystoptext ...
l.1 \dostoptext

\clf_stoptext ->\luafunction \16>>clf_stoptext

l.46 \stoptext


there are no features in math as in text if only because in math each 
symbol is a separate entity (so 1.2 is three things) .. you can try:



\def\digitsperiodsymbol{!}

$ ... \digits{123.456} ... $

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

[NTG-context] OTF feature for a math font

2016-08-05 Thread Mohammad Hossein Bateni
Dear Hans & Wolfgang,

I resolved some of the minor issues.  But the main question still stands.
Is it possible to add an OTF feature to the math font?  In the very simple
case, I want to change any sequence like "1.2" to "1/2".  My feature (see
below) works for text fonts but not in math mode.

Thanks,
MHB

On Tue, Aug 2, 2016 at 3:54 PM, Mohammad Hossein Bateni <bat...@gmail.com>
wrote:

> Could the problem be because math fonts use mode=base instead of
> mode=node?  Or is it because in math fonts, the digits and/or full-stop
> have different codes?
> —MHB
>
> On Mon, Aug 1, 2016 at 9:46 AM, Mohammad Hossein Bateni <bat...@gmail.com>
> wrote:
>
>> Dear list,
>>
>> I want to add a customized font feature to the math font, to
>> automatically change the decimal point (unicode 0x2E) to the Arabic/Farsi
>> version (unicode 0x66B).  This will go well with the mapping from Latin
>> digits to Farsi digits (done in a sample with mathdigits fallback).
>>
>> For instance, I want to code in $123.45$ and get a result like ۱۲۳٫۴۵.
>> However, I do not want to simply map 0x2E to 0x66B, because then "full
>> stop" outside a number will also change.  In particular, I'd like to have
>> the mapping only when full-stop is preceded and succeeded by a digit.  This
>> will, among other things, leave the end-of-equation periods unchanged.
>>
>> Here is how I tried to achieve it.
>>
>>
>> \startluacode
>> digits = { 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39 }
>> -- 0x66B instead of 0x2F gives an error!
>> replacements = { [0x002E] = { 0x2F } }
>> fonts.handlers.otf.addfeature {
>>   name = "mpf",
>>   type = "chainsubstitution",
>>   lookups = { {
>> type = "multiple",
>> data = replacements,
>>   } },
>>   data = {
>> rules = {
>>   {
>> current = { { 0x002E } },
>> after   = { digits },
>> before  = { digits },
>> lookups = { 1 },
>>   }
>> }
>>   }
>> }
>> \stopluacode
>>
>> \definefontfeature[mathperiod][mpf=yes]
>>
>> \resetfontfallback [mathdigits]
>> %\definefontfallback[mathdigits][dejavusansmono][
>> digitsextendedarabicindic][check=yes,force=yes,offset=digitsnormal]
>>
>> \definefontsynonym [MathRoman][name:modern][
>> features={math\mathsizesuffix,mathperiod},goodies=lm-math,
>> fallbacks=mathdigits]
>>
>> \starttext
>> $123.45.$
>>
>> 123.45.
>>
>> \addff{mathperiod}
>> 123.45.
>> \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
___

Re: [NTG-context] Changing decimals points to Persian ones via font features

2016-08-02 Thread Mohammad Hossein Bateni
Could the problem be because math fonts use mode=base instead of
mode=node?  Or is it because in math fonts, the digits and/or full-stop
have different codes?
—MHB

On Mon, Aug 1, 2016 at 9:46 AM, Mohammad Hossein Bateni <bat...@gmail.com>
wrote:

> Dear list,
>
> I want to add a customized font feature to the math font, to automatically
> change the decimal point (unicode 0x2E) to the Arabic/Farsi version
> (unicode 0x66B).  This will go well with the mapping from Latin digits to
> Farsi digits (done in a sample with mathdigits fallback).
>
> For instance, I want to code in $123.45$ and get a result like ۱۲۳٫۴۵.
> However, I do not want to simply map 0x2E to 0x66B, because then "full
> stop" outside a number will also change.  In particular, I'd like to have
> the mapping only when full-stop is preceded and succeeded by a digit.  This
> will, among other things, leave the end-of-equation periods unchanged.
>
> Here is how I tried to achieve it.
>
>
> \startluacode
> digits = { 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39 }
> -- 0x66B instead of 0x2F gives an error!
> replacements = { [0x002E] = { 0x2F } }
> fonts.handlers.otf.addfeature {
>   name = "mpf",
>   type = "chainsubstitution",
>   lookups = { {
> type = "multiple",
> data = replacements,
>   } },
>   data = {
> rules = {
>   {
> current = { { 0x002E } },
> after   = { digits },
> before  = { digits },
> lookups = { 1 },
>   }
> }
>   }
> }
> \stopluacode
>
> \definefontfeature[mathperiod][mpf=yes]
>
> \resetfontfallback [mathdigits]
> %\definefontfallback[mathdigits][dejavusansmono][digitsextendedarabicindic][check=yes,force=yes,offset=digitsnormal]
>
> \definefontsynonym
> [MathRoman][name:modern][features={math\mathsizesuffix,mathperiod},goodies=lm-math,fallbacks=mathdigits]
>
> \starttext
> $123.45.$
>
> 123.45.
>
> \addff{mathperiod}
> 123.45.
> \stoptext
>
>
> Though this font feature works outside math, it does not seem to have any
> effect within the math font.  Why is that?  Can we add font feature to the
> math font?  Are the character codes different?
>
> Notice that I could not get it to work, so I commented out the fallback
> for Persian digits, to make things simpler.  To get the proof of concept, I
> am trying to change period to forward slash (see below).
>
> Is the syntax I use for having two features in \defontfontsynonym
> correct?  Actually, I did try with only mathperiod and it does not work,
> either.
>
> When I change 0x2F (slash) to 0x066B in "replacements", I get an error as
> follows.
>
>
> fonts   > otf chain > feature 'mpf', type 'gsub_contextchain',
> chain lookup 'mpf': rule 1 matches at char U+0002E (period) for (1,1,1)
> chars, lookuptype 'gsub_multiple'
>
> error: ...ext/tex/texmf-context/tex/context/base/mkiv/font-ots.lua:1232:
> attempt to index field '?' (a nil value)
>
> tex error   > tex error on line 1 in file
> /Users/bateni/farsitex/context/bostan/examples/mathfa/1.tex: ?
>
> \page ->\par
>  \dosingleempty \page_breaks_process
> \strc_pagenumbers_flush_final_page ...\else \page
>
> [\p_strc_pagenumbers_page ...
> \dostoptext ...\strc_pagenumbers_flush_final_page
>   \page \the
> \everystoptext ...
> l.1 \dostoptext
>
> \clf_stoptext ->\luafunction \16>>clf_stoptext
>
> l.46 \stoptext
>
>
>
> Best,
> MHB
>
___
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
___

[NTG-context] Changing decimals points to Persian ones via font features

2016-08-01 Thread Mohammad Hossein Bateni
Dear list,

I want to add a customized font feature to the math font, to automatically
change the decimal point (unicode 0x2E) to the Arabic/Farsi version
(unicode 0x66B).  This will go well with the mapping from Latin digits to
Farsi digits (done in a sample with mathdigits fallback).

For instance, I want to code in $123.45$ and get a result like ۱۲۳٫۴۵.
However, I do not want to simply map 0x2E to 0x66B, because then "full
stop" outside a number will also change.  In particular, I'd like to have
the mapping only when full-stop is preceded and succeeded by a digit.  This
will, among other things, leave the end-of-equation periods unchanged.

Here is how I tried to achieve it.


\startluacode
digits = { 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39 }
-- 0x66B instead of 0x2F gives an error!
replacements = { [0x002E] = { 0x2F } }
fonts.handlers.otf.addfeature {
  name = "mpf",
  type = "chainsubstitution",
  lookups = { {
type = "multiple",
data = replacements,
  } },
  data = {
rules = {
  {
current = { { 0x002E } },
after   = { digits },
before  = { digits },
lookups = { 1 },
  }
}
  }
}
\stopluacode

\definefontfeature[mathperiod][mpf=yes]

\resetfontfallback [mathdigits]
%\definefontfallback[mathdigits][dejavusansmono][digitsextendedarabicindic][check=yes,force=yes,offset=digitsnormal]

\definefontsynonym
[MathRoman][name:modern][features={math\mathsizesuffix,mathperiod},goodies=lm-math,fallbacks=mathdigits]

\starttext
$123.45.$

123.45.

\addff{mathperiod}
123.45.
\stoptext


Though this font feature works outside math, it does not seem to have any
effect within the math font.  Why is that?  Can we add font feature to the
math font?  Are the character codes different?

Notice that I could not get it to work, so I commented out the fallback for
Persian digits, to make things simpler.  To get the proof of concept, I am
trying to change period to forward slash (see below).

Is the syntax I use for having two features in \defontfontsynonym correct?
Actually, I did try with only mathperiod and it does not work, either.

When I change 0x2F (slash) to 0x066B in "replacements", I get an error as
follows.


fonts   > otf chain > feature 'mpf', type 'gsub_contextchain',
chain lookup 'mpf': rule 1 matches at char U+0002E (period) for (1,1,1)
chars, lookuptype 'gsub_multiple'

error: ...ext/tex/texmf-context/tex/context/base/mkiv/font-ots.lua:1232:
attempt to index field '?' (a nil value)

tex error   > tex error on line 1 in file
/Users/bateni/farsitex/context/bostan/examples/mathfa/1.tex: ?

\page ->\par
 \dosingleempty \page_breaks_process
\strc_pagenumbers_flush_final_page ...\else \page
  [\p_strc_pagenumbers_page
...
\dostoptext ...\strc_pagenumbers_flush_final_page
  \page \the \everystoptext
...
l.1 \dostoptext

\clf_stoptext ->\luafunction \16>>clf_stoptext

l.46 \stoptext



Best,
MHB
___
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
___

[NTG-context] Test Suite Fonts "extensions-001"

2016-04-29 Thread Thomas Fehige
Below is a minimal not-working example extracted from 
"extensions-001.tex" in the fonts section of the test suite. From what I 
understand of the code, the second line should read "XPrXcXdXPrX" 
instead of "abracadabra". But it doesn't, it is still "abracadabra". 
Compiling the original extensions-001 gives me seven lines of 
"abracadabra". What am I doing wrong? I'm running ConTeXt version 
2015.05.18 12:26 MKIV current fmt: 2016.4.28 from the debian/ubuntu 
texlive packets.


\startluacode

fonts.handlers.otf.addfeature {

name = "stest",

type = "substitution",

data = {

a = "X",

b = "P",

}

}

\stopluacode

\definefontfeature[stest][stest=yes]

\starttext

\startTEXpage

\definedfont[file:DejaVuSerif.ttf*default]%

abracadabra\par

{\addff{stest}abracadabra\par}

\stopTEXpage

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

Re: [NTG-context] GSUB LookupType 6 in fea file not working

2016-01-10 Thread Hans Hagen
 before  = { { "a" } },
 current = { { "b", "c" } },
     lookups = { 1 },
 },
 },
 },
 }
\stopluacode

\definefontfeature[stest][stest=yes]
\definefontfeature[atest][atest=yes]
\definefontfeature[mtest][mtest=yes]
\definefontfeature[ltest][ltest=yes]
\definefontfeature[ktest][ktest=yes]
\definefontfeature[ytest][ytest=yes]

\starttext

\startTEXpage
 \definedfont[file:dejavu-serif.ttf*default]%
   abracadabra\par
 {\addff{stest}abracadabra\par}
 {\addff{atest}abracadabra\par}
 {\addff{mtest}abracadabra\par}
 {\addff{ltest}abracadabra\par}
 {\addff{ktest}abracadabra\par}
 \enabletrackers[otf.*]
 {\addff{ytest}abracadabra\par}
 \disabletrackers[otf.*]
\stopTEXpage

\stoptext




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

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




--

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | www.pragma-ade.com | 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 / 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
___

Re: [NTG-context] GSUB LookupType 6 in fea file not working

2016-01-09 Thread Paolo Brasolin
That's really cool.
I ended up directly patching the font, but the patch itself would
probably be easier to produce with some scripting. I'll definitely
play around with your code.
Thanks Hans!

2016-01-07 13:43 GMT+01:00 Hans Hagen <pra...@wxs.nl>:
> On 1/6/2016 5:28 PM, Paolo Brasolin wrote:
>>
>> Hello.
>>
>> I am trying to add some custom ligatures to a font using a feature file.
>> Everything works just fine, until I try what is called a chained
>> contextual substitution, i.e. a GSUB lookup of type 6.
>> I am studying the specs from
>>
>> http://www.adobe.com/devnet/opentype/afdko/topic_feature_file_syntax.html#5.f
>>
>> A simple example.fea that does not work for me is:
>>
>>
>> languagesystem dflt dflt;
>>
>> lookup FOOBAR {
>>sub B by Q ;
>> } FOOBAR;
>>
>> feature foba {
>>sub [A] B' lookup FOOBAR;
>> } foba ;
>>
>>
>> I'd expect it to replace B with Q only when preceeded by A.
>> The same rule expressed with a lookup of type 8 works just fine:
>>
>>
>> languagesystem dflt dflt;
>>
>> feature foba {
>>sub [A] B' by Q;
>> } foba ;
>>
>>
>> Ultimately I would need to use multiple inline lookups, something like
>>sub [A]' B' lookup FOO C' lookup BAR;
>>
>> Are inline lookups unsupported by the engine?
>> That would seem strange to me.
>> I'm probably missing some point, but I'm unable to find more
>> documentation.
>> Am I using the wrong syntax?
>
>
> As we have a way to define additional features in context i played a bit
> with contextual lookups. As a result we now have an additional type
> chainsubstitution. In due time I will document this better (once it's
> settled). I still need to think of a way to kick this into place at a
> specific location in the sequence.
>
> Btw, contrary to fea extensions (not supported in the new font loader
> anyway) these are runtime extensions i.e. not cached.
>
> I'll upload a beta.
>
> --
>
> \startluacode
> fonts.handlers.otf.addfeature {
> name = "stest",
> type = "substitution",
> data = {
> a = "X",
> b = "P",
> }
> }
> \stopluacode
>
> \startluacode
> fonts.handlers.otf.addfeature {
> name = "atest",
> type = "alternate",
> data = {
> a = { "X", "Y" },
> b = { "P", "Q" },
> }
> }
> \stopluacode
>
> \startluacode
> fonts.handlers.otf.addfeature {
> name = "mtest",
> type = "multiple",
> data = {
> a = { "X", "Y" },
> b = { "P", "Q" },
> }
> }
> \stopluacode
>
> \startluacode
> fonts.handlers.otf.addfeature {
> name = "ltest",
> type = "ligature",
> data = {
> ['1'] = { "a", "b" },
> ['2'] = { "d", "a" },
> }
> }
> \stopluacode
>
> \startluacode
> fonts.handlers.otf.addfeature {
> name = "ktest",
> type = "kern",
> data = {
> a = { b = -500 },
> }
> }
> \stopluacode
>
> \startluacode
> fonts.handlers.otf.addfeature {
> name= "ytest",
> type= "chainsubstitution",
>  -- flags   = { false, false, false, false },
> lookups = {
> {
> type = "substitution",
> data = {
> ["b"] = "B",
> ["c"] = "C",
> },
> },
> },
>  -- steps= {
>  -- {
>  -- rules = {
>  -- {
>  --     before  = { { "a" } },
>  -- current = { { "b", "c" } },
>  -- lookups = { 1 },
>  -- },
>  -- },
>  -- },
>  -- },
> data = {
> rules = {
> {
> before  = { { "a" } },
> current = { { "b", "c" } },
> lookups = { 1 },
> },
> },
> },
> }
> \stopl

Re: [NTG-context] GSUB LookupType 6 in fea file not working

2016-01-07 Thread Hans Hagen

On 1/6/2016 5:28 PM, Paolo Brasolin wrote:

Hello.

I am trying to add some custom ligatures to a font using a feature file.
Everything works just fine, until I try what is called a chained
contextual substitution, i.e. a GSUB lookup of type 6.
I am studying the specs from
http://www.adobe.com/devnet/opentype/afdko/topic_feature_file_syntax.html#5.f

A simple example.fea that does not work for me is:


languagesystem dflt dflt;

lookup FOOBAR {
   sub B by Q ;
} FOOBAR;

feature foba {
   sub [A] B' lookup FOOBAR;
} foba ;


I'd expect it to replace B with Q only when preceeded by A.
The same rule expressed with a lookup of type 8 works just fine:


languagesystem dflt dflt;

feature foba {
   sub [A] B' by Q;
} foba ;


Ultimately I would need to use multiple inline lookups, something like
   sub [A]' B' lookup FOO C' lookup BAR;

Are inline lookups unsupported by the engine?
That would seem strange to me.
I'm probably missing some point, but I'm unable to find more documentation.
Am I using the wrong syntax?


As we have a way to define additional features in context i played a bit 
with contextual lookups. As a result we now have an additional type 
chainsubstitution. In due time I will document this better (once it's 
settled). I still need to think of a way to kick this into place at a 
specific location in the sequence.


Btw, contrary to fea extensions (not supported in the new font loader 
anyway) these are runtime extensions i.e. not cached.


I'll upload a beta.

--

\startluacode
fonts.handlers.otf.addfeature {
name = "stest",
type = "substitution",
data = {
a = "X",
b = "P",
}
}
\stopluacode

\startluacode
fonts.handlers.otf.addfeature {
name = "atest",
type = "alternate",
data = {
a = { "X", "Y" },
b = { "P", "Q" },
}
}
\stopluacode

\startluacode
fonts.handlers.otf.addfeature {
name = "mtest",
type = "multiple",
data = {
a = { "X", "Y" },
b = { "P", "Q" },
}
}
\stopluacode

\startluacode
fonts.handlers.otf.addfeature {
name = "ltest",
type = "ligature",
data = {
['1'] = { "a", "b" },
['2'] = { "d", "a" },
}
}
\stopluacode

\startluacode
fonts.handlers.otf.addfeature {
name = "ktest",
type = "kern",
data = {
a = { b = -500 },
}
}
\stopluacode

\startluacode
fonts.handlers.otf.addfeature {
name= "ytest",
type= "chainsubstitution",
 -- flags   = { false, false, false, false },
lookups = {
{
type = "substitution",
data = {
["b"] = "B",
["c"] = "C",
},
},
},
 -- steps= {
 -- {
 -- rules = {
 -- {
 -- before  = { { "a" } },
 -- current = { { "b", "c" } },
 -- lookups = { 1 },
 -- },
 -- },
 -- },
 -- },
data = {
rules = {
{
before  = { { "a" } },
current = { { "b", "c" } },
lookups = { 1 },
},
},
},
}
\stopluacode

\definefontfeature[stest][stest=yes]
\definefontfeature[atest][atest=yes]
\definefontfeature[mtest][mtest=yes]
\definefontfeature[ltest][ltest=yes]
\definefontfeature[ktest][ktest=yes]
\definefontfeature[ytest][ytest=yes]

\starttext

\startTEXpage
\definedfont[file:dejavu-serif.ttf*default]%
  abracadabra\par
{\addff{stest}abracadabra\par}
{\addff{atest}abracadabra\par}
{\addff{mtest}abracadabra\par}
{\addff{ltest}abracadabra\par}
{\addff{ktest}abracadabra\par}
\enabletrackers[otf.*]
{\addff{ytest}abracadabra\par}
\disabletrackers[otf.*]
\stopTEXpage

\stoptext



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

Re: [NTG-context] superior numbers for footnote numbers?

2015-02-05 Thread Jörg Weger

Thank you very much! I had not thought it was that easy!

Jörg

On 05.02.2015 13:14, Wolfgang Schuster wrote:

\definefontfamily [mainface][rm][Linux Libertine O]
\definefontfamily [mainface][mm][TeX Gyre Pagella Math]

\definefontfeature[f:sups][sups=yes]

\setupbodyfont[mainface]

\setupnote[footnote][textcommand=,textstyle=\addff{f:sups}]
\setupnotation[footnote][numbercommand=,headstyle=\addff{f:sups}]

\starttext

\input knuth\footnote{Knuth sample text}

\input ward\footnote{Ward sample text}

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

Re: [NTG-context] superior numbers for footnote numbers?

2015-02-05 Thread Hans Hagen

On 2/5/2015 2:10 PM, Jörg Weger wrote:

Thank you very much! I had not thought it was that easy!

Jörg

On 05.02.2015 13:14, Wolfgang Schuster wrote:

\definefontfamily [mainface][rm][Linux Libertine O]
\definefontfamily [mainface][mm][TeX Gyre Pagella Math]

\definefontfeature[f:sups][sups=yes]

\setupbodyfont[mainface]

\setupnote[footnote][textcommand=,textstyle=\addff{f:sups}]
\setupnotation[footnote][numbercommand=,headstyle=\addff{f:sups}]

\starttext

\input knuth\footnote{Knuth sample text}

\input ward\footnote{Ward sample text}

\stoptext


i'll add:

\definefontfeature[f:superiors][sups=yes]

\unexpanded\def\setsuperiors{\doaddfeature{f:superiors}}

(we already have \setsmallcaps, \settabular and \setoldstyle)

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

Re: [NTG-context] superior numbers for footnote numbers?

2015-02-05 Thread Jörg Weger

Hello Hans,


Those are nice self-explanatory commands which also mean I don’t have to 
define them myself.


From my short opentype feature experience I would add the following 
combinations (defined names could be shortened, long names here only for 
better explanation):



Tabular oldstyle numbers (oldstyle numbers aligning correctly in tables 
through fixed spacing):


\definefontfeature[f:tabular_oldstyle][onum=yes,tnum=yes]

\unexpanded\def\settaboldstyle{\doaddfeature{f:tabular_oldstyle}}

\settaboldstyle


Proportional oldstyle numbers (oldstyle numbers for in-text use 
spaced/kerned according to their forms):


\definefontfeature[f:proportional_oldstyle][onum=yes,pnum=yes]

\unexpanded\def\setpropoldstyle{\doaddfeature{f:proportional_oldstyle}}

\setpropoldstyle


Tabular lining numbers (lining numbers aligning correctly in tables 
through fixed spacing):


\definefontfeature[f:tabular_lining][lnum=yes,tnum=yes]

\unexpanded\def\settablining{\doaddfeature{f:tabular_lining}}

\settablining


Proportional lining numbers (lining numbers spaced/kerned according to 
their forms):


\definefontfeature[f:proportional_lining][lnum=yes,pnum=yes]

\unexpanded\def\setproplining{\doaddfeature{f:proportional_lining}}

\setproplining


plus

Scientific inferiors (numbers for subscript, e.g. in chemical formulas):

\definefontfeature[f:inferiors][sinf=yes]

\unexpanded\def\setinferiors{\doaddfeature{f:inferiors}}

\setinferiors


Of course all this works only if the font offers the according opentype 
features.



Greetings Jörg



On 05.02.2015 23:46, Hans Hagen wrote:

On 2/5/2015 2:10 PM, Jörg Weger wrote:

Thank you very much! I had not thought it was that easy!

Jörg

On 05.02.2015 13:14, Wolfgang Schuster wrote:

\definefontfamily [mainface][rm][Linux Libertine O]
\definefontfamily [mainface][mm][TeX Gyre Pagella Math]

\definefontfeature[f:sups][sups=yes]

\setupbodyfont[mainface]

\setupnote[footnote][textcommand=,textstyle=\addff{f:sups}]
\setupnotation[footnote][numbercommand=,headstyle=\addff{f:sups}]

\starttext

\input knuth\footnote{Knuth sample text}

\input ward\footnote{Ward sample text}

\stoptext


i'll add:

\definefontfeature[f:superiors][sups=yes]

\unexpanded\def\setsuperiors{\doaddfeature{f:superiors}}

(we already have \setsmallcaps, \settabular and \setoldstyle)

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

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
___

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

Re: [NTG-context] superior numbers for footnote numbers?

2015-02-05 Thread Wolfgang Schuster

 Am 05.02.2015 um 13:01 schrieb Jörg Weger joerg73@googlemail.com:
 
 
 Better equipped opentype fonts offer so called superior numbers as an 
 opentype feature. Those are special smaller figures for “superscript” 
 (opentype feature “sups”) that are not simply scaled down versions of the 
 normal figures (be they oldstyle or lining) you are normally using.
 
 Scaling down is as far as I understood the default way context is using to 
 generate the numbers for footnotes. Is there a way to define the use of 
 unscaled superiors according to the fontsizes of body text and footnote text 
 instead?
 
 Greetings Jörg
 
 PS: I am using for serif the “Linux Libertine O” family (installed as OTF and 
 invoked by the included mkiv simplefont mechanism) which has the “sups” 
 feature.

\definefontfamily [mainface][rm][Linux Libertine O]
\definefontfamily [mainface][mm][TeX Gyre Pagella Math]

\definefontfeature[f:sups][sups=yes]

\setupbodyfont[mainface]

\setupnote[footnote][textcommand=,textstyle=\addff{f:sups}]
\setupnotation[footnote][numbercommand=,headstyle=\addff{f:sups}]

\starttext

\input knuth\footnote{Knuth sample text}

\input ward\footnote{Ward sample text}

\stoptext

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

Re: [NTG-context] Setup for appendices: a bunch of questions

2015-02-05 Thread Wolfgang Schuster

 Am 04.02.2015 um 22:06 schrieb Mojca Miklavec 
 mojca.miklavec.li...@gmail.com:
 
 Hello,
 
 I need a tiny bit of help with properly setting up the appendices.
 
 1.) I would like to include both chapters and titles. Is this the
 proper way to go? (It took me a while to figure out how to include the
 titles at all.)
 
\setuphead
[title]
[incrementnumber=list]
\placelist
[title,chapter,section]
[criterium=all,alternative=c]
 
 But why is there less space in front of a \title{...} in TOC than in
 front of a \chapter{…}?

You can use the “margin” key to indent the title entries but unnumbered chapter 
are still wrong aligned.

 2.) How can I define a different width for appendices in TOC (to
 reserve enough space for the word Appendix)?
 
 I use
 
 \setuplist
[section]
[width=10mm,numberstyle=\os\bf,pagestyle=\os,label=yes]
 
 but I would like to use width=27mm for sections inside
 \startappendices ... \stopappendices than for regular sections. Is
 there any workaround?

Use the “numbercommand” key to measure the width of the number
and apply different widths for narrow and wide entries.

 3.) For appendices I want to set
 
 \setuphead
[chapter]
[number=no]
 \setuphead
[section]
[page=yes,sectionsegments=section,conversion=Character,sectionstopper=:]
 
 without affecting regular sections and chapters.
 
 Is it possible to do this on top of the document (or in the layout) as
 opposed to changing the settings just before appendices start? I would
 like to avoid messing up with such settings in the middle of the
 document.

Use \startsectionblockenvironment to set the setups at the begin of the 
document.

 I tried to play with
\defineconversionset
 and
\setupsectionblock
[appendix]
[sectionconversionset=...]
 but I'm unable to understand how these commands work exactly.

Take a look at the example below how this can be achieved.

 begin example

\def\sc{\addff{smallcaps}}
\def\os{\addff{oldstyle}}

\setuplabeltext
[appendix=Appendix~]

\setuphead
[title]
[incrementnumber=list,page=yes]

\setuphead
[chapter]
[page=no,numberstyle=\os]

\setuphead
[section]
[style=\bfb,numberstyle=\os,appendixlabel=appendix]

\setuplist
[title,chapter]

[width=10mm,textstyle=\sc\bfb,numberstyle=\os\bfb,pagestyle=\os,aligntitle=no]

\setuplist
[title]
[margin=10mm]

\define[1]\SectionlistNumber
  {\dowithnextbox
 {\ifdim\nextboxwd10mm
\simplealignedbox{10mm}{flushleft}{\flushnextbox}%
  \else
\simplealignedbox{27mm}{flushleft}{\flushnextbox}%
  \fi}
 \hbox{#1}}

\setuplist
[section]

[width=0pt,numberstyle=\os\bf,pagestyle=\os,label=yes,numbercommand=\SectionlistNumber]

% The \defineconversionset command allows you to define
% different conversion for each sectionblock in your
% document by adding the name of the sectionblock in
% front of the name of the conversion set.

\defineconversionset [bodypart:sectioncounter] [n,n,n] [n]
\defineconversionset [appendix:sectioncounter] [n,n,A] [n]

\setuphead[chapter,section][sectionconversionset=sectioncounter]

% With the sectionblock environment you can list setups
% which are applied at the begin of the specified block
% in your document, e.g. the following setups are used
% after \startappendices:

\startsectionblockenvironment[appendix]

\setuphead
[chapter]
[number=no]

\setuphead
[section]
[page=yes,
 sectionsegments=section,
 sectionstopper=:]

\stopsectionblockenvironment

\setupbodyfont[palatino]

\starttext

\startfrontmatter

\title{Contents}
\placelist[title,chapter,section][criterium=all,alternative=c]

Why is there less space in front of a title in TOC than in front of a chapter?

How to define a different width for appendices (to reserve enough space for the 
word Appendix)?

\stopfrontmatter

\startbodymatter

\chapter{First Chapter}
\section{First Section}
\chapter{Second Chapter}
\section{Second Section}

\stopbodymatter

\startappendices

\chapter{Appendices}

\section{First Appendix}
\input tufte

\section{Second Appendix}
\input zapf

\title{Why is there less space in toc?}

\stopappendices

\stoptext

 end example

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

[NTG-context] Bold small caps

2014-05-23 Thread Mojca Miklavec
Hi,

I always forget how to use bold or italic small caps (I keep mixing
addff/setff and smcp/+smcp/smallcaps etc.). In ideal world it could be
nice if simply
{\sc Normal and \bf Bold Small Caps} or
{\bf\sc Bold Small Caps}
would work out-of-the-box.

The first hit on the wiki was
http://wiki.contextgarden.net/Bold_small_caps
which contained just the MKII example. I added a MKIV example
{\setff{smallcaps} Normal and \bf bold Small Caps.}
but the problem is that this example only works with put any font
name here except for the default Latin Modern setup.

Would it make sense to fix this for the default LM setup as well?

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


Re: [NTG-context] Bold small caps

2014-05-23 Thread Wolfgang Schuster

Am 23.05.2014 um 17:55 schrieb Mojca Miklavec mojca.miklavec.li...@gmail.com:

 Hi,
 
 I always forget how to use bold or italic small caps (I keep mixing
 addff/setff and smcp/+smcp/smallcaps etc.). In ideal world it could be
 nice if simply
{\sc Normal and \bf Bold Small Caps} or
{\bf\sc Bold Small Caps}
 would work out-of-the-box.
 
 The first hit on the wiki was
http://wiki.contextgarden.net/Bold_small_caps
 which contained just the MKII example. I added a MKIV example
{\setff{smallcaps} Normal and \bf bold Small Caps.}
 but the problem is that this example only works with put any font
 name here except for the default Latin Modern setup.
 
 Would it make sense to fix this for the default LM setup as well?

This need to be done by the font designers because Latin Modern
uses a separate font for the small capitals and the \setff (better use
\feature) has no effect in this case.

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


Re: [NTG-context] Bold small caps

2014-05-23 Thread Hans Hagen

On 5/23/2014 5:55 PM, Mojca Miklavec wrote:

Hi,

I always forget how to use bold or italic small caps (I keep mixing
addff/setff and smcp/+smcp/smallcaps etc.). In ideal world it could be
nice if simply
 {\sc Normal and \bf Bold Small Caps} or
 {\bf\sc Bold Small Caps}
would work out-of-the-box.

The first hit on the wiki was
 http://wiki.contextgarden.net/Bold_small_caps
which contained just the MKII example. I added a MKIV example
 {\setff{smallcaps} Normal and \bf bold Small Caps.}
but the problem is that this example only works with put any font
name here except for the default Latin Modern setup.

Would it make sense to fix this for the default LM setup as well?


I don't know .. I'd rather see lm shipped with the smallcaps in the 
regular font instead of separate.


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


Re: [NTG-context] How to enable tabular numerals with simplefonts and otf?

2013-10-19 Thread Wolfgang Schuster

Am 19.10.2013 um 22:57 schrieb Peter Münster pmli...@free.fr:

 On Sun, Jun 10 2012, Wolfgang Schuster wrote:
 
 \definefontfeature[default][default][tnum=yes]
 
 Hi,
 
 What's the new method please?
 
 I've tried this, but without success:
 
 --8---cut here---start-8---
 \definefontfamily[mainface][rm][Linux Libertine Initials O][features=tnum]
 \definefontfeature[default][default][tnum=yes]
 \setupbodyfont[mainface]
 \starttext
 \addff{tnum}
 \setff{tnum}
 \feature[+][tnum]
 \feature[+][tnum=yes]
 565656565656X\par
 X
 \stoptext
 --8---cut here---end---8---


The features key from \definefontfamily expects the name of a feature set 
(first argument
of \definefontfeature) and not the name of a opentype feature.

Even when you use the correct it won’t help because the font has a no spacing 
for
the number 3 to 9.

\definefontfeature[default][default][tnum=yes]

\definefontfamily[mainface][rm][Linux Libertine Initials O]

\setupbodyfont[mainface,50pt]

\starttext
\dorecurse{9}{\expanded{\dorecurse{9}{\recurselevel}}\par}
\stoptext

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


[NTG-context] \feature

2013-03-17 Thread Hans Hagen

Hi,

After some experimenting, I settled on the next interface for dynamic 
features:


The is also a generic command \type {\feature} that takes two arguments. 
Below we show all calls, with long and short variants:


\starttyping
\addfeature[f:mine] \feature [more][f:mine] \feature[+][f:mine]
\subtractfeature   [f:mine] \feature [less][f:mine] \feature[-][f:mine]
\replacefeature[f:mine] \feature  [new][f:mine] \feature[=][f:mine]
\resetandaddfeature[f:mine] \feature[local][f:mine] \feature[!][f:mine]
\revivefeature [f:mine] \feature  [old][f:mine] \feature[][f:mine]
\resetfeature   \feature[reset] \feature[]
\stoptyping

Each variant also accepts \type {{}} instead of \type {[]} so that they 
can conveniently be used in square bracket arguments.


This mechanism replaces \addff cum suis, although for a while they will 
stay around (mapped onto add and subtract).


Idris is testing it (as he used this kind of trickery extensively for 
complex arabic) and he make a nice wiki page.


We can think of a predefined set of simple features.

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


Re: [NTG-context] new trickery

2013-03-15 Thread Hans Hagen

On 3/15/2013 3:08 AM, Idris Samawi Hamid ادريس   سماوي حامد wrote:

Hi Hans,

This is interesting, because I was thinking about this issue this past
weak, and was planning to send a test file:

On Thu, 14 Mar 2013 17:39:50 -0600, Hans Hagen pra...@wxs.nl wrote:


There is a new experimental feature and (at least for now) it's also
called \feature (maybe not the best name).


\stack might be better, for the following reason:


hm, one problem with such nice names is that they might be in use in 
user definitions



 Many fonts have language dependent features. There are also features
that one only wants to enable in small text snippets. For this we have
\addff etc but these don't accumulate.


We used to have \addfs{feature} and \subfs{feature}, meaning add
feature to the stack and subtract feature from the stack. But those
have been broken for a very long time.


afaik they're not broken but they don't stack up, only the last one 
counts (for a good technical reasons)



To round it off I guess we need a replacement for \subfs as well.


that can be done by defining the proper 'reset' features (see demo 
code), keep in mind that when feature switches are in macros one never 
really knows what is 'current' so it's already quite fuzzy; of course we 
can think of a negate option (i.e. use the negation of a feature set but 
that can be dangerous as when features inherit one doesn't want to 
disable kerning (for instance)



Thanks for this wonderful new feature (pun intended) and


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

Re: [NTG-context] new trickery

2013-03-15 Thread Hans Hagen

On 3/15/2013 5:18 AM, Idris Samawi Hamid ادريس   سماوي حامد wrote:

On Thu, 14 Mar 2013 20:08:38 -0600, Idris Samawi Hamid ادريس   سماوي
حامد isha...@colostate.edu wrote:


To round it off I guess we need a replacement for \subfs as well.


Hmm, it seems that \subfs functionality is built in through the same
mechanism. Will study this some more...


yes, but there in successive calls the last one counts

\addff{x} \addff{y} \addff{z}  - z is used on top of the current font's 
set


\feature{x} \feature{y} \feature{y} - all are used on top

we might end up with replacing \addff etc by one mechanisms

\feature{+someset} : add
\feature{-someset} : subtract
\feature{=someset} : replace

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

Re: [NTG-context] new trickery

2013-03-15 Thread Jonathan Barchi
On Fri, Mar 15, 2013 at 4:35 AM, Hans Hagen pra...@wxs.nl wrote:
 On 3/15/2013 5:18 AM, Idris Samawi Hamid ادريس   سماوي حامد wrote:

 On Thu, 14 Mar 2013 20:08:38 -0600, Idris Samawi Hamid ادريس   سماوي
 حامد isha...@colostate.edu wrote:

 To round it off I guess we need a replacement for \subfs as well.


 Hmm, it seems that \subfs functionality is built in through the same
 mechanism. Will study this some more...


 yes, but there in successive calls the last one counts

 \addff{x} \addff{y} \addff{z}  - z is used on top of the current font's set

 \feature{x} \feature{y} \feature{y} - all are used on top

 we might end up with replacing \addff etc by one mechanisms

 \feature{+someset} : add
 \feature{-someset} : subtract
 \feature{=someset} : replace


I like this proposal for its use of only a single command with the
add/remove/reset in the args. If \feature ends up being too generic,
maybe \fontfeature or \fontfeatureset instead?

To keep things more in-line with current ConTeXt syntax, you could do
something like the following:

\feature{add=foo}
\feature{subtract=bar}(or sub, remove, etc.)
\feature{reset,add=baz}

Which would also allow, e.g.,

\feature{add=bar,remove=baz}

similar to how we're used to using key:value pairs in so many
arguments, and being able to combine them in one function call.

Jon


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

Re: [NTG-context] new trickery

2013-03-15 Thread Idris Samawi Hamid ادريس سماوي حامد

On Fri, 15 Mar 2013 05:07:02 -0600, Hans Hagen pra...@wxs.nl wrote:


\start
fijn fietsen 123
\type{[+os]}\addfeature{f:oldstyle}
fijn fietsen 123
\type{[+sc]}\addfeature{f:smallcaps}
fijn fietsen 123
\type{[=os]}\replacefeature{f:oldstyle}
fijn fietsen 123
\type{[=sc]}\replacefeature{f:smallcaps}
fijn fietsen 123
\stop


So I hope I have this right:

\addfeature adds a set of features {feature1,feature2,...featureN}  
to the currently defined/enabled stack of OT features


\subtractfeature subtracts a set of features from the currently  
defined/enabled stack


These two seem clear enough. I'm not so clear on the next one:

\replacefeature replaces all the _added_ features (not the default ones  
defined, e.g., in the typescripts I presume) with only those in the  
argument of \replacefeature. Is that right?


\resetfeature pops all features added to the stack (again, I'm assuming  
this does not include the default ones defined, e.g., in the typescripts).


Question: Does/Will this mechanism completely replace \addff et al, or  
will these mechanism ignore each other (e.g., \resetfeature does not pop  
those defined by \addff).


Best wishes
Idris
--
Professor Idris Samawi Hamid
Department of Philosophy
Colorado State University
Fort Collins, CO 80523
___
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
___


Re: [NTG-context] new trickery

2013-03-15 Thread Hans Hagen

On 3/15/2013 7:11 PM, Idris Samawi Hamid ادريس   سماوي حامد wrote:

On Fri, 15 Mar 2013 05:07:02 -0600, Hans Hagen pra...@wxs.nl wrote:


\start
fijn fietsen 123
\type{[+os]}\addfeature{f:oldstyle}
fijn fietsen 123
\type{[+sc]}\addfeature{f:smallcaps}
fijn fietsen 123
\type{[=os]}\replacefeature{f:oldstyle}
fijn fietsen 123
\type{[=sc]}\replacefeature{f:smallcaps}
fijn fietsen 123
\stop


So I hope I have this right:

\addfeature adds a set of features {feature1,feature2,...featureN}
to the currently defined/enabled stack of OT features


no, it adds a *predefined* featureset to the set of the current font but 
forgets them when a group is left



\subtractfeature subtracts a set of features from the currently
defined/enabled stack


idem but subtraction


These two seem clear enough. I'm not so clear on the next one:

\replacefeature replaces all the _added_ features (not the default ones
defined, e.g., in the typescripts I presume) with only those in the
argument of \replacefeature. Is that right?


This reverts back to the features that are set when the font is defined 
and adds the given set. Resetting the stack in your speak.



\resetfeature pops all features added to the stack (again, I'm assuming
this does not include the default ones defined, e.g., in the typescripts).


This reverts back to the features that are set when the font is defined.


Question: Does/Will this mechanism completely replace \addff et al, or
will these mechanism ignore each other (e.g., \resetfeature does not pop
those defined by \addff).


I dont' know ... in fact, they share code deep down in the machinery but 
indeed it might make sense to remove them (or at least depricate them).


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

Re: [NTG-context] new trickery

2013-03-15 Thread Hans Hagen

On 3/15/2013 6:16 PM, Jonathan Barchi wrote:

On Fri, Mar 15, 2013 at 4:35 AM, Hans Hagen pra...@wxs.nl wrote:

On 3/15/2013 5:18 AM, Idris Samawi Hamid ادريس   سماوي حامد wrote:


On Thu, 14 Mar 2013 20:08:38 -0600, Idris Samawi Hamid ادريس   سماوي
حامد isha...@colostate.edu wrote:


To round it off I guess we need a replacement for \subfs as well.



Hmm, it seems that \subfs functionality is built in through the same
mechanism. Will study this some more...



yes, but there in successive calls the last one counts

\addff{x} \addff{y} \addff{z}  - z is used on top of the current font's set

\feature{x} \feature{y} \feature{y} - all are used on top

we might end up with replacing \addff etc by one mechanisms

\feature{+someset} : add
\feature{-someset} : subtract
\feature{=someset} : replace



I like this proposal for its use of only a single command with the
add/remove/reset in the args. If \feature ends up being too generic,
maybe \fontfeature or \fontfeatureset instead?

To keep things more in-line with current ConTeXt syntax, you could do
something like the following:

\feature{add=foo}
\feature{subtract=bar}(or sub, remove, etc.)
\feature{reset,add=baz}

Which would also allow, e.g.,

\feature{add=bar,remove=baz}


I'd like to avoid parsing as much as possible here as these are state 
changers. So, I made:


\addfeature [f:mine] \feature[more][f:mine] \feature[+]  [f:mine]
\subtractfeature[f:mine] \feature[less][f:mine] \feature[-]  [f:mine]
\replacefeature [f:mine] \feature[new] [f:mine] \feature[=]  [f:mine]
\revivefeature  [f:mine] \feature[old] [f:mine] \feature[default][f:mine]
\resetfeature\feature[reset]

so there are several ways to achieve the same (and one can use {} 
instead of [])



similar to how we're used to using key:value pairs in so many
arguments, and being able to combine them in one function call.


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

Re: [NTG-context] new trickery

2013-03-15 Thread Hans Hagen

On 3/15/2013 7:11 PM, Idris Samawi Hamid ادريس   سماوي حامد wrote:


So I hope I have this right:

\addfeature adds a set of features {feature1,feature2,...featureN}
to the currently defined/enabled stack of OT features

\subtractfeature subtracts a set of features from the currently
defined/enabled stack

These two seem clear enough. I'm not so clear on the next one:

\replacefeature replaces all the _added_ features (not the default ones
defined, e.g., in the typescripts I presume) with only those in the
argument of \replacefeature. Is that right?

\resetfeature pops all features added to the stack (again, I'm assuming
this does not include the default ones defined, e.g., in the typescripts).

Question: Does/Will this mechanism completely replace \addff et al, or
will these mechanism ignore each other (e.g., \resetfeature does not pop
those defined by \addff).


A good exercise in understanding this is to add this to the wiki.

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

[NTG-context] new trickery

2013-03-14 Thread Hans Hagen

Hi,

There is a new experimental feature and (at least for now) it's also 
called \feature (maybe not the best name).


Many fonts have language dependent features. There are also features 
that one only wants to enable in small text snippets. For this we have 
\addff etc but these don't accumulate. The next example demonstrates an 
accumulator.


\setupbodyfont[pagella]

\starttext

% When the (again experimental) setup for 'font' is used, the
% features will also adapt themselves to the language. I'm
% still considering on how to deal with the main language.

% \definefontfeature[nl][language=nld,script=latn]
\setuplanguages[font=auto]
% \setuplanguage [default][font=auto]
% \setuplanguage [nl][font=auto]

% We need to make a nice set of 'simple' switchers.

\definefontfeature[f:smallcaps][smcp=yes]
\definefontfeature[f:nocaps]   [smcp=no]
\definefontfeature[f:oldstyle] [onum=yes]
\definefontfeature[f:newstyle] [onum=no]

% watch how features accumulate

\startTEXpage[offset=10pt]
fijn fietsen 123
\feature{f:oldstyle}
fijn fietsen 123
\feature{f:smallcaps}
fijn fietsen 123
\feature{f:oldstyle}
fijn fietsen 123
\start
\nl % \feature{nl}
fijn fietsen 123
\de
fijn fietsen 123
\stop
fijn fietsen 123
\feature{f:newstyle}
fijn fietsen 123
\feature{f:nocaps}
fijn fietsen 123
\stopTEXpage

% watch how lm has contextual lookups for ligatures
% that depend on the language

\startTEXpage[offset=10pt]
\definedfont[lmroman10-regular*default]
fijn fietsen
\nl
fijn fietsen
\de
fijn fietsen
\stopTEXpage

\stoptext

This mechanism is (just as \addff cum suis) somewhat slower but as long 
as it's used grouped, performance is quite ok.


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


Re: [NTG-context] new trickery

2013-03-14 Thread Idris Samawi Hamid ادريس سماوي حامد

Hi Hans,

This is interesting, because I was thinking about this issue this past  
weak, and was planning to send a test file:


On Thu, 14 Mar 2013 17:39:50 -0600, Hans Hagen pra...@wxs.nl wrote:

There is a new experimental feature and (at least for now) it's also  
called \feature (maybe not the best name).


\stack might be better, for the following reason:

 Many fonts have language dependent features. There are also features  
that one only wants to enable in small text snippets. For this we have  
\addff etc but these don't accumulate.


We used to have \addfs{feature} and \subfs{feature}, meaning add  
feature to the stack and subtract feature from the stack. But those  
have been broken for a very long time.


To round it off I guess we need a replacement for \subfs as well.

Thanks for this wonderful new feature (pun intended) and

Best wishes
Idris
--
Professor Idris Samawi Hamid
Department of Philosophy
Colorado State University
Fort Collins, CO 80523
___
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
___


[NTG-context] mkiv: Charis SIL / SmallCaps

2013-01-17 Thread Zenlima
Hi,

I wonder how to make that the font Chris SIL
(http://scripts.sil.org/cms/scripts/page.php?site_id=nrsiid=CharisSIL_download)
displays its Smallcaps. I checked the font with fontforge and it really
contains the Smallcaps and also the smcp table.

But for whatever reason I cannot get context to show the smallcaps. I
tried an example out of this mailing list: 

\definefontfeature[smallcapitals] [smcp=yes]
\definefontfeature[oldstylenumber][onum=yes]

%\setupbodyfont[pagella]
\setupbodyfont [charissil]

\starttext

{VA abc \setff{smallcapitals} VA abc}
{VA abc \addff{smallcapitals} VA abc}
{12345 \setff{oldstylenumber} 12345}
{VA {\kap VAabc}}
{VA {\cap VAabc}}
{VA {\CAP VAabc}}
{VA {\sc VAabc}}

\stoptext

In the above example I only get smallcaps with the \kap and \cap - but
then also the big letters are transformed into smallcaps :-(.

With pagella is works fine - but not with charissil. What have I to do
in order the get the smallcaps to work with context? 

Thanks,
H. 
___
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
___


Re: [NTG-context] italic smallcaps

2012-11-28 Thread Wolfgang Schuster

Am 28.11.2012 um 11:18 schrieb Sietse Brouwer sbbrou...@gmail.com:

 \setff{X} enables font feature X in the current scope --- do I
 understand this correctly?
 --Sietse


It enables a predefined set of features which need to define with 
\definefontfeature.

There is also a difference between \setff and \addff, with \setff you replace 
the active
feature set (in most cases “default”) with a new set, you can see it in the 
first line
because kerning etc. is disabled after \setff which I haven’t included in my 
list.

In the second line I used \adff which add my new list to the active list and 
because
of this kerning is still active after \addff.

\definefontfeature[smallcapitals] [smcp=yes]
\definefontfeature[oldstylenumber][onum=yes]

\setupbodyfont[pagella]

\starttext

{VA abc \setff{smallcapitals} VA abc}

{VA abc \addff{smallcapitals} VA abc}

{12345 \setff{oldstylenumber} 12345}

\stoptext

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


[NTG-context] font features in beta

2012-10-17 Thread Philipp Gesang
Hi all,

this works in TL but not minimals:

·
\definefontfeature[textfigures]  [onum=yes]
\definefontfeature[texligatures] [tlig=yes]

\starttext
\addff{textfigures} 1234567890

\addff{texligatures} foo---bar
\stoptext
·

With Context as of today and Luatex from minimals, I get lining
figures and a triple dash.

Did I miss something?

Philipp



pgpBsCxgSsChV.pgp
Description: PGP signature
___
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
___

Re: [NTG-context] font features in beta

2012-10-17 Thread Hans Hagen

On 17-10-2012 16:08, Philipp Gesang wrote:

Hi all,

this works in TL but not minimals:

·
\definefontfeature[textfigures]  [onum=yes]
\definefontfeature[texligatures] [tlig=yes]

\starttext
\addff{textfigures} 1234567890

\addff{texligatures} foo---bar
\stoptext
·

With Context as of today and Luatex from minimals, I get lining
figures and a triple dash.

Did I miss something?


just a missing comma in a lua file, i'll upload an update

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


Re: [NTG-context] How to enable tabular numerals with simplefonts and otf?

2012-06-10 Thread Wolfgang Schuster

Am 10.06.2012 um 00:01 schrieb Peter Münster:

 Hi,
 
 How can I enable tabular numerals please?
 
 Test file, that does not work:
 
 --8---cut here---start-8---
 \usemodule[simplefonts]
 \setmainfont[LinLibertineIO][size=10pt, tnum=yes]
 \starttext
 \addff{tnum}
 \setff{tnum}
 565656565656X\par
 X
 \stoptext
 --8---cut here---end---8---

\usemodule[simplefonts]

\definefontfeature[default][default][tnum=yes]

\setmainfont[Linux Libertine O]

\setupbodyfont[10pt]

\starttext
565656565656X\par
X
\stoptext


or


\definefontfeature[default][default][tnum=yes]

\setupbodyfont[libertine,10pt]

\starttext
565656565656X\par
X
\stoptext


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


[NTG-context] How to enable tabular numerals with simplefonts and otf?

2012-06-09 Thread Peter Münster
Hi,

How can I enable tabular numerals please?

Test file, that does not work:

--8---cut here---start-8---
\usemodule[simplefonts]
\setmainfont[LinLibertineIO][size=10pt, tnum=yes]
\starttext
\addff{tnum}
\setff{tnum}
565656565656X\par
X
\stoptext
--8---cut here---end---8---

TIA for any help!
-- 
   Peter
___
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
___


Re: [NTG-context] how to write two or three single hyphens?

2012-05-31 Thread Wolfgang Schuster

Am 31.05.2012 um 11:46 schrieb Jan Pohanka:

 \definehighlight[filepermission][style=\setff{none}]
 
 Great, thank you. Anyway what is the purpose of the \setff macro?

In MkIV you have tell which features of a font (e.g. ligatures or kerning) have 
to enabled, this is done in two steps.

1. You define a list with the features you want, e.g.

 \definefontfeature[myfeatures][liga=yes,kern=yes]

   which activates ligatures and kerning.

2. You apply this list to a font, normally this is done in the typescripts, e.g.

 
\definetypeface[mainface][rm][serif][palatino][default][features=myfeatures]


Sometimes it is necessary to add additional features or to switch a different 
feature list *in* the document. To do this context provides the commands 
\addfontfeature and \setfontfeature which can be also called in the two shorter 
commands \addff and \setff. In the \definehighlight command I enabled the 
predefined “none” list where ligatures and kerning is disabled to prevent that 
-- results in –.

Wolfgang

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


Re: [NTG-context] how to write two or three single hyphens?

2012-05-31 Thread Jan Pohanka

Thank you for the detailed explanation.

best regards
Jan

Dne Thu, 31 May 2012 12:19:38 +0200 Wolfgang Schuster  
schuster.wolfg...@googlemail.com napsal(a):




Am 31.05.2012 um 11:46 schrieb Jan Pohanka:


výřez


Great, thank you. Anyway what is the purpose of the \setff macro?


In MkIV you have tell which features of a font (e.g. ligatures or  
kerning) have to enabled, this is done in two steps.


1. You define a list with the features you want, e.g.

 \definefontfeature[myfeatures][liga=yes,kern=yes]

   which activates ligatures and kerning.

2. You apply this list to a font, normally this is done in the  
typescripts, e.g.


 
\definetypeface[mainface][rm][serif][palatino][default][features=myfeatures]


Sometimes it is necessary to add additional features or to switch a  
different feature list *in* the document. To do this context provides  
the commands \addfontfeature and \setfontfeature which can be also  
called in the two shorter commands \addff and \setff. In the  
\definehighlight command I enabled the predefined “none” list where  
ligatures and kerning is disabled to prevent that -- results in –.


Wolfgang

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



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

Re: [NTG-context] [***SPAM***] Trying to get two styles simultaneiously

2012-04-29 Thread Wolfgang Schuster

Am 27.04.2012 um 15:25 schrieb hwit...@gmail.com:

 
 
 I have been wrestling with this for hours and I'm sure there's a real easy 
 fix.  Just that it's eluding me.
 
 How can I use \definedescription to set a combination style?
 
 e.g. 
 Below I can get a capitalized description header:
 
 \definedescription[rsection][location=left,width=broad,headstyle=cap]
 
 but, I also want it to be bold.  That is a bold+cap at the same time.
 
 I tried \bf\cap  as a headcommand but it didn't seem to work, as was just 
 ignored.

When you use Latin Modern you can never achieve what you want because the font 
doesn’t have a bold caps font but when you use another font like TeX Gyre 
Pagella it’s possible but you need a different approach because smallcaps are a 
font feature which have to enabled.

\definefontfeature[smcp][smcp=yes]

\definedescription
  [description]
  [width=broad,
   headstyle={\bf\addff{smcp}}]

\setupbodyfont[pagella]

\starttext

\input ward

\startdescription{Ward}
\input ward
\stopdescription

\stoptext

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


[NTG-context] Problem with math!

2012-02-25 Thread Verhaag, G.C.H.M.

Hi ConTeXt users,

Currently I'm experiencing problems with inline math mode in combination 
with the addff{oldstyle} command!


The attached test file doens't compile with the latest version 2012.2.18 
(MkIV), which seems to be caused by the introduction of the $\bullet$!


With older versions this worked okay!

Regards,
Gerard Verhaag
\language[nl]

\usetypescript[schola]
\setupbodyfont[schola,10pt]

\definefontfeature [oldstyle] [latn] [onum=yes]

% adding this feature set
\addff{oldstyle}

\starttext
 Math symbols like $\bullet$ NOT working any more from version 2012.2.18!
\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
___

[NTG-context] Keep struggling with old style numerals!

2011-12-08 Thread Verhaag, G.C.H.M.

Hi ConTeXt user's,

A few days ago I installed the latest ConTeXt version but now my 
oldstyle settings don't seem to work any more!


I use the following settings in my preamble:

\usetypescript[schola]
\setupbodyfont[schola,10pt]

\definefontfeature [oldstyle] [default] [onum=yes]
\addff{oldstyle}

Perhaps something changed that I missed! Thanks in advance!

Regards
Gerard Verhaag

P.S. I use ConTeXt  ver: 2011.11.29 23:11 MKIV  fmt: 2011.12.5  int: 
english/english!

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


Re: [NTG-context] Keep struggling with old style numerals!

2011-12-08 Thread Paul Menzel
Dear Gerard,


Am Donnerstag, den 08.12.2011, 10:56 +0100 schrieb Verhaag, G.C.H.M.:

 A few days ago I installed the latest ConTeXt version but now my 
 oldstyle settings don't seem to work any more!

what version did you use before?

 I use the following settings in my preamble:
 
 \usetypescript[schola]
 \setupbodyfont[schola,10pt]
 
 \definefontfeature [oldstyle] [default] [onum=yes]
 \addff{oldstyle}
 
 Perhaps something changed that I missed! Thanks in advance!

Do you get an error message or are the settings just not applied? An
output file from a working ConTeXt version and one from the current one
would be nice too.


Thanks,

Paul


signature.asc
Description: This is a digitally signed message part
___
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
___

Re: [NTG-context] Keep struggling with old style numerals!

2011-12-08 Thread Andreas Harder

On 08.12.2011, at 10:56, Verhaag, G.C.H.M. wrote:

 Hi ConTeXt user's,
 
 A few days ago I installed the latest ConTeXt version but now my oldstyle 
 settings don't seem to work any more!
 
 I use the following settings in my preamble:
 
 \usetypescript[schola]
 \setupbodyfont[schola,10pt]
 
 \definefontfeature [oldstyle] [default] [onum=yes]
 \addff{oldstyle}

Hi,

you can play with my example. It seems script=auto (default) is not that 
robust. Setting it to latn or dflt should help.

\definefontfeature [default] [default] [script=latin]
\definefontfeature [osf]   [onum=yes]
\definefontfeature [oldstyle][default] [onum=yes]

\definealternativestyle [osf] [\addff{osf}] [\addff{osf}]

\setuphead[section][style=osf]

\setupbodyfont[schola]

\starttext
  \section{0123456789 -- ---}
  {\addff{osf}0123456789 -- ---} \par
  {\osf 0123456789 -- ---} \par
  {\setff{oldstyle}0123456789 -- ---} \par
  {\os 0123456789 -- ---}
\stoptext


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


Re: [NTG-context] Keep struggling with old style numerals! SOLVED!

2011-12-08 Thread Verhaag, G.C.H.M.

On 12/08/2011 11:27 AM, Andreas Harder wrote:

On 08.12.2011, at 10:56, Verhaag, G.C.H.M. wrote:

   

Hi ConTeXt user's,

A few days ago I installed the latest ConTeXt version but now my oldstyle 
settings don't seem to work any more!

I use the following settings in my preamble:

\usetypescript[schola]
\setupbodyfont[schola,10pt]

\definefontfeature [oldstyle] [default] [onum=yes]
\addff{oldstyle}
 

Hi,

you can play with my example. It seems script=auto (default) is not that robust. Setting it to 
latn or dflt should help.

\definefontfeature [default] [default] [script=latin]
\definefontfeature [osf]   [onum=yes]
\definefontfeature [oldstyle][default] [onum=yes]

\definealternativestyle [osf] [\addff{osf}] [\addff{osf}]

\setuphead[section][style=osf]

\setupbodyfont[schola]


   


Hi,

Thanks for the tips! I changed [default] into [latn], which brought back 
the oldstyle numerals!


By the way, I think I used a version from last August before upgrading.

Regards,
Gerard Verhaag
___
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
___


Re: [NTG-context] Why does the oldstyle numerals switch, \os, also switch off m-dashes?

2011-11-30 Thread Willi Egger
Hi Pavneet,

I do not know which font/kind of font you intend to use. So provided the font 
is a otf-type the following works:

\setupbodyfont[times,rm,12pt]
\definefontfeature[oldstyle][sript=latin,onum=yes]
\starttext
\addff{oldstyle}
1234567890 A Pause---between yes and no.


1234567890 A Pause---between yes and no.
\stoptext



Willi
On 30 Nov 2011, at 20:19, Pavneet Arora wrote:

 Okay another anomaly:  I used the example in the FAQs to try to set the 
 feature across the entire document, which is really what I want.
 
 http://wiki.contextgarden.net/FAQ#How_can_I_get_the_.E2.80.9Coldstyle_numbers.E2.80.9D_.28text_figures.29_in_a_document.3F
 
 In a manuscript length project, I wouldn't want to get {\os } for each local 
 instance.  Now, what I have noticed was that the small caps switch, \sc, 
 seems to disable old-style numerals.  Is this a typographic convention, i.e., 
 that in a run of small caps one should not revert to old-style numerals?  Is 
 there a way of avoiding this assumption for a larger project?  I sometimes 
 have text set in small caps that as part of a project ID would have some 
 numbers in it.  In that case, I would like the old-style numerals to be used.
 
 I again enclose a small example with output.
 
 advTHANKSance.
 
 On 11-11-30 01:30 AM, Wolfgang Schuster wrote:
 
 Am 30.11.2011 um 02:19 schrieb Pavneet Arora:
 
 I enclose a minimal example as well as the output.  It would seem that the 
 \os causes the m-dash to come out as three hyphens.  Is this the expected 
 behavior?
 
 Write {\os 123…}, context use a special fontfeature set (with the name 
 “just-os”) for old style figure where where kerning, text ligatures etc. are 
 disabled.
 
 Wolfgang
 
 -- 
 -
 - Pavneet Arora
 
 Waroc Fine Audio + Custom Home Cinema
 www.waroc.com  416.937.WAROC (9276)
 
 test.pdftest.tex___
 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
 ___

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


Re: [NTG-context] Fonts in Mk IV -- \definefontalternative documentation?

2011-11-11 Thread Christian
Hello and welcome to the world of ConTeXt!

I was in you place about one year ago :)

The best way to get started with fonts is probably the simplefonts module. I 
haven't used anything since I started and was able to do everything I wished 
for, so far. 

Installation:
Run
first-setup.sh --modules=t-simplefonts
if you use Context standalone (if not, refer to 
http://wiki.contextgarden.net/Modules for installation and download links).

Then this file should get you started:

%%% BEGIN
\usemodule[simplefonts]
\definefontfeature[default][default][mode=node,script=latn,kern=yes,palt=yes,tlig=yes,trep=yes,init=yes,size=yes]
 %some default features
\definefontfeature[frac][default][frac=yes] % opentype 'frac' feature for nice 
fractions
\definefontfeature[sups][default][sups=yes]
\definefontfeature[onum][default][onum=yes] % old-style figures
\definefontfeature[lnum][default][lnum=yes]
\setupsimplefonts[expansion=quality, protrusion=quality] % sort of microtype 
thing. makes things look better =)
\setmainfont[Myriad Pro] % set Myriad as main font
\definesimplefonttypeface[sb][Myriad Pro][regularfont=myriadprosemibold, 
italicfont=myriadprosemiboldit] % define a second font called 'sb' for semibold

\starttext

Test normal\\
{\sb Test semibold}\\
{\sb \it Test semibold}\\
{\bf Test bold}\\

Opentype font feature demonstration:\\
{\addff{onum} 1234} 1234\\
{\addff{frac} 1/17}
\stoptext
%%% END


 Hello, I am coming to ConTeXt from LaTeX and have a typescript question. I
 was searching for information on the mailing list about defining semibold and
 other font variants, and found the following. Can you tell me if further
 information is only available in the book context mkiv -- Fonts or can I 
 find it
 somewhere else? I have searched through the revised Fonts chapter of the
 ConTeXt manual but the \definefontalternative macro and the approach
 described here are not documented there.
 
 The approach below works for me if I adapt it to Adobe Garamond Premier
 Pro, but I am attempting to build a typescript for that handles optical 
 weights,
 small caps, etc and I have not been able to make it work yet.
 
 Before I try posting a minimal example, I would like to be sure that I am
 looking at the right documentation. I have looked at the Fonts in LuaTeX
 page on Contextgarden as well, but I don't think I have a full understanding
 of typescripts using OSFONTDIR fonts yet. If there is something I am missing
 please let me know.
 
 Thanks,
 PPN
 
 
 
 Based on ideas from the forthcoming book context mkiv -- Fonts:
 
 % note: I have deleted all lines except the relevant ones for defining
 % the semi bold alternatives
 
 \definefontalternative [sb]
 \definefontalternative [si]
 
 \definebodyfont [default] [ss]
   [sb=SansSemiBold sa 1,
si=SansSemiBoldItalic sa 1]
 
 \starttypescript [sans] [myriadpro]
\definefontsynonym [MyriadPro-SemiBold]  [name:myriadprosemibold]
\definefontsynonym [MyriadPro-SemiBoldIt][name:myriadprosemiboldit]
 \stoptypescript
 
 \starttypescript [sans] [myriadpro]
\definefontsynonym [SansSemiBold] [MyriadPro-SemiBold]
 [features=default]
\definefontsynonym [SansSemiBoldItalic]   [MyriadPro-SemiBoldIt]
 [features=default]
 \stoptypescript
 
 \starttypescript [myriadpro]
 \definetypeface [myriadpro] [ss] [sans] [myriadpro] [default]
 \stoptypescript
 
 \usetypescript[myriadpro]
 
 \starttext
 
 \switchtobodyfont[myriadpro,ss]
 
 \sb Hello
 \si Italic
 
 \stoptext
 
 
 --
 Peter Park Nelson
 peter.park.nel...@gmail.com


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


Re: [NTG-context] disabling onum in url

2011-10-02 Thread Philipp Gesang
Hi Pablo,

On 2011-10-02 12:58, Pablo Rodríguez wrote:
 Hi there,
 
 I'm a ConTeXt newbie that I have the following options and a command for
 URLs in the document preamble (what comes before \starttext [I don't
 know if it is named so in ConTeXt]):
 
   \definefontfeature[default][default][onum=yes]
   \setupbodyfontenvironment[default][em=italic]
   \setupinteraction[state=start,color=,style=
   em,contrastcolor=,focus=standard]
 
   \def\href#1{\goto{\hyphenatedurl{#1}}[url(#1)]}

·

\definefontfeature[default][default][onum=yes]
\setupbodyfontenvironment[default][em=italic]
\setupinteraction[state=start,color=,style=em,contrastcolor=,focus=standard]

%%% First, define the switch for text figures:
\definefontfeature[url][default][onum=no]

%%% Best use context’s default url commands:
\useURL[aurl][http://www.pragma-ade.com/download-1.htm]

%%% It comes with a proper setup for everything.
\setupurl[style={\tf\addff{url}}]

%%% If you must use the “href” macro, disable the font feature locally.
\define[1]\href{%
  \begingroup
\addff{url}%
\goto{\hyphenatedurl{#1}}[url(#1)]%
  \endgroup%
}

\starttext

42
%%% With the internal command:
\from[aurl]
42
%%% Your way:
\href{0123456789abcdef}
42

\stoptext

·

HTH, Philipp


 
 My question is: how can I disable old style numbers for the \href command?
 
 Thanks for your help,
 
 
 Pablo
 -- 
 http://www.ousia.tk
 ___
 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
 ___

-- 
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments


pgpCYM2U1Y0jr.pgp
Description: PGP signature
___
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
___

Re: [NTG-context] disabling onum in url

2011-10-02 Thread Pablo Rodríguez
On 10/02/2011 06:40 PM, Philipp Gesang wrote:
 Well, in my previous example, rather use:
 
   \definefontfeature[url][onum=no,smcp=yes]
 
 and come back with a complete example if it doesn’t help.

Philipp, I'm afraid it doesn't work. Sample file:

\definefontfeature[default][default][onum=yes]
\setupbodyfontenvironment[default][em=italic]
\setupinteraction[state=start,color=,style=em,contrastcolor=,focus=standard]

%%% First, define the switch for text figures:
\definefontfeature[url][onum=no,smcp=yes]

%%% Best use context’s default url commands:
\useURL[aurl][http://www.pragma-ade.com/download-1.htm]

%%% It comes with a proper setup for everything.
\setupurl[style={\tf\addff{url}}]

%%% If you must use the “href” macro, disable the font feature locally.
\define[1]\href{%
  \begingroup
\addff{url}%
\goto{\hyphenatedurl{#1}}[url(#1)]%
  \endgroup%
}

\starttext

42
%%% With the internal command:
\from[aurl]
42
%%% Your way:
\href{0123456789abcdef}
42

 (Btw, looks like you consider setting the default font style to
 small caps. Is this really what you intended?)

No, I was only checking the “feature”. It seems that if an OT feature is
enabled as default, you cannot disable it for urls (at least, this is
what I get).

 After having to write the second url, I began to think it was
 unnecessarily complex.
 
 Fwiw I think that \useURL fits the context style best as it
 separates the declaration of an element from its use in the
 document.

Sorry, but I'm afraid I don't see your point. Would you think the same
for titles or emphasized text?

Imagine a whole book in one document. If you have more than 100 urls, it
would be inconvenient to have to go to the document preamble and back to
the body text only to add an url.

But I guess it might be a question of habits.

Many thanks for your help again,


Pablo
-- 
http://www.ousia.tk
___
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
___


Re: [NTG-context] disabling onum in url

2011-10-02 Thread Pablo Rodríguez
On 10/02/2011 08:20 PM, Philipp Gesang wrote:
 On 2011-10-02 19:53, Pablo Rodríguez wrote:

 Philipp, I'm afraid it doesn't work. Sample file:
 
 As I thought: the problem is rather with latin modern not having
 small caps as font feature, [...]

Sorry, my own example was misleading (or so it seems to have been).

Wolfgang has found the cause of the problem.

Disabling mall caps when having enabled them for the default didn't work
either with TeX Gyre Pagella, because of using \addff instead of \addfs.

 Imagine a whole book in one document. If you have more than 100 urls, it
 would be inconvenient to have to go to the document preamble and back to
 the body text only to add an url.
 
 In this case, wouldn’t you prefer a bibliography?

It depends on the kind of book you are working on. If the only items of
the bibliography would be urls (no printed stuff), I would avoid using a
bibliography.

One of the most annoying features I found in some academic books (I have
found some in humanities) is having to go back an forth because of the
endnotes using quotations with the author-year system, so you have to
stop reading, go to the endnote page and then to the bibliography page
referring to the cited work.

Because of that, I prefer to give all information on the same page.

Thanks for your help,


Pablo
-- 
http://www.ousia.tk
___
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
___


Re: [NTG-context] itemize textstyle

2011-07-07 Thread Wolfgang Schuster

Am 07.07.2011 um 18:53 schrieb Christian:

 \setupitemize[1][style=\bf\setff{smallcaps}]
 \setupitemize[3][style=\it]
 \setupitemize[4][style=\tfx,color=darkgray]
 
 I already tried the sytle parameter (option?). But it has no effect :(
 Does it work for you?

Wrong key, style is for the symbol/number of the item. A real setup
key for the content isn’t available and the best i can do (without
extra markup around each entry) is the following.

\definefontfeature[smcp][smcp=yes]

\setupitemize[1][command=\bf\addff{smcp}]
\setupitemize[2][command=\tf\subfs{smcp}]
\setupitemize[3][command=\it]
\setupitemize[4][command=\tf\darkgray,color=black]

\setupbodyfont[palatino]

\starttext

\startitemize
\item One
\startitemize
\item Two
\startitemize
\item Three
\startitemize
\item Four
\stopitemize
\stopitemize
\stopitemize
\stopitemize

\stoptext

With some extra markup a better result is possible:

\definefontfeature[smcp][smcp=yes]

\definestartstop[itemzero]   [before=\startitem,after=\stopitem,]
\definestartstop[itemone]  [itemzero][style=\bf\addff{smcp}]
\definestartstop[itemtwo]  [itemzero][style=\tf]
\definestartstop[itemthree][itemzero][style=\it]
\definestartstop[itemfour] [itemzero][style=\tfx,color=darkgray]

\setupbodyfont[palatino]

\starttext

\startitemize
\startitemone One \stopitemone
\startitemize
\startitemtwo Two \stopitemtwo
\startitemize
\startitemthree Three \stopitemthree
\startitemize
\startitemfour Four \stopitemfour
\stopitemize
\stopitemize
\stopitemize
\stopitemize

\stoptext

What you can also do is to ask Hans for style and color keys
to change the layout of the itemize content (would then only
be available when you use \startitem ... \stopitem).

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


Re: [NTG-context] itemize textstyle

2011-07-07 Thread Christian
  \setupitemize[1][style=\bf\setff{smallcaps}]
  \setupitemize[3][style=\it]
  \setupitemize[4][style=\tfx,color=darkgray]
 
  I already tried the sytle parameter (option?). But it has no effect
  :( Does it work for you?
 
 Wrong key, style is for the symbol/number of the item. A real setup key
for
 the content isn't available and the best i can do (without extra markup
 around each entry) is the following.
 
 \definefontfeature[smcp][smcp=yes]
 
 \setupitemize[1][command=\bf\addff{smcp}]
 \setupitemize[2][command=\tf\subfs{smcp}]
 \setupitemize[3][command=\it]
 \setupitemize[4][command=\tf\darkgray,color=black]
 
 \setupbodyfont[palatino]
 
 \starttext
 
 \startitemize
 \item One
   \startitemize
   \item Two
   \startitemize
   \item Three
   \startitemize
   \item Four
   \stopitemize
   \stopitemize
   \stopitemize
 \stopitemize
 
 \stoptext
 
 With some extra markup a better result is possible:
 
 \definefontfeature[smcp][smcp=yes]
 
 \definestartstop[itemzero]   [before=\startitem,after=\stopitem,]
 \definestartstop[itemone]  [itemzero][style=\bf\addff{smcp}]
 \definestartstop[itemtwo]  [itemzero][style=\tf]
 \definestartstop[itemthree][itemzero][style=\it]
 \definestartstop[itemfour] [itemzero][style=\tfx,color=darkgray]
 
 \setupbodyfont[palatino]
 
 \starttext
 
 \startitemize
 \startitemone One \stopitemone
   \startitemize
   \startitemtwo Two \stopitemtwo
   \startitemize
   \startitemthree Three \stopitemthree
   \startitemize
   \startitemfour Four \stopitemfour
   \stopitemize
   \stopitemize
   \stopitemize
 \stopitemize
 
 \stoptext
 
 What you can also do is to ask Hans for style and color keys to change the
 layout of the itemize content (would then only be available when you use
 \startitem ... \stopitem).

Thank you very much for this example!
This is already more than enough for a starting point. I guess the style and
color keys for items might be an idea to hold on to. But at the moment I
neither do want to push this, nor is there the urgent need because of your
code. Also, there is surely enough work to do with more important stuff ;)
Thanks again!

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


Re: [NTG-context] First Line After Whitespace Styling

2011-05-27 Thread Wolfgang Schuster

Am 27.05.2011 um 21:08 schrieb Marc Trius:

 No, what is something like:
 
 ...
 
 \starttypescript  [Standard]
  \definetypeface [Standard] [rm] [serif] [frankruehl]   [default] 
 [features=default]
  \definetypeface [Alt][rm] [serif] [frankruehl] [default] 
 [features=alt]
  \stoptypescript
 
 ...
 
 {\Alt This is the first line after a whitespace, this is the linebreak} and 
 this is the rest of the paragraph. I'd like to have a macro that 
 automatically styles the first line only so I don't have to guess at 
 linebreaks every time I edit the text.
 
 I need to do this because in texts that are written with the Hebrew alphabet, 
 a shorter glyph of the tallest letter, 'lamed,' is used inside a block of 
 text than in a first line, so that the interline space can be smaller. 
 Employing this technique makes the difference between a pretty good and a 
 really first-rate typesetting job :)

Adapt the following to your case:

\setupbodyfont[pagella]

\definefontfeature[allcaps][smcp=yes,c2sc=yes]

\starttext

\TreatFirstLine {\addff{allcaps}} {} {} {}
The Earth, as a habitat for animal life, is in old age and has a fatal illness. 
Several, in fact. It would be happening whether humans had ever evolved or not. 
But our presence is like the effect of an old-age patient who smokes many packs 
of cigarettes per day — and we humans are the cigarettes.

\stoptext

Wolfgang

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


Re: [NTG-context] First Line After Whitespace Styling

2011-05-27 Thread Marc Trius
On Fri, 27 May 2011 21:19:29 +0200
Wolfgang Schuster schuster.wolfg...@googlemail.com wrote:

 
 Am 27.05.2011 um 21:08 schrieb Marc Trius:
 
  No, what is something like:
  
  ...
  
  \starttypescript  [Standard]
   \definetypeface [Standard] [rm] [serif] [frankruehl]   [default] 
  [features=default]
   \definetypeface [Alt][rm] [serif] [frankruehl] [default] 
  [features=alt]
   \stoptypescript
  
  ...
  
  {\Alt This is the first line after a whitespace, this is the linebreak} and 
  this is the rest of the paragraph. I'd like to have a macro that 
  automatically styles the first line only so I don't have to guess at 
  linebreaks every time I edit the text.
  
  I need to do this because in texts that are written with the Hebrew 
  alphabet, a shorter glyph of the tallest letter, 'lamed,' is used inside a 
  block of text than in a first line, so that the interline space can be 
  smaller. Employing this technique makes the difference between a pretty 
  good and a really first-rate typesetting job :)
 
 Adapt the following to your case:
 
 \setupbodyfont[pagella]
 
 \definefontfeature[allcaps][smcp=yes,c2sc=yes]
 
 \starttext
 
 \TreatFirstLine {\addff{allcaps}} {} {} {}
 The Earth, as a habitat for animal life, is in old age and has a fatal 
 illness. Several, in fact. It would be happening whether humans had ever 
 evolved or not. But our presence is like the effect of an old-age patient who 
 smokes many packs of cigarettes per day — and we humans are the cigarettes.
 
 \stoptext
 
 Wolfgang
 

This works perfectly! Also, the \addff is going to make my life much easier. 
Thank you very much.

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


-- 
Marc Trius derpay...@riseup.net

The enemy is the gramophone mind, whether or not one agrees with the record 
that is being played at the moment. --- George Orwell
___
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
___

Re: [NTG-context] How to set oldstyle numbering globally?

2011-04-13 Thread Taco Hoekwater


On 13 apr. 2011, at 00:07, Pontus Lurcock p...@talvi.net wrote:

 On Mon 11 Apr 2011, Khaled Hosny wrote:
 
 ... 
 (\addff is meant for temporally applying font features not the other way
 around, but I think it should work this way too, so may be something
 is broken)
 
 \addff{oldstyle} works with my 2011.02.25 ConTeXt, so evidently it's
 quite a recent change.
 
\addff is for adding some feature to an already selected font. It fails in the 
latest beta's because fonts are no longer preloaded immediately, but only after 
\starttext (which is a good thing)

Best wishes,
Taco___
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
___

Re: [NTG-context] How to set oldstyle numbering globally?

2011-04-13 Thread Verhaag, G.C.H.M.

On 04/13/2011 08:27 AM, Taco Hoekwater wrote:



On 13 apr. 2011, at 00:07, Pontus Lurcock p...@talvi.net 
mailto:p...@talvi.net wrote:



On Mon 11 Apr 2011, Khaled Hosny wrote:

...

(\addff is meant for temporally applying font features not the other way
around, but I think it should work this way too, so may be something
is broken)


\addff{oldstyle} works with my 2011.02.25 ConTeXt, so evidently it's
quite a recent change.

\addff is for adding some feature to an already selected font. It 
fails in the latest beta's because fonts are no longer preloaded 
immediately, but only after \starttext (which is a good thing)


Best wishes,
Taco

   

Hi,

Taco, thanks for the explanation!

So, this makes the item called: How can I get the “oldstyle numbers” 
(text figures) in a document? on wiki.contextgarden.net no longer 
valid, right!


Changes are difficult to figure out, when you're not very good at the 
details. Keeping the wiki up-to-date is a huge task and certainly not a 
trivial thing!


Please don't misunderstand me. I don't want to criticise the way the 
wiki is maintained. On the contrary, it's a great tool, and we users 
very much depend on it.


However for getting the oldstyle numerals working again, I needed this 
mailing list!


If I'm wrong please feel free to comment on all this. Thanks again!

Regards,
Gerard Verhaag


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

Re: [NTG-context] How to set oldstyle numbering globally?

2011-04-12 Thread Verhaag, G.C.H.M.

On 04/11/2011 11:09 AM, Wolfgang Schuster wrote:

Am 11.04.2011 um 11:00 schrieb Verhaag, G.C.H.M.:

   

Hi,

In my earlier MkIV minimal ConTeXt installation (dec.2010) I used the following 
in my preamble to activate oldstyle numbering:

\usetypescript[schola]
\setupbodyfont[schola,8pt]

\definefontfeature [oldstyle] [default] [onum=yes]
\addff{oldstyle}

but this doesn't seem to work anymore in my recently installed minimal ConTeXt 
installation (ConTeXt  ver: 2011.03.30 11:21 MkIV  fmt: 2011.3.30  int: 
english/english).

I use this installation with Debian 6.0 (Squeeze).

Any idea what's wrong?
 

The following two methods do work for me.


1. Global change

\definefontfeature[default][default][onum=yes]

\setupbodyfont[schola,8pt]

\starttext
1234567890
\stoptext


2. Local change

\setupbodyfont[schola,8pt]

\definefontfeature[oldstyle][onum=yes]

\starttext
1234567890 {\addff{oldstyle}1234567890}
\stoptext


Wolfgang

___
.
   

Hi,

The suggested ways both work for me as well! So, I'm afraid that I don't 
understand the definefontfeature command very well.


Perhaps I should read the chapter on fonts more thorougly! Thanks to all 
contributers to this thread.


Regards,
Gerard Verhaag
___
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
___


Re: [NTG-context] How to set oldstyle numbering globally?

2011-04-12 Thread Pontus Lurcock
On Mon 11 Apr 2011, Khaled Hosny wrote:

  In my earlier MkIV minimal ConTeXt installation (dec.2010) I used
  the following in my preamble to activate oldstyle numbering:
  
  \usetypescript[schola]
  \setupbodyfont[schola,8pt]
  
  \definefontfeature [oldstyle] [default] [onum=yes]
  \addff{oldstyle}
 
 A more correct way is:
 
 \definefontfeature[default][default][onum=yes] % redefines default feature set
 
 \usetypescript[schola]
 \setupbodyfont[schola,8pt]
... 
 (\addff is meant for temporally applying font features not the other way
 around, but I think it should work this way too, so may be something
 is broken)

\addff{oldstyle} works with my 2011.02.25 ConTeXt, so evidently it's
quite a recent change.

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


[NTG-context] How to set oldstyle numbering globally?

2011-04-11 Thread Verhaag, G.C.H.M.

Hi,

In my earlier MkIV minimal ConTeXt installation (dec.2010) I used the 
following in my preamble to activate oldstyle numbering:


\usetypescript[schola]
\setupbodyfont[schola,8pt]

\definefontfeature [oldstyle] [default] [onum=yes]
\addff{oldstyle}

but this doesn't seem to work anymore in my recently installed minimal 
ConTeXt installation (ConTeXt  ver: 2011.03.30 11:21 MkIV  fmt: 
2011.3.30  int: english/english).


I use this installation with Debian 6.0 (Squeeze).

Any idea what's wrong?

Regards,
Gerard Verhaag

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


Re: [NTG-context] How to set oldstyle numbering globally?

2011-04-11 Thread Wolfgang Schuster

Am 11.04.2011 um 11:00 schrieb Verhaag, G.C.H.M.:

 Hi,
 
 In my earlier MkIV minimal ConTeXt installation (dec.2010) I used the 
 following in my preamble to activate oldstyle numbering:
 
 \usetypescript[schola]
 \setupbodyfont[schola,8pt]
 
 \definefontfeature [oldstyle] [default] [onum=yes]
 \addff{oldstyle}
 
 but this doesn't seem to work anymore in my recently installed minimal 
 ConTeXt installation (ConTeXt  ver: 2011.03.30 11:21 MkIV  fmt: 2011.3.30  
 int: english/english).
 
 I use this installation with Debian 6.0 (Squeeze).
 
 Any idea what's wrong?

The following two methods do work for me.


1. Global change

\definefontfeature[default][default][onum=yes]

\setupbodyfont[schola,8pt]

\starttext
1234567890
\stoptext


2. Local change

\setupbodyfont[schola,8pt]

\definefontfeature[oldstyle][onum=yes]

\starttext
1234567890 {\addff{oldstyle}1234567890}
\stoptext


Wolfgang

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


Re: [NTG-context] How to set oldstyle numbering globally?

2011-04-11 Thread Khaled Hosny
On Mon, Apr 11, 2011 at 11:00:08AM +0200, Verhaag, G.C.H.M. wrote:
 Hi,
 
 In my earlier MkIV minimal ConTeXt installation (dec.2010) I used
 the following in my preamble to activate oldstyle numbering:
 
 \usetypescript[schola]
 \setupbodyfont[schola,8pt]
 
 \definefontfeature [oldstyle] [default] [onum=yes]
 \addff{oldstyle}

A more correct way is:

\definefontfeature[default][default][onum=yes] % redefines default feature set

\usetypescript[schola]
\setupbodyfont[schola,8pt]

\starttext
12345678
\stoptext

(\addff is meant for temporally applying font features not the other way
around, but I think it should work this way too, so may be something
is broken)

Regards,
 Khaled

-- 
 Khaled Hosny
 Egyptian
 Arab
___
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
___


Re: [NTG-context] Small capitals broken in latest beta?

2011-04-04 Thread Bernhard Rosensteiner
thanks, Wolfgang.
@ C.: Wolfgang posted the solution already.

best regards
Bernhard

lg
Bernhard

On Sonntag, 03. April 2011 at 19:02, C. wrote: 
 Would you mind telling me how you fixed it? (even if your fix does not apply 
 here)
 
  -Ursprüngliche Nachricht-
  Von: Bernhard Rosensteiner [mailto:brosenstei...@gmail.com]
  Gesendet: Sonntag, 3. April 2011 18:31
  An: mailing list for ConTeXt users
  Betreff: Re: [NTG-context] Small capitals broken in latest beta?
  
  Hi all,
  
  sorry for the noise, indeed cmr have no smallcaps, but initially i used a 
  adobe
  font for testing and here it didn´t work. It seems oldstyle and smallcaps
  fontfeature is not defined in the source anymore, so i had to define it 
  myself
  and now all is ok.
  
  best regards
  Bernhard
  
  lg
  Bernhard
  
  
  
  On Sonntag, 03. April 2011 at 15:35, C. wrote:
  
  
   Wolfgang, your solution works for the small caps, even without
  defining the font feature. I guess it's because \sc is a standard (la)tex 
  style
  switch like \it.
  
   BUT:
   Defining (or at least using) the other font feature (c2sc) does not
  work, and since (to my knowledge) there is no style like \sc for that in 
  tex,
   we have to define it using the font feature.
   If , like Bernhard wrote, \addff is broken, that would affect also
  features like 'sups', 'dlig' and so on.
  
  
  
  
  
   -Ursprüngliche Nachricht-
   Von: Bernhard Rosensteiner
  [mailto:brosenstei...@gmail.com]
   Gesendet: Sonntag, 3. April 2011 09:41
   An: mailing list for ConTeXt users
   Betreff: Re: [NTG-context] Small capitals broken in latest
  beta?
  
   Hello all,
  
  
   i don´t use simplefonts but something is not working (see
  attachment).
   Before the latest beta the commads \addff and \addfs
  worked.
  
   best regards
   Bernhard
  
  
  
   On Samstag, 02. April 2011 at 08:09, Wolfgang Schuster wrote:
  
  
  
   Am 02.04.2011 um 00:40 schrieb C.:
  
  
  
   Hello,
   could it be that in the latest beta (ConTeXt ver: 2011.03.30
   11:21 MKIV)
   the font feature 'small capitals' is broken?
  
  
  
   It works but you need “script=latn”.
  
   \usemodule[simplefonts]
  
   \setmainfont[Minion
   Pro][expansion=quality,protrusion=quality,script=latn]
  
   \starttext
   {\sc Smallcaps}
   \stoptext
  
   Wolfgang
  
  
   
   ___
   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
  
   
   ___
  
  
  
  
   
  ___
   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
   
  ___
 
 
 ___
 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
 ___
 
___
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
___

Re: [NTG-context] Small capitals broken in latest beta?

2011-04-04 Thread C.
 In MKII \sc switch to a different font but MKIV can just enable the smcp
 feature.
 
 Adding smcp=yes doesn't work as option for \setmainfont because you
 can use \definfontfeature and overload the default set, the only valid
 options from \definefontfeature are script, expansion and
protrusion.

[I'm using MKiV.]
Ok, let's leave the small capitals with \sc  alone, they work when I specify
script=latin in setmainfont.
Now, how would I activate the feature c2sc (small capitals from capitals)?
It worked like this in the past, but does not anymore:

\usemodule[simplefonts]
\definefontfeature[c2sc][default][c2sc=yes]
\setmainfont[Minion Pro][expansion=quality, protrusion=quality,
script=latin]
\starttext
{\addff{c2sc} THIS TEXT SHOULD BE CONVERTED TO SMALL CAPS.} % does not
result in small caps, what's wrong???
 Compare: {\sc small caps} % does give small caps (therefore, not part of my
question)
\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
___


Re: [NTG-context] Small capitals broken in latest beta?

2011-04-03 Thread C.
Wolfgang, your solution works for the small caps, even without defining the 
font feature. I guess it's because \sc is a standard (la)tex style switch like 
\it.

BUT:
Defining (or at least using) the other font feature (c2sc) does not work, and 
since (to my knowledge) there is no style like \sc for that in tex,
we have to define it using the font feature.
If , like Bernhard wrote, \addff is broken, that would affect also features 
like 'sups', 'dlig' and so on.



 -Ursprüngliche Nachricht-
 Von: Bernhard Rosensteiner [mailto:brosenstei...@gmail.com]
 Gesendet: Sonntag, 3. April 2011 09:41
 An: mailing list for ConTeXt users
 Betreff: Re: [NTG-context] Small capitals broken in latest beta?
 
 Hello all,
 
 
 i don´t use simplefonts but something is not working (see attachment).
 Before the latest beta the commads \addff and \addfs worked.
 
 best regards
 Bernhard
 
 
 
 On Samstag, 02. April 2011 at 08:09, Wolfgang Schuster wrote:
 
 
 
   Am 02.04.2011 um 00:40 schrieb C.:
 
 
 
   Hello,
   could it be that in the latest beta (ConTeXt ver: 2011.03.30
 11:21 MKIV)
   the font feature 'small capitals' is broken?
 
 
 
   It works but you need “script=latn”.
 
   \usemodule[simplefonts]
 
   \setmainfont[Minion
 Pro][expansion=quality,protrusion=quality,script=latn]
 
   \starttext
   {\sc Smallcaps}
   \stoptext
 
   Wolfgang
 
   
 ___
   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
   
 ___
 
 


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

Re: [NTG-context] Small capitals broken in latest beta?

2011-04-03 Thread Bernhard Rosensteiner
Hi all,

sorry for the noise, indeed cmr have no smallcaps, but initially i used a adobe 
font for testing and here it didn´t work. It seems oldstyle and smallcaps 
fontfeature is not defined in the source anymore, so i had to define it myself 
and now all is ok.

best regards
Bernhard

lg
Bernhard

On Sonntag, 03. April 2011 at 15:35, C. wrote: 
 Wolfgang, your solution works for the small caps, even without defining the 
 font feature. I guess it's because \sc is a standard (la)tex style switch 
 like \it.
 
 BUT:
 Defining (or at least using) the other font feature (c2sc) does not work, and 
 since (to my knowledge) there is no style like \sc for that in tex,
 we have to define it using the font feature.
 If , like Bernhard wrote, \addff is broken, that would affect also features 
 like 'sups', 'dlig' and so on.
 
 
 
  -Ursprüngliche Nachricht-
  Von: Bernhard Rosensteiner [mailto:brosenstei...@gmail.com]
  Gesendet: Sonntag, 3. April 2011 09:41
  An: mailing list for ConTeXt users
  Betreff: Re: [NTG-context] Small capitals broken in latest beta?
  
  Hello all,
  
  
  i don´t use simplefonts but something is not working (see attachment).
  Before the latest beta the commads \addff and \addfs worked.
  
  best regards
  Bernhard
  
  
  
  On Samstag, 02. April 2011 at 08:09, Wolfgang Schuster wrote:
  
  
  
   Am 02.04.2011 um 00:40 schrieb C.:
  
  
  
   Hello,
   could it be that in the latest beta (ConTeXt ver: 2011.03.30
  11:21 MKIV)
   the font feature 'small capitals' is broken?
  
  
  
   It works but you need “script=latn”.
  
   \usemodule[simplefonts]
  
   \setmainfont[Minion
  Pro][expansion=quality,protrusion=quality,script=latn]
  
   \starttext
   {\sc Smallcaps}
   \stoptext
  
   Wolfgang
  
   
  ___
   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
   
  ___
 
 
 ___
 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
 ___
 
___
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
___

  1   2   >