Message from discussion
\addfontfeature{Numbers=OldSty le}
Received: by 10.68.213.103 with SMTP id nr7mr3682354pbc.7.1352121756919;
Mon, 05 Nov 2012 05:22:36 -0800 (PST)
MIME-Version: 1.0
Path: s9ni81507pbb.0!nntp.google.com!news.glorb.com!us.feeder.erje.net!feeder.erje.net!eu.feeder.erje.net!news.albasani.net!.POSTED!not-for-mail
From: Bob Tennent <B...@cs.queensu.ca>
Newsgroups: comp.text.tex
Subject: Re: \addfontfeature{Numbers=OldStyle}
Date: Mon, 5 Nov 2012 13:22:36 +0000 (UTC)
Organization: albasani.net
Lines: 52
Message-ID: <slrnk9ffcs.4ih.BobT@linus.cs.queensu.ca>
References: <slrnk9edhd.dms.BobT@linus.cs.queensu.ca> <slrnk9eh9q.f49.BobT@linus.cs.queensu.ca> <1o4wijd2qus9p.dlg@nililand.de>
Reply-To: rdtenn...@gmail.com
X-Trace: news.albasani.net otEXkkPoL1LTtPCTLUnefl6M74s9M8kh84oYCxBDoqeHXRAkkpoEjNyWeN+AWMQ/HyIgIjGXpCsOh8/6r6sUSQ==
NNTP-Posting-Date: Mon, 5 Nov 2012 13:22:36 +0000 (UTC)
Injection-Info: news.albasani.net; logging-data="GSeb8LIuUbRAlIPMn6uKq30fRGLq7V0q85id6xcY4zz6t+1Z73kvE/SZR1l8IOKZMFk3ooYplvjQnO3ws6k9he/5g55917Y4udx6ek3iwOhq52da5ZW8wehaLQR5iY86"; mail-complaints-to="ab...@albasani.net"
User-Agent: slrn/0.9.8.1pl1 (Linux)
Cancel-Lock: sha1:/3dildixobWqRoc6QQqIxmQheFw=
On Mon, 5 Nov 2012 14:01:04 +0100, Ulrike Fischer wrote:
>> > \documentclass[12pt]{article}
>> > \usepackage{fontspec}
>> > \renewcommand*\oldstylenums[1]{{\addfontfeature{Numbers=OldStyle}#1}}
>> > \begin{document}\Large
>> > {\fontspec[Numbers=Lining]{LinLibertine_R.otf} 1234567890
>> >
>> > \oldstylenums{1234567890} !}
>> >
>> > {\fontspec[Numbers=OldStyle]{LinLibertine_R.otf} 1234567890 }
>> > \end{document}
>> >
>> > Can anyone explain why it isn't? The same example works with Biolinum,
>> > a companion sans font.
>>
>> This is a known issue:
>>
>> http://tex.stackexchange.com/questions/10986/
>> lining-numbers-not-working-in-certain-fonts
>>
> You could try something like this:
>
> \documentclass[12pt]{article}
> \usepackage{fontspec,l3regex}
>
> \makeatletter
> \ExplSyntaxOn
> \cs_generate_variant:Nn\regex_replace_all:nnN{n n o}
>
> \newcommand\removefontfeature[1]{%
> \regex_replace_all:nno{#1}{}{\csname
> zf@family@options\f@family\endcsname}}
>
> \ExplSyntaxOff
> \makeatother
>
>
>
> \renewcommand*\oldstylenums[1]{{%
> \removefontfeature{Numbers=Lining}%
> \removefontfeature{Numbers=Uppercase}%
> \addfontfeature{Numbers=OldStyle}#1}}
Thanks but I really have no incentive now that I have working code.
It's fontspec's problem, not mine. And their most urgent issue is to
fix the documentation, which actually uses an example much like this to
illustrate addfontfeature and says nothing about its known unreliabilty.
On a scale of 1 to 7, this deserves a -5.
Bob T.