newtxtext and osf — turn on and off

Is there a way to turn OSF(old style figure) on and off in newtxtext? The documentation (http://get-software.net/fonts/newtx/doc/newtxdoc.pdf) doesn't state a command to turn it on and off with in the document itself.

\documentclass[12pt,ngerman]{scrartcl}
\usepackage[english,ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage{babel,csquotes}
\usepackage[T1]{fontenc}

\usepackage[osf,scaled=.95,helvratio=.96]{newtxtext}
\usepackage{newtxmath}
\begin{document}

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of \textsc{Letraset} sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like \textsc{Aldus PageMaker} including versions of Lorem Ipsum.\\

%turn osf off
Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. \textsc{Richard McClintock}, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of \textquotedblleft de Finibus Bonorum et Malorum\textquotedblright~(The Extremes of Good and Evil) by \textsc{Cicero}, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, \textquotedblleft Lorem ipsum dolor sit amet\dots \textquotedblright, comes from a line in section 1.10.32.
%turn osf on
\end{document}

• Old style figures in Times are an anachronism; anyway, what's the reason for wanting to turn the feature on and off? – egreg Oct 23 '14 at 15:03
• For example I don't like osfs in the Toc. – jlk Oct 23 '14 at 15:16
• Just don't use old style figures in Times. ;-) Please, try being more specific in your question. – egreg Oct 23 '14 at 15:19
• Well, what I'd like to have is a command like \figureversion{} in Minion pro. \figureversion{lining, lf} \tableofcontents \figureversion{text, osf} – jlk Oct 23 '14 at 15:21

The \figureversion macro of fontaxes doesn't seem to understand the setup of newtxtext. This hand made version seems to work.

\documentclass{article}
\usepackage[osf]{newtxtext}

\makeatletter
\newcommand{\figvers}[1]{\csname newtxtext@figure@#1\endcsname}
\newcommand\newtxtext@figure@osf{%
\renewcommand{\rmdefault}{ntxrj}%
\fontfamily\familydefault\selectfont
}
\newcommand\newtxtext@figure@lining{%
\renewcommand{\rmdefault}{ntxrx}%
\fontfamily\familydefault\selectfont
}
\makeatother

\begin{document}

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the
industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and
scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap
into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the
release of \textsc{Letraset} sheets containing Lorem Ipsum passages, and more recently with desktop
publishing software like \textsc{Aldus PageMaker} including versions of Lorem Ipsum.

\figvers{lining}

Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of
classical Latin literature from 45 BC, making it over 2000 years old. \textsc{Richard McClintock}, a
Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words,
consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical
literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of
\textquotedblleft de Finibus Bonorum et Malorum\textquotedblright~(The Extremes of Good and Evil) by
\textsc{Cicero}, written in 45 BC. This book is a treatise on the theory of ethics, very popular
during the Renaissance. The first line of Lorem Ipsum, \textquotedblleft Lorem ipsum dolor sit
amet\dots \textquotedblright, comes from a line in section 1.10.32.

\figvers{osf}

1234567890

{\figvers{lining}1234567890}

1234567890

\end{document}


My opinion is that Times New Roman should never be typeset with old style figures, which are anachronistic for it.

• Are you saying that you don't think typefaces created in the 20th century should use old style figures - or that Times New Roman shouldn't, since the font used lining figures when it was created? Then what about small caps? You're using that in this text, but the Times newspaper, for which Times New Roman was created, didn't ... – Sverre Oct 23 '14 at 16:09
• @Sverre I used the provided text. My opinion is that before starting with using a font, several points should be well pondered. Maybe one can decide to use old style figures with Times, after all there's no font police around. But figures should be the same in the table of contents as in the document body. Using old style figures in text when several figures are used in math should be discouraged. – egreg Oct 23 '14 at 16:14
• fontaxes assumes that fonts are named according to a particular schema. Any fonts which are not are unsupported. (This includes all fonts named according to the Berry scheme. Or did last time I checked.) – cfr Oct 24 '14 at 22:15