Question on style-italic vs style=italicface
Hello list mavens, What are the circumstances under which style=italicface should be used instead of style=italic. I note a difference when I define highlighting. I expected to see no difference in the line before and line after the hairline the example below, but see that italicface adapts to nesting, while italic does not: Are there other places where this makes a difference? \setupbodyfontenvironment [default] [em=italicface] %same with italic for this example \definehighlight [emIt] [style=italic] \definehighlight [emIf] [style=italicface] \definehighlight [emEm] [style=\em] \starttext {\em abc {\em def} ghi}: \type{\em} \emph{abc {\emph def} ghi}: \type{\emph} \emEm{abc {\emEm def} ghi}: \type{\emEm \definehighlight[style=\em]} \emIf{abc {\emIf def} ghi}: \type{\emIf \definehighlight[style=italicface]} \hairline \emIt{abc {\emIt def} ghi}: \type{\emIt \definehighlight[style=italic]} \stoptext -- Rik
Rik Kabel via ntg-context schrieb am 26.09.2021 um 22:13:
Hello list mavens,
What are the circumstances under which style=italicface should be used instead of style=italic. I note a difference when I define highlighting. I expected to see no difference in the line before and line after the hairline the example below, but see that italicface adapts to nesting, while italic does not:
Are there other places where this makes a difference?
\setupbodyfontenvironment [default] [em=italicface] %same with italic for this example \definehighlight [emIt] [style=italic] \definehighlight [emIf] [style=italicface] \definehighlight [emEm] [style=\em]
\starttext
{\em abc {\em def} ghi}: \type{\em}
\emph{abc {\emph def} ghi}: \type{\emph}
\emEm{abc {\emEm def} ghi}: \type{\emEm \definehighlight[style=\em]}
\emIf{abc {\emIf def} ghi}: \type{\emIf \definehighlight[style=italicface]}
\hairline
\emIt{abc {\emIt def} ghi}: \type{\emIt \definehighlight[style=italic]}
\stoptext
The \em command has two special values which are allowed when you change the style with \setupbodyfontenvironment[default][em=...] with the value "slanted" and "italic". When you choose one of them the result depends on the current weight (\tf or \bf) but with every other value you're just using whatever the style command/name provides. When you pass "italicface" you're using a style which uses either \it or \bi dependant on the current weight. The result from the "italic" value doesn't depend on the behavior or the normal italic style (\it) which is the reason why you get different result when you use \em compared with \it. Example: \starttext \tex{it}: normal {\it italic} {\bf bold {\it italic}} \tex{italicface}: normal {\italicface italic} {\bf bold {\italicface italic}} \tex{em}: normal {\em italic} {\bf bold {\em italic}} \stoptext Wolfgang
On 9/26/2021 16:29, Wolfgang Schuster via ntg-context wrote:
Rik Kabel via ntg-context schrieb am 26.09.2021 um 22:13:
Hello list mavens,
What are the circumstances under which style=italicface should be used instead of style=italic. I note a difference when I define highlighting. I expected to see no difference in the line before and line after the hairline the example below, but see that italicface adapts to nesting, while italic does not:
Are there other places where this makes a difference?
\setupbodyfontenvironment [default] [em=italicface] %same with italic for this example \definehighlight [emIt] [style=italic] \definehighlight [emIf] [style=italicface] \definehighlight [emEm] [style=\em]
\starttext
{\em abc {\em def} ghi}: \type{\em}
\emph{abc {\emph def} ghi}: \type{\emph}
\emEm{abc {\emEm def} ghi}: \type{\emEm \definehighlight[style=\em]}
\emIf{abc {\emIf def} ghi}: \type{\emIf \definehighlight[style=italicface]}
\hairline
\emIt{abc {\emIt def} ghi}: \type{\emIt \definehighlight[style=italic]}
\stoptext
The \em command has two special values which are allowed when you change the style with
\setupbodyfontenvironment[default][em=...]
with the value "slanted" and "italic". When you choose one of them the result depends on the current weight (\tf or \bf) but with every other value you're just using whatever the style command/name provides.
When you pass "italicface" you're using a style which uses either \it or \bi dependant on the current weight. The result from the "italic" value doesn't depend on the behavior or the normal italic style (\it) which is the reason why you get different result when you use \em compared with \it.
Example:
\starttext
\tex{it}: normal {\it italic} {\bf bold {\it italic}}
\tex{italicface}: normal {\italicface italic} {\bf bold {\italicface italic}}
\tex{em}: normal {\em italic} {\bf bold {\em italic}}
\stoptext
Wolfgang
Wolfgang, I understand that mechanism, but I am asking a different question, I think. When we specify style=\em or style=italic (and most examples I see use the later) in a setup of some sort, I think most folks expect similar behavior, but clearly it is not because italic does not track changes in emphasis. However, style=italicface does seem to match the behavior of style=\em (mostly, see the bug report below). So, I am asking whether, in places where folks often use style=italic, it might be better to consider style=italicface. Bug report: \meaning\italicface gives: protected macro:\relax \ifx \fontalternative \s!tf \it \orelse \ifx \fontalternative \s!bf \bi \else \tf \fi This leaves out the transition from bi to bf. That transition is done by \emph, but \emph may give slanted while \italicface is always italic. -- Rik
Rik Kabel via ntg-context schrieb am 27.09.2021 um 00:20:
On 9/26/2021 16:29, Wolfgang Schuster via ntg-context wrote:
Rik Kabel via ntg-context schrieb am 26.09.2021 um 22:13:
Hello list mavens,
What are the circumstances under which style=italicface should be used instead of style=italic. I note a difference when I define highlighting. I expected to see no difference in the line before and line after the hairline the example below, but see that italicface adapts to nesting, while italic does not:
Are there other places where this makes a difference?
\setupbodyfontenvironment [default] [em=italicface] %same with italic for this example \definehighlight [emIt] [style=italic] \definehighlight [emIf] [style=italicface] \definehighlight [emEm] [style=\em]
\starttext
{\em abc {\em def} ghi}: \type{\em}
\emph{abc {\emph def} ghi}: \type{\emph}
\emEm{abc {\emEm def} ghi}: \type{\emEm \definehighlight[style=\em]}
\emIf{abc {\emIf def} ghi}: \type{\emIf \definehighlight[style=italicface]}
\hairline
\emIt{abc {\emIt def} ghi}: \type{\emIt \definehighlight[style=italic]}
\stoptext
The \em command has two special values which are allowed when you change the style with
\setupbodyfontenvironment[default][em=...]
with the value "slanted" and "italic". When you choose one of them the result depends on the current weight (\tf or \bf) but with every other value you're just using whatever the style command/name provides.
When you pass "italicface" you're using a style which uses either \it or \bi dependant on the current weight. The result from the "italic" value doesn't depend on the behavior or the normal italic style (\it) which is the reason why you get different result when you use \em compared with \it.
Example:
\starttext
\tex{it}: normal {\it italic} {\bf bold {\it italic}}
\tex{italicface}: normal {\italicface italic} {\bf bold {\italicface italic}}
\tex{em}: normal {\em italic} {\bf bold {\em italic}}
\stoptext
Wolfgang
Wolfgang,
I understand that mechanism, but I am asking a different question, I think.
When we specify style=\em or style=italic (and most examples I see use the later) in a setup of some sort, I think most folks expect similar behavior, but clearly it is not because italic does not track changes in emphasis. However, style=italicface does seem to match the behavior of style=\em (mostly, see the bug report below).
The basic font commands are \tf, \it, \sl, \bf, \bs and \bi and when you want for example bold italic text you always have to use \bi even the current text is already bold because \it produces normal italic text. \em is a special case because it affects also italic text: \starttext \startlines \tf normal {\em emphasized} \sl slanted {\em emphasized} \it italic {\em emphasized} \bf bold {\em emphasized} \bs bold slanted {\em emphasized} \bi bold italic {\em emphasized} \stoplines \stoptext
So, I am asking whether, in places where folks often use style=italic, it might be better to consider style=italicface.
Bug report: \meaning\italicface gives:
protected macro:\relax \ifx \fontalternative \s!tf \it \orelse \ifx \fontalternative \s!bf \bi \else \tf \fi
This leaves out the transition from bi to bf. That transition is done by \emph, but \emph may give slanted while \italicface is always italic.
The \italicface command uses either \it or \bi as result but it never result in upright text and the "italic" in the name tells you this, there are commands (e.g. \boldface) with similar results. To get a slanted style you have to use the \slantedface command. Wolfgang
Wolfgang (off-list), It is simply wrong to say that \italicface as defined gives only \it or \bi as a result. Look at the definition. If the current fontalternative is it \it it will give a \tf result. It is sensitive to the current state in a similar way that \em and \emph are, but it will always give an italic or roman result. -- Rik On 9/26/2021 18:37, Wolfgang Schuster via ntg-context wrote:
Rik Kabel via ntg-context schrieb am 27.09.2021 um 00:20:
So, I am asking whether, in places where folks often use style=italic, it might be better to consider style=italicface.
Bug report: \meaning\italicface gives:
protected macro:\relax \ifx \fontalternative \s!tf \it \orelse \ifx \fontalternative \s!bf \bi \else \tf \fi
This leaves out the transition from bi to bf. That transition is done by \emph, but \emph may give slanted while \italicface is always italic.
The \italicface command uses either \it or \bi as result but it never result in upright text and the "italic" in the name tells you this, there are commands (e.g. \boldface) with similar results. To get a slanted style you have to use the \slantedface command.
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://context.aanhet.net archive :https://bitbucket.org/phg/context-mirror/commits/ wiki :http://contextgarden.net ___________________________________________________________________________________
Rik Kabel via ntg-context schrieb am 27.09.2021 um 00:49:
Wolfgang (off-list),
It is simply wrong to say that \italicface as defined gives only \it or \bi as a result. Look at the definition. If the current fontalternative is it \it it will give a \tf result. It is sensitive to the current state in a similar way that \em and \emph are, but it will always give an italic or roman result.
If we leave the comparisons between \em and \italicface aside and talk only about the results from \italicface we have a common ground. You're right the results from \italicface aren't predictable and a fix is needed but the same applies also to \boldface, \slantedface and \typeface. Attached is the output from a modified version of the styling command (the \sc column is the fallback style). \swapface is unchanged and I'm not sure about its output because it uses the \em code for italic and slanted which means \setupbodyfontenvironment[default][em=blue] affects also the \swapface results. Wolfgang
Am 02.10.2021 um 10:34 schrieb Wolfgang Schuster via ntg-context
: Rik Kabel via ntg-context schrieb am 27.09.2021 um 00:49:
Wolfgang (off-list),
It is simply wrong to say that \italicface as defined gives only \it or \bi as a result. Look at the definition. If the current fontalternative is it \it it will give a \tf result. It is sensitive to the current state in a similar way that \em and \emph are, but it will always give an italic or roman result.
If we leave the comparisons between \em and \italicface aside and talk only about the results from \italicface we have a common ground.
You're right the results from \italicface aren't predictable and a fix is needed but the same applies also to \boldface, \slantedface and \typeface.
Attached is the output from a modified version of the styling command (the \sc column is the fallback style). \swapface is unchanged and I'm not sure about its output because it uses the \em code for italic and slanted which means \setupbodyfontenvironment[default][em=blue] affects also the \swapface results.
Thank you very much for attacking and clarifying this! It confused me from the beginning... Hraban
Henning Hraban Ramm via ntg-context schrieb am 02.10.2021 um 11:46:
Am 02.10.2021 um 10:34 schrieb Wolfgang Schuster via ntg-context
: Rik Kabel via ntg-context schrieb am 27.09.2021 um 00:49:
Wolfgang (off-list),
It is simply wrong to say that \italicface as defined gives only \it or \bi as a result. Look at the definition. If the current fontalternative is it \it it will give a \tf result. It is sensitive to the current state in a similar way that \em and \emph are, but it will always give an italic or roman result.
If we leave the comparisons between \em and \italicface aside and talk only about the results from \italicface we have a common ground.
You're right the results from \italicface aren't predictable and a fix is needed but the same applies also to \boldface, \slantedface and \typeface.
Attached is the output from a modified version of the styling command (the \sc column is the fallback style). \swapface is unchanged and I'm not sure about its output because it uses the \em code for italic and slanted which means \setupbodyfontenvironment[default][em=blue] affects also the \swapface results. Thank you very much for attacking and clarifying this! It confused me from the beginning...
Just a short update on the topic. The following four font switches result now in predictable output (e.g. \typeface produces always upright text which is either \tf or \bf): - \typeface - \italicface - \slantedface - \boldface Wolfgang
participants (3)
-
Henning Hraban Ramm
-
Rik Kabel
-
Wolfgang Schuster