ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* font features
@ 2022-11-03 11:37 Thomas A. Schmitz via ntg-context
  2022-11-03 11:52 ` Herbert Voss via ntg-context
  2022-11-03 12:20 ` Henning Hraban Ramm via ntg-context
  0 siblings, 2 replies; 16+ messages in thread
From: Thomas A. Schmitz via ntg-context @ 2022-11-03 11:37 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Thomas A. Schmitz

Hi,

is there an easy way to get a list of all features that a font has and 
typeset a sample text to see the result of every single feature? There 
probably is, but I couldn't find anything...

All best

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

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: font features
  2022-11-03 11:37 font features Thomas A. Schmitz via ntg-context
@ 2022-11-03 11:52 ` Herbert Voss via ntg-context
  2022-11-03 12:19   ` Thomas A. Schmitz via ntg-context
  2022-11-03 17:57   ` Hans Hagen via ntg-context
  2022-11-03 12:20 ` Henning Hraban Ramm via ntg-context
  1 sibling, 2 replies; 16+ messages in thread
From: Herbert Voss via ntg-context @ 2022-11-03 11:52 UTC (permalink / raw)
  To: ntg-context; +Cc: Herbert Voss



Am 03.11.22 um 12:37 schrieb Thomas A. Schmitz via ntg-context:
> Hi,
>
> is there an easy way to get a list of all features that a font has and 
> typeset a sample text to see the result of every single feature? There 
> probably is, but I couldn't find anything...

You'll get only the features with otfinfo in the terminal. For example:

iMac:~ voss$ otfinfo -f `kpsewhich LibertinusSerif-Regular.otf`
c2sc    Small Capitals From Capitals
calt    Contextual Alternates
case    Case-Sensitive Forms
ccmp    Glyph Composition/Decomposition
cpsp    Capital Spacing
dlig    Discretionary Ligatures
frac    Fractions
hlig    Historical Ligatures
kern    Kerning
liga    Standard Ligatures
lnum    Lining Figures
mark    Mark Positioning
mkmk    Mark to Mark Positioning
onum    Oldstyle Figures
pnum    Proportional Figures
salt    Stylistic Alternates
smcp    Small Capitals
ss01    Stylistic Set 1
ss02    Stylistic Set 2
ss03    Stylistic Set 3
ss04    Stylistic Set 4
ss05    Stylistic Set 5
ss06    Stylistic Set 6
ss07    Stylistic Set 7
subs    Subscript
sups    Superscript
tnum    Tabular Figures
zero    Slashed Zero


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

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: font features
  2022-11-03 11:52 ` Herbert Voss via ntg-context
@ 2022-11-03 12:19   ` Thomas A. Schmitz via ntg-context
  2022-11-03 17:57   ` Hans Hagen via ntg-context
  1 sibling, 0 replies; 16+ messages in thread
From: Thomas A. Schmitz via ntg-context @ 2022-11-03 12:19 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Thomas A. Schmitz

On 11/3/22 12:52, Herbert Voss via ntg-context wrote:
> You'll get only the features with otfinfo in the terminal. For example:

Thank you, I was aware of that. But that's only the first step: you 
still have to use this list to define ConTeXt featuresets and then 
typeset. I was trying to build a cld document that automates this 
process, but can't get it to work. And I suspect that somewhere in the 
distribution, there is already a module that does exactly that.

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

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: font features
  2022-11-03 11:37 font features Thomas A. Schmitz via ntg-context
  2022-11-03 11:52 ` Herbert Voss via ntg-context
@ 2022-11-03 12:20 ` Henning Hraban Ramm via ntg-context
  2022-11-03 12:27   ` Henning Hraban Ramm via ntg-context
  1 sibling, 1 reply; 16+ messages in thread
From: Henning Hraban Ramm via ntg-context @ 2022-11-03 12:20 UTC (permalink / raw)
  To: ntg-context; +Cc: Henning Hraban Ramm

Am 03.11.22 um 12:37 schrieb Thomas A. Schmitz via ntg-context:
> Hi,
> 
> is there an easy way to get a list of all features that a font has and 
> typeset a sample text to see the result of every single feature? There 
> probably is, but I couldn't find anything...

You get a lot of information with
mtxrun --script fonts --info <fontname>
but no samples.

You can also get font information via
mtxrun --script server --start
and then open the given address in your browser; AFAIR you get samples, 
but it doesn’t work for me ATM, because the server script is not found 
in the current directory (might be a misconfiguration on my side).

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

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

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: font features
  2022-11-03 12:20 ` Henning Hraban Ramm via ntg-context
@ 2022-11-03 12:27   ` Henning Hraban Ramm via ntg-context
  2022-11-03 13:03     ` Thomas A. Schmitz via ntg-context
  0 siblings, 1 reply; 16+ messages in thread
From: Henning Hraban Ramm via ntg-context @ 2022-11-03 12:27 UTC (permalink / raw)
  To: ntg-context; +Cc: Henning Hraban Ramm

Am 03.11.22 um 13:20 schrieb Henning Hraban Ramm via ntg-context:
> Am 03.11.22 um 12:37 schrieb Thomas A. Schmitz via ntg-context:

> You can also get font information via
> mtxrun --script server --start
> and then open the given address in your browser; AFAIR you get samples, 
> but it doesn’t work for me ATM, because the server script is not found 
> in the current directory (might be a misconfiguration on my side).

If you cd to .../tex/texmf-context/scripts/context/lua,
start
mtxrun --script server --start
then open
http://localhost:8088/mtx-server-ctx-fonttest.lua

You should be able to check font samples with different features enabled.

But I get another 404 on /mtx-server-ctx-fonttest-temp-02.pdf

If it works for you, then it’s a problem of my installation, otherwise a 
regression in current LMTX...

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

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

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: font features
  2022-11-03 12:27   ` Henning Hraban Ramm via ntg-context
@ 2022-11-03 13:03     ` Thomas A. Schmitz via ntg-context
  2022-11-03 18:24       ` Hans Hagen via ntg-context
  0 siblings, 1 reply; 16+ messages in thread
From: Thomas A. Schmitz via ntg-context @ 2022-11-03 13:03 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Thomas A. Schmitz

On 11/3/22 13:27, Henning Hraban Ramm via ntg-context wrote:
> If it works for you, then it’s a problem of my installation, otherwise a 
> regression in current LMTX...

No, I get the same error message, this looks promising but doesn't work.

And at the risk of sounding grumpy, but all of this is too much manual 
intervention; I would like to have a completely automated script. So 
I'll show what I have and add a few comments:

local Feature_Table = { }
local Parsed_Features = { }

local My_Font = environment.arguments["font"]

local Font_Features = os.resultof("otfinfo -f " .. My_Font)

for Feature_Sigla, Feature_Name in
   string.gmatch(Font_Features, "(%S-)\t(.-)\n") do
   Feature_Table[Feature_Sigla] = Feature_Name
end

COMMENTS

Expectation: this should return a list of all features and their 
descriptions as a lua table. If you run the file as

context test.cld --font="/path/to/font"

this works, and you get a table

Feature_Table={
  ["aalt"]="Access All Alternates",
  ["c2sc"]="Small Capitals From Capitals"} etc.

CODE

for name, _ in pairs(Feature_Table) do
   Context_Name = "f:" .. name
   Parsed_Features[name] = Context_Name
   context.definefontfeature( { Context_Name }, { name="yes" } )
end

COMMENTS

This should produce a lua table with ConTeXt fontfeatures and define 
those features. The table appears to be correct:

Parsed_Features={
  ["aalt"]="f:aalt",
  ["c2sc"]="f:c2sc"} etc.

So I expected that this should be equivalent to

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

and return a list of defined features.

CODE

local Test_String = [[
ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 1234567890 1/4 2/8 
3/9 ffi ft fi fl ffl
]]

local Font_Name =  os.resultof("otfinfo -a " .. My_Font)

context.definefontfamily( { "Test" }, { "serif" }, { Font_Name }, {} )

context.setupbodyfont{ "Test, 12pt" }

COMMENTS

Again, this works; the font is set as bodyfont.

CODE

context.starttext()

for name, feature in pairs(Feature_Table) do
   context.start ()
   context.addfeature { Parsed_Features[name] }
   context.midaligned (feature)
   context.bold (Parsed_Features[name])
   context.par ()
   context.blank{ "medium" }
   context(Test_String)
   context.par ()
   context.stop ()
end

context.stoptext()

COMMENTS

And this doesn't work: the names are picked up, but the font features 
are not defined; the sample text does not reflect any features. So this 
is what I've got... maybe one of the wizards can help.

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

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: font features
  2022-11-03 11:52 ` Herbert Voss via ntg-context
  2022-11-03 12:19   ` Thomas A. Schmitz via ntg-context
@ 2022-11-03 17:57   ` Hans Hagen via ntg-context
  1 sibling, 0 replies; 16+ messages in thread
From: Hans Hagen via ntg-context @ 2022-11-03 17:57 UTC (permalink / raw)
  To: ntg-context; +Cc: Hans Hagen

On 11/3/2022 12:52 PM, Herbert Voss via ntg-context wrote:
> 
> 
> Am 03.11.22 um 12:37 schrieb Thomas A. Schmitz via ntg-context:
>> Hi,
>>
>> is there an easy way to get a list of all features that a font has and 
>> typeset a sample text to see the result of every single feature? There 
>> probably is, but I couldn't find anything...
> 
> You'll get only the features with otfinfo in the terminal. For example:
> 
> iMac:~ voss$ otfinfo -f `kpsewhich LibertinusSerif-Regular.otf`
> c2sc    Small Capitals From Capitals
> calt    Contextual Alternates
> case    Case-Sensitive Forms
> ccmp    Glyph Composition/Decomposition
> cpsp    Capital Spacing
> dlig    Discretionary Ligatures
> frac    Fractions
> hlig    Historical Ligatures
> kern    Kerning
> liga    Standard Ligatures
> lnum    Lining Figures
> mark    Mark Positioning
> mkmk    Mark to Mark Positioning
> onum    Oldstyle Figures
> pnum    Proportional Figures
> salt    Stylistic Alternates
> smcp    Small Capitals
> ss01    Stylistic Set 1
> ss02    Stylistic Set 2
> ss03    Stylistic Set 3
> ss04    Stylistic Set 4
> ss05    Stylistic Set 5
> ss06    Stylistic Set 6
> ss07    Stylistic Set 7
> subs    Subscript
> sups    Superscript
> tnum    Tabular Figures
> zero    Slashed Zero

mtxrun --script fonts --list --info --file LibertinusSerif-Regular.otf

mtx-fonts       |
mtx-fonts       | mapping   : 1
mtx-fonts       | fontname  : libertinusserifregular
mtx-fonts       | fullname  : libertinusserifregular
mtx-fonts       | filename  : LibertinusSerif-Regular.otf
mtx-fonts       | family    : libertinusserif
mtx-fonts       | weight    : normal
mtx-fonts       | style     : normal
mtx-fonts       | width     : normal
mtx-fonts       | variant   : normal
mtx-fonts       | fweight   : conflict: regular
mtx-fonts       |
mtx-fonts       | gpos features:
mtx-fonts       |
mtx-fonts       |   feature  script   languages
mtx-fonts       |
mtx-fonts       |   cpsp     cyrl     dflt
mtx-fonts       |            dflt     dflt
mtx-fonts       |            grek     dflt
mtx-fonts       |            latn     dflt
mtx-fonts       |   kern     cyrl     dflt
mtx-fonts       |            dflt     dflt
mtx-fonts       |            grek     dflt
mtx-fonts       |            latn     dflt
mtx-fonts       |   mark     cyrl     dflt
mtx-fonts       |            dflt     dflt
mtx-fonts       |            grek     dflt
mtx-fonts       |            hebr     dflt
mtx-fonts       |            latn     dflt
mtx-fonts       |   mkmk     cyrl     dflt
mtx-fonts       |            dflt     dflt
mtx-fonts       |            grek     dflt
mtx-fonts       |            hebr     dflt
mtx-fonts       |            latn     dflt
mtx-fonts       |
mtx-fonts       | gsub features:
mtx-fonts       |
mtx-fonts       |   feature  script   languages
mtx-fonts       |
mtx-fonts       |   c2sc     cyrl     dflt mkd srb
mtx-fonts       |            dflt     dflt
mtx-fonts       |            grek     dflt
mtx-fonts       |            hebr     dflt
mtx-fonts       |            latn     aze crt dflt fin ism kaz lsm nor 
nsm sks ssm sve tat trk
mtx-fonts       |   calt     cyrl     dflt mkd srb
mtx-fonts       |            dflt     dflt
mtx-fonts       |            grek     dflt
mtx-fonts       |            hebr     dflt
mtx-fonts       |            latn     aze crt dflt fin ism kaz lsm nor 
nsm sks ssm sve tat trk
mtx-fonts       |   case     cyrl     dflt mkd srb
mtx-fonts       |            dflt     dflt
mtx-fonts       |            grek     dflt
mtx-fonts       |            hebr     dflt
mtx-fonts       |            latn     aze crt dflt fin ism kaz lsm nor 
nsm sks ssm sve tat trk
mtx-fonts       |   ccmp     cyrl     dflt mkd srb
mtx-fonts       |            dflt     dflt
mtx-fonts       |            grek     dflt
mtx-fonts       |            hebr     dflt
mtx-fonts       |            latn     aze crt dflt fin ism kaz lsm nor 
nsm sks ssm sve tat trk
mtx-fonts       |   dlig     cyrl     dflt mkd srb
mtx-fonts       |            dflt     dflt
mtx-fonts       |            grek     dflt
mtx-fonts       |            hebr     dflt
mtx-fonts       |            latn     aze crt dflt fin ism kaz lsm nor 
nsm sks ssm sve tat trk
mtx-fonts       |   frac     cyrl     dflt mkd srb
mtx-fonts       |            dflt     dflt
mtx-fonts       |            grek     dflt
mtx-fonts       |            hebr     dflt
mtx-fonts       |            latn     aze crt dflt fin ism kaz lsm nor 
nsm sks ssm sve tat trk
mtx-fonts       |   hlig     cyrl     dflt mkd srb
mtx-fonts       |            dflt     dflt
mtx-fonts       |            grek     dflt
mtx-fonts       |            hebr     dflt
mtx-fonts       |            latn     aze crt dflt fin ism kaz lsm nor 
nsm sks ssm sve tat trk
mtx-fonts       |   liga     cyrl     dflt mkd srb
mtx-fonts       |            dflt     dflt
mtx-fonts       |            grek     dflt
mtx-fonts       |            hebr     dflt
mtx-fonts       |            latn     aze crt dflt fin ism kaz lsm nor 
nsm sks ssm sve tat trk
mtx-fonts       |   lnum     cyrl     dflt mkd srb
mtx-fonts       |            dflt     dflt
mtx-fonts       |            grek     dflt
mtx-fonts       |            hebr     dflt
mtx-fonts       |            latn     aze crt dflt fin ism kaz lsm nor 
nsm sks ssm sve tat trk
mtx-fonts       |   locl     cyrl     mkd srb
mtx-fonts       |            latn     aze crt fin ism kaz lsm nor nsm 
sks ssm sve tat trk
mtx-fonts       |   mark     cyrl     dflt mkd srb
mtx-fonts       |            dflt     dflt
mtx-fonts       |            grek     dflt
mtx-fonts       |            hebr     dflt
mtx-fonts       |            latn     aze crt dflt fin ism kaz lsm nor 
nsm sks ssm sve tat trk
mtx-fonts       |   onum     cyrl     dflt mkd srb
mtx-fonts       |            dflt     dflt
mtx-fonts       |            grek     dflt
mtx-fonts       |            hebr     dflt
mtx-fonts       |            latn     aze crt dflt fin ism kaz lsm nor 
nsm sks ssm sve tat trk
mtx-fonts       |   pnum     cyrl     dflt mkd srb
mtx-fonts       |            dflt     dflt
mtx-fonts       |            grek     dflt
mtx-fonts       |            hebr     dflt
mtx-fonts       |            latn     aze crt dflt fin ism kaz lsm nor 
nsm sks ssm sve tat trk
mtx-fonts       |   salt     cyrl     dflt mkd srb
mtx-fonts       |            dflt     dflt
mtx-fonts       |            grek     dflt
mtx-fonts       |            hebr     dflt
mtx-fonts       |            latn     aze crt dflt fin ism kaz lsm nor 
nsm sks ssm sve tat trk
mtx-fonts       |   smcp     cyrl     dflt
mtx-fonts       |            dflt     dflt
mtx-fonts       |            grek     dflt
mtx-fonts       |            latn     aze crt dflt kaz tat trk
mtx-fonts       |   ss01     cyrl     dflt mkd srb
mtx-fonts       |            dflt     dflt
mtx-fonts       |            grek     dflt
mtx-fonts       |            hebr     dflt
mtx-fonts       |            latn     aze crt dflt fin ism kaz lsm nor 
nsm sks ssm sve tat trk
mtx-fonts       |   ss02     cyrl     dflt mkd srb
mtx-fonts       |            dflt     dflt
mtx-fonts       |            grek     dflt
mtx-fonts       |            hebr     dflt
mtx-fonts       |            latn     aze crt dflt fin ism kaz lsm nor 
nsm sks ssm sve tat trk
mtx-fonts       |   ss03     cyrl     dflt mkd srb
mtx-fonts       |            dflt     dflt
mtx-fonts       |            grek     dflt
mtx-fonts       |            hebr     dflt
mtx-fonts       |            latn     aze crt dflt fin ism kaz lsm nor 
nsm sks ssm sve tat trk
mtx-fonts       |   ss04     cyrl     dflt mkd srb
mtx-fonts       |            dflt     dflt
mtx-fonts       |            grek     dflt
mtx-fonts       |            hebr     dflt
mtx-fonts       |            latn     aze crt dflt fin ism kaz lsm nor 
nsm sks ssm sve tat trk
mtx-fonts       |   ss05     cyrl     dflt mkd srb
mtx-fonts       |            dflt     dflt
mtx-fonts       |            grek     dflt
mtx-fonts       |            hebr     dflt
mtx-fonts       |            latn     aze crt dflt fin ism kaz lsm nor 
nsm sks ssm sve tat trk
mtx-fonts       |   ss06     cyrl     dflt mkd srb
mtx-fonts       |            dflt     dflt
mtx-fonts       |            grek     dflt
mtx-fonts       |            hebr     dflt
mtx-fonts       |            latn     aze crt dflt fin ism kaz lsm nor 
nsm sks ssm sve tat trk
mtx-fonts       |   ss07     cyrl     dflt mkd srb
mtx-fonts       |            dflt     dflt
mtx-fonts       |            grek     dflt
mtx-fonts       |            hebr     dflt
mtx-fonts       |            latn     aze crt dflt fin ism kaz lsm nor 
nsm sks ssm sve tat trk
mtx-fonts       |   subs     cyrl     dflt mkd srb
mtx-fonts       |            dflt     dflt
mtx-fonts       |            grek     dflt
mtx-fonts       |            hebr     dflt
mtx-fonts       |            latn     aze crt dflt fin ism kaz lsm nor 
nsm sks ssm sve tat trk
mtx-fonts       |   sups     cyrl     dflt mkd srb
mtx-fonts       |            dflt     dflt
mtx-fonts       |            grek     dflt
mtx-fonts       |            hebr     dflt
mtx-fonts       |            latn     aze crt dflt fin ism kaz lsm nor 
nsm sks ssm sve tat trk
mtx-fonts       |   tnum     cyrl     dflt mkd srb
mtx-fonts       |            dflt     dflt
mtx-fonts       |            grek     dflt
mtx-fonts       |            hebr     dflt
mtx-fonts       |            latn     aze crt dflt fin ism kaz lsm nor 
nsm sks ssm sve tat trk
mtx-fonts       |   zero     cyrl     dflt mkd srb
mtx-fonts       |            dflt     dflt
mtx-fonts       |            grek     dflt
mtx-fonts       |            hebr     dflt
mtx-fonts       |            latn     aze crt dflt fin ism kaz lsm nor 
nsm sks ssm sve tat trk
mtx-fonts       |


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

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: font features
  2022-11-03 13:03     ` Thomas A. Schmitz via ntg-context
@ 2022-11-03 18:24       ` Hans Hagen via ntg-context
  2022-11-03 19:38         ` Thomas A. Schmitz via ntg-context
  0 siblings, 1 reply; 16+ messages in thread
From: Hans Hagen via ntg-context @ 2022-11-03 18:24 UTC (permalink / raw)
  To: Thomas A. Schmitz via ntg-context; +Cc: Hans Hagen

On 11/3/2022 2:03 PM, Thomas A. Schmitz via ntg-context wrote:
> On 11/3/22 13:27, Henning Hraban Ramm via ntg-context wrote:
>> If it works for you, then it’s a problem of my installation, otherwise 
>> a regression in current LMTX...
> 
> No, I get the same error message, this looks promising but doesn't work.
> 
> And at the risk of sounding grumpy, but all of this is too much manual 
> intervention; I would like to have a completely automated script. So 
> I'll show what I have and add a few comments:
> 
> local Feature_Table = { }
> local Parsed_Features = { }
> 
> local My_Font = environment.arguments["font"]
> 
> local Font_Features = os.resultof("otfinfo -f " .. My_Font)
> 
> for Feature_Sigla, Feature_Name in
>    string.gmatch(Font_Features, "(%S-)\t(.-)\n") do
>    Feature_Table[Feature_Sigla] = Feature_Name
> end
> 
> COMMENTS
> 
> Expectation: this should return a list of all features and their 
> descriptions as a lua table. If you run the file as
> 
> context test.cld --font="/path/to/font"
> 
> this works, and you get a table
> 
> Feature_Table={
>   ["aalt"]="Access All Alternates",
>   ["c2sc"]="Small Capitals From Capitals"} etc.
> 
> CODE
> 
> for name, _ in pairs(Feature_Table) do
>    Context_Name = "f:" .. name
>    Parsed_Features[name] = Context_Name
>    context.definefontfeature( { Context_Name }, { name="yes" } )
> end
> 
> COMMENTS
> 
> This should produce a lua table with ConTeXt fontfeatures and define 
> those features. The table appears to be correct:
> 
> Parsed_Features={
>   ["aalt"]="f:aalt",
>   ["c2sc"]="f:c2sc"} etc.
> 
> So I expected that this should be equivalent to
> 
> \definefontfeature [f:aalt] [aalt=yes]
> 
> and return a list of defined features.
> 
> CODE
> 
> local Test_String = [[
> ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 1234567890 1/4 2/8 
> 3/9 ffi ft fi fl ffl
> ]]
> 
> local Font_Name =  os.resultof("otfinfo -a " .. My_Font)
> 
> context.definefontfamily( { "Test" }, { "serif" }, { Font_Name }, {} )
> 
> context.setupbodyfont{ "Test, 12pt" }
> 
> COMMENTS
> 
> Again, this works; the font is set as bodyfont.
> 
> CODE
> 
> context.starttext()
> 
> for name, feature in pairs(Feature_Table) do
>    context.start ()
>    context.addfeature { Parsed_Features[name] }
>    context.midaligned (feature)
>    context.bold (Parsed_Features[name])
>    context.par ()
>    context.blank{ "medium" }
>    context(Test_String)
>    context.par ()
>    context.stop ()
> end
> 
> context.stoptext()
> 
> COMMENTS
> 
> And this doesn't work: the names are picked up, but the font features 
> are not defined; the sample text does not reflect any features. So this 
> is what I've got... maybe one of the wizards can help.
You're going way too complex. Access to features and info has alwaye 
been part of mkic (and therefore lmtx). You can peek into the s-font* 
styles for all kind of ways to get overviews. Anyway, the following 
helper operates on the current font:

\starttext

\startluacode
     function document.ShowFeatures(script)
         local test = [[
             ABCDEFGHIJKLMNOPQRSTUVWXYZ
             abcdefghijklmnopqrstuvwxyz
             1234567890
             1/4 2/8 3/9
             ffi ft fi fl ffl
         ]]

         local font     = fonts.hashes.identifiers[true]
         local features = font.resources.features
      -- inspect(features)
         for name, detail in table.sortedhash(features.gsub) do
             if #name == 4 then
                 context.type(name)
                 context.quad()
                 if script then
                     context.type(script)
                     context.quad()
                 end
                 -- this should be doen once in order to save memory
                 -- not too hard to do ..
                 context.definefontfeature(
                   { "f:"..name },
                   { [name] = "yes", script = script }
                 )
                 context.start()
                 context.addff("f:"..name)
                 context(test)
                 context.stop()
                 context.blank()
             end
         end
     end
\stopluacode

\definedfont[LibertinusSerif-Regular.otf*always]

\ctxlua{document.ShowFeatures()}
% \ctxlua{document.ShowFeatures("latn")}
% \ctxlua{document.ShowFeatures("grek")}

\stoptext

But, be aware that (1) features can combine in weird ways, (2) some 
features are only meant to be applied to a sunset of characters, (3) 
some are driven by script and/or language. Also, (4) you need to load 
the font without any features except the ones that enable node mode.

So, now you need to wikify ...

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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: font features
  2022-11-03 18:24       ` Hans Hagen via ntg-context
@ 2022-11-03 19:38         ` Thomas A. Schmitz via ntg-context
  0 siblings, 0 replies; 16+ messages in thread
From: Thomas A. Schmitz via ntg-context @ 2022-11-03 19:38 UTC (permalink / raw)
  To: Hans Hagen via ntg-context, mailing list for ConTeXt users
  Cc: Thomas A. Schmitz

On 11/3/22 19:24, Hans Hagen via ntg-context wrote:
> You're going way too complex. Access to features and info has alwaye 
> been part of mkic (and therefore lmtx). You can peek into the s-font* 
> styles for all kind of ways to get overviews. Anyway, the following 
> helper operates on the current font:

Thank you, Hans! Yes, I had a hunch that most of this was unnecessary 
because the information is already there. I also thought it would be 
convenient to have a helper script that could display everything before 
I decide whether I want to add a font to my texmf-font tree... Will play 
with this and then wikify!

All best

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

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: font features
  2010-11-17 19:15 Herbert Voss
@ 2010-11-17 20:55 ` Hans Hagen
  0 siblings, 0 replies; 16+ messages in thread
From: Hans Hagen @ 2010-11-17 20:55 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Herbert Voss

On 17-11-2010 8:15, Herbert Voss wrote:

> \setupbodyfont[modern,12pt]

so, 12 pt lm

> \definefontfeature[noLigNoKern][zero=yes,liga=no,kern=no]
> \font\myNoLigNoKern=lmroman12-regular*noLigNoKern

again 12pt lm (as you choose the 12 pt design size)

> \starttext
>
> Fiffies schöner 0815-Text über die Schifffahrt mit den Schiffern.
> \par\myNoLigNoKern
> Fiffies schöner 0815-Text über die Schifffahrt mit den Schiffern.

12 pt again

> \setupbodyfont[mylibertine,12pt]

> {\font\myNoLigNoKern=fxlr*noLigNoKern
> Fiffies schöner 0815-Text über die Schifffahrt mit den Schiffern.

12pt libertine (designsize 10pt scaled to 12pt)

> \par\myNoLigNoKern

libertine at design size

> Fiffies schöner 0815-Text über die Schifffahrt mit den Schiffern.}

> \setupbodyfont[mylibertine,12pt]\ss
> \font\myNoLigNoKern=fxbr*noLigNoKern
> Fiffies schöner 0815-Text über die Schifffahrt mit den Schiffern.

12pt libertine (designsize 10pt scaled to 12pt) (no ss defined)

> \par\myNoLigNoKern

libertine at design size

> Fiffies schöner 0815-Text über die Schifffahrt mit den Schiffern.

compare:

\font\myNoLigNoKern=fxbr*noLigNoKern         % designsize
\font\myNoLigNoKern=fxbr*noLigNoKern at 12pt % scaled

there's also:

\definefont[myNoLigNoKern][fxbr*noLigNoKern]\myNoLigNoKern

this defaults to "sa 1" which means: scaled at current bodyfont times 1

\definefont[myNoLigNoKern][fxbr*noLigNoKern at 12pt]\myNoLigNoKern
\definefont[myNoLigNoKern][fxbr*noLigNoKern sa 1]\myNoLigNoKern
\definefont[myNoLigNoKern][fxbr*noLigNoKern sa 2]\myNoLigNoKern

etc

so, \font is the dumb one: design size unless explicitly specified size


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

^ permalink raw reply	[flat|nested] 16+ messages in thread

* font features
@ 2010-11-17 19:15 Herbert Voss
  2010-11-17 20:55 ` Hans Hagen
  0 siblings, 1 reply; 16+ messages in thread
From: Herbert Voss @ 2010-11-17 19:15 UTC (permalink / raw)
  To: mailing list for ConTeXt users

What is wrong with my font setting for libertine
that the fontsize is reset when activating a font feature.
For latin modern it is ok.
the output:http://perce.de/temp/xxx.png

Herbert

\starttypescriptcollection[mylibertine]
\starttypescript[serif][libertine][name]
  \definefontsynonym[Serif][name:Linux Libertine O][features=default]
\stoptypescript
\starttypescript[sans][biolinum][name]
  \definefontsynonym[Sans][name:Linux Biolinum O][features=default]
\stoptypescript
\starttypescript[mylibertine]
   \definetypeface[mylibertine][rm][serif][libertine][default]
   \definetypeface[mylibertine][ss][sans] [biolinum] [default]
\stoptypescript
\stoptypescriptcollection

\setupbodyfont[modern,12pt]
\definefontfeature[noLigNoKern][zero=yes,liga=no,kern=no]
\font\myNoLigNoKern=lmroman12-regular*noLigNoKern

\starttext

Fiffies schöner 0815-Text über die Schifffahrt mit den Schiffern.
\par\myNoLigNoKern
Fiffies schöner 0815-Text über die Schifffahrt mit den Schiffern.

\setupbodyfont[mylibertine,12pt]
{\font\myNoLigNoKern=fxlr*noLigNoKern
Fiffies schöner 0815-Text über die Schifffahrt mit den Schiffern.
\par\myNoLigNoKern
Fiffies schöner 0815-Text über die Schifffahrt mit den Schiffern.}

\setupbodyfont[mylibertine,12pt]\ss
\font\myNoLigNoKern=fxbr*noLigNoKern
Fiffies schöner 0815-Text über die Schifffahrt mit den Schiffern.
\par\myNoLigNoKern
Fiffies schöner 0815-Text über die Schifffahrt mit den Schiffern.

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

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Font features
  2009-05-15 12:41     ` Alex Lubberts
@ 2009-05-15 14:22       ` Hans Hagen
  0 siblings, 0 replies; 16+ messages in thread
From: Hans Hagen @ 2009-05-15 14:22 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Alex Lubberts wrote:
> On vr, 2009-05-15 at 06:23 -0600, Idris Samawi Hamid ادريس سماوي
> حامد wrote:
>> On Fri, 15 May 2009 00:21:58 -0600, Wolfgang Schuster  
>> <schuster.wolfgang@googlemail.com> wrote:
>>
>>> \definefontfeature[onum][default][onum=yes]
>> What is the second option for?
> 
> If I'm correct, this means define a font feature onum, that inherits
> from default with the difference onum=yes.

indeed

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Font features
  2009-05-15 12:23   ` Idris Samawi Hamid ادريس سماوي حامد
@ 2009-05-15 12:41     ` Alex Lubberts
  2009-05-15 14:22       ` Hans Hagen
  0 siblings, 1 reply; 16+ messages in thread
From: Alex Lubberts @ 2009-05-15 12:41 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On vr, 2009-05-15 at 06:23 -0600, Idris Samawi Hamid ادريس سماوي
حامد wrote:
> On Fri, 15 May 2009 00:21:58 -0600, Wolfgang Schuster  
> <schuster.wolfgang@googlemail.com> wrote:
> 
> > \definefontfeature[onum][default][onum=yes]
> 
> What is the second option for?

If I'm correct, this means define a font feature onum, that inherits
from default with the difference onum=yes.

Regards,
Alex

___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Font features
  2009-05-15  6:21 ` Wolfgang Schuster
@ 2009-05-15 12:23   ` Idris Samawi Hamid ادريس سماوي حامد
  2009-05-15 12:41     ` Alex Lubberts
  0 siblings, 1 reply; 16+ messages in thread
From: Idris Samawi Hamid ادريس سماوي حامد @ 2009-05-15 12:23 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Fri, 15 May 2009 00:21:58 -0600, Wolfgang Schuster  
<schuster.wolfgang@googlemail.com> wrote:

> \definefontfeature[onum][default][onum=yes]

What is the second option for?

\definefontfeature[onum][onum=yes] should work as well.

Best wishes
Idris

-- 
Professor Idris Samawi Hamid, Editor-in-Chief
International Journal of Shi`i Studies
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Font features
  2009-05-15  2:06 Font features Vyatcheslav Yatskovsky
@ 2009-05-15  6:21 ` Wolfgang Schuster
  2009-05-15 12:23   ` Idris Samawi Hamid ادريس سماوي حامد
  0 siblings, 1 reply; 16+ messages in thread
From: Wolfgang Schuster @ 2009-05-15  6:21 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 15.05.2009 um 04:06 schrieb Vyatcheslav Yatskovsky:

> Hello,
>
> I also have a question about font features. Minion Pro has old style  
> numerals. How to display them, provided that I enabled this feature?
>
> In the following test script, I get ordinary numbers, no old style.

\definefontfeature[onum][default][onum=yes] or you the predefined  
'oldstyle' feature set.

> \starttypescript [serif] [MinionPro]
>  \definefontsynonym [Serif][MinionPro-Regular.otf][features=onum]
> \stoptypescript

Use 'name:' or 'file:' prefix for the the font and remove the file  
extension, e.g.

\definefontsynonym [Serif][file:MinionPro-Regular][features=onum]

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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Font features
@ 2009-05-15  2:06 Vyatcheslav Yatskovsky
  2009-05-15  6:21 ` Wolfgang Schuster
  0 siblings, 1 reply; 16+ messages in thread
From: Vyatcheslav Yatskovsky @ 2009-05-15  2:06 UTC (permalink / raw)
  To: ntg-context

Hello,

I also have a question about font features. Minion Pro has old style 
numerals. How to display them, provided that I enabled this feature?

In the following test script, I get ordinary numbers, no old style.


\starttypescript [serif] [MinionPro]
   \definefontsynonym [Serif][MinionPro-Regular.otf][features=onum]
\stoptypescript

\starttypescript [MinionPro]
   \definetypeface [MinionPro][rm][serif][MinionPro][features=onum]
\stoptypescript

\usetypescript[MinionPro]

\setupbodyfont[MinionPro,16pt]

\starttext
This is bla bla bla 1234567890.
\stoptext


Regards,
Vyatcheslav
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2022-11-03 19:38 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-03 11:37 font features Thomas A. Schmitz via ntg-context
2022-11-03 11:52 ` Herbert Voss via ntg-context
2022-11-03 12:19   ` Thomas A. Schmitz via ntg-context
2022-11-03 17:57   ` Hans Hagen via ntg-context
2022-11-03 12:20 ` Henning Hraban Ramm via ntg-context
2022-11-03 12:27   ` Henning Hraban Ramm via ntg-context
2022-11-03 13:03     ` Thomas A. Schmitz via ntg-context
2022-11-03 18:24       ` Hans Hagen via ntg-context
2022-11-03 19:38         ` Thomas A. Schmitz via ntg-context
  -- strict thread matches above, loose matches on Subject: below --
2010-11-17 19:15 Herbert Voss
2010-11-17 20:55 ` Hans Hagen
2009-05-15  2:06 Font features Vyatcheslav Yatskovsky
2009-05-15  6:21 ` Wolfgang Schuster
2009-05-15 12:23   ` Idris Samawi Hamid ادريس سماوي حامد
2009-05-15 12:41     ` Alex Lubberts
2009-05-15 14:22       ` Hans Hagen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).