why use math here?
It was to avoid oldstyle figures that I use by default. But finally it's better to use oldstyle figures even in tables. Another question about fonts. Is there a way to define a conditional mathcommand based on the current alternative style? For instance, in the following example I would like to keep the bold effect but with adaptation to the local alternative style (in text mode, when the local alternative style is \tf I would like the mathcommand to be \bf, when it is \it I would like \bi, when it is \bf I would like \bf and when it is \bi I would like still \bi): \starttext \definemathcommand[cool]{{\bfmath cool}} text mode normal: \cool\crlf text mode italic: {\it \cool}\crlf text mode bold: {\bf \cool}\crlf text mode bolditalic: {\bi \cool}\crlf \stoptext
Am 24.06.2014 um 21:46 schrieb Maggyero
why use math here?
It was to avoid oldstyle figures that I use by default. But finally it's better to use oldstyle figures even in tables.
You can enable lining (and tabular) figures in the table when you don’t want oldstyle figures.
Another question about fonts. Is there a way to define a conditional mathcommand based on the current alternative style? For instance, in the following example I would like to keep the bold effect but with adaptation to the local alternative style (in text mode, when the local alternative style is \tf I would like the mathcommand to be \bf, when it is \it I would like \bi, when it is \bf I would like \bf and when it is \bi I would like still \bi):
You can access the current font alternative with the \fontalternative command (below is a old example I wrote a few months ago). \def\Test {\processaction [\fontalternative] [ tf=>Upright, it=>Italic, sl=>Slanted, bf=>Bold, bi=>Bolditalic, bs=>Boldslanted, unknown=>Unknown fontalternative]} \starttext “\Test” {\it “\Test”} {\bs “\Test”} {\sc “\Test”} \stoptext Wolfgang
On 6/25/2014 12:29 AM, Wolfgang Schuster wrote:
Am 24.06.2014 um 21:46 schrieb Maggyero
: why use math here?
It was to avoid oldstyle figures that I use by default. But finally it's better to use oldstyle figures even in tables.
You can enable lining (and tabular) figures in the table when you don’t want oldstyle figures.
Another question about fonts. Is there a way to define a conditional mathcommand based on the current alternative style? For instance, in the following example I would like to keep the bold effect but with adaptation to the local alternative style (in text mode, when the local alternative style is \tf I would like the mathcommand to be \bf, when it is \it I would like \bi, when it is \bf I would like \bf and when it is \bi I would like still \bi):
You can access the current font alternative with the \fontalternative command (below is a old example I wrote a few months ago).
\def\Test {\processaction [\fontalternative] [ tf=>Upright, it=>Italic, sl=>Slanted, bf=>Bold, bi=>Bolditalic, bs=>Boldslanted, unknown=>Unknown fontalternative]}
\starttext “\Test” {\it “\Test”} {\bs “\Test”} {\sc “\Test”} \stoptext
\let\Test\fontstylesuffix a bit different output ----------------------------------------------------------------- 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 -----------------------------------------------------------------
On Wed, 25 Jun 2014, Wolfgang Schuster wrote:
Am 24.06.2014 um 21:46 schrieb Maggyero
: why use math here?
It was to avoid oldstyle figures that I use by default. But finally it's better to use oldstyle figures even in tables.
You can enable lining (and tabular) figures in the table when you don’t want oldstyle figures.
Out of curiosity, how do you do that (i.e., revert back to lining, and tabular, figures in a table, or even in running text)? For example, if I do this: \starttext \bf 12345\par \tf 12345\par \stoptext the first line is bold but the second is not. But if I do the same with \os: \starttext \os 12345\par \tf 12345\par \stoptext both lines use old style numbers. Is there a way to switch the current font back to lining figures without reloading the font with \switchtobodyfont or something similar? Thanks, Brian
Am 25.06.2014 um 23:20 schrieb Brian R. Landy
On Wed, 25 Jun 2014, Wolfgang Schuster wrote:
Am 24.06.2014 um 21:46 schrieb Maggyero
: why use math here?
It was to avoid oldstyle figures that I use by default. But finally it's better to use oldstyle figures even in tables.
You can enable lining (and tabular) figures in the table when you don’t want oldstyle figures.
Out of curiosity, how do you do that (i.e., revert back to lining, and tabular, figures in a table, or even in running text)?
For example, if I do this:
\starttext \bf 12345\par \tf 12345\par \stoptext
the first line is bold but the second is not. But if I do the same with \os:
\starttext \os 12345\par \tf 12345\par \stoptext
both lines use old style numbers. Is there a way to switch the current font back to lining figures without reloading the font with \switchtobodyfont or something similar?
The \os command enables oldstyle figures in your font and the setting isn’t reset when you switch to a different font alternative. \definefontfeature[f:lnum][lnum=yes] \definefontfeature[f:onum][onum=yes] \definefontfeature[f:tnum][tnum=yes,pnum=no] \definefontfeature[f:pnum][pnum=yes,tnum=no] \setupbodyfont[antykwa-poltawskiego] \starttext \starttabulate \NC onum \NC \feature[+][f:onum] 1234567890 \NC\NR \NC onum + tnum \NC \feature[+][f:onum]\feature[+][f:tnum]1234567890 \NC\NR \NC onum + pnum \NC \feature[+][f:onum]\feature[+][f:pnum]1234567890 \NC\NR \TB \NC lnum \NC \feature[+][f:lnum] 1234567890 \NC\NR \NC lnum + tnum \NC \feature[+][f:lnum]\feature[+][f:tnum]1234567890 \NC\NR \NC lnum + pnum \NC \feature[+][f:lnum]\feature[+][f:pnum]1234567890 \NC\NR \stoptabulate \stoptext Wolfgang
On Wed, 25 Jun 2014, Wolfgang Schuster wrote:
Am 25.06.2014 um 23:20 schrieb Brian R. Landy
: Out of curiosity, how do you do that (i.e., revert back to lining, and tabular, figures in a table, or even in running text)?
For example, if I do this:
\starttext \bf 12345\par \tf 12345\par \stoptext
the first line is bold but the second is not. But if I do the same with \os:
\starttext \os 12345\par \tf 12345\par \stoptext
both lines use old style numbers. Is there a way to switch the current font back to lining figures without reloading the font with \switchtobodyfont or something similar?
The \os command enables oldstyle figures in your font and the setting isn’t reset when you switch to a different font alternative.
\definefontfeature[f:lnum][lnum=yes] \definefontfeature[f:onum][onum=yes] \definefontfeature[f:tnum][tnum=yes,pnum=no] \definefontfeature[f:pnum][pnum=yes,tnum=no]
\setupbodyfont[antykwa-poltawskiego]
\starttext
\starttabulate \NC onum \NC \feature[+][f:onum] 1234567890 \NC\NR \NC onum + tnum \NC \feature[+][f:onum]\feature[+][f:tnum]1234567890 \NC\NR \NC onum + pnum \NC \feature[+][f:onum]\feature[+][f:pnum]1234567890 \NC\NR \TB \NC lnum \NC \feature[+][f:lnum] 1234567890 \NC\NR \NC lnum + tnum \NC \feature[+][f:lnum]\feature[+][f:tnum]1234567890 \NC\NR \NC lnum + pnum \NC \feature[+][f:lnum]\feature[+][f:pnum]1234567890 \NC\NR \stoptabulate
\stoptext
Wolfgang
This was exactly what I needed, thank you! Brian
participants (4)
-
Brian R. Landy
-
Hans Hagen
-
Maggyero
-
Wolfgang Schuster