My metalogo package mentions these:<br><br>\ifdim\fontdimen\@ne\font\z@ is true if the current font is not slanted.<br>\if b\expandafter\@car\f@series\@nil is true if the current font is bold.<br><br>Here's an example:<br>
<br>\documentclass{article}<br><br>\makeatletter<br>\usepackage{fontspec}<br>\setmainfont{Georgia}<br><br>\newcommand\test{<br> \ifdim\fontdimen\@ne\font=\z@<br> Is upright<br> \else<br> Is italic or slanted<br> \fi<br>
\if b\expandafter\@car\f@series\@nil<br> Is bold<br> \else<br> Is not bold<br> \fi}<br><br>\begin{document}<br>Something \test. \textit{Something \test.}<br><br>\bfseries Something \test. \textit{Something \test.}<br>
\end{document}<br><br>It should be possible to to create new ifs based on these, say \ifbold and \ifitalic, which I intend to put into the next update to metalogo.<br><br>Andrew<br><br><br><div class="gmail_quote">2009/12/23 Kārlis Repsons <span dir="ltr"><<a href="mailto:karlis.repsons@gmail.com">karlis.repsons@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Not sure if XeTeX is very relevant, but maybe someone knows how could I make a<br>
new command, which has some if-then automations depending on if the specified<br>
font has italic or bold shapes?<br>
</blockquote></div><br>