# Access minus symbol of postscript font in textmode

Do postscript fonts such as libertine (from the libertine-legacy package) or mathpazo have a minus sign that can be accessed when in text mode? What I am trying to do is substitute the normal dash with a minus symbol, following this answer from David Carlisle.

His solution works perfectly when using open type fonts as most of them have a minus character that can be easily accessed:

\def\yyy{%
\bgroup\uccode\~\expandafter\string-%
\uppercase{\egroup\edef~{\noexpand\text{\char"2212\relax}}}%
\mathcode\expandafter\string-"8000 }


However, my attempts to do something similar with pdfLaTeX and Libertine or Pagella have been futile. Using a symbol like hyphen (\textendash) works perfectly:

\def\yyy{%
\bgroup\uccode\~\expandafter\string-%
\uppercase{\egroup\edef~{\noexpand\text{\llap{\textendash}\relax}}}%
\mathcode\expandafter\string-"8000 }


But is not exactly what I want. How can I access the minus symbol of that font? Or, if that is not possible, is it possible to resize the hyphen to "fake" a minus symbol?

Edit: egreg provided the solution below. Embedded into my framework the code is:

\def\yyy{% Thanks to egreg
\begingroup\uccode~=-
\uppercase{\endgroup\def~}{\mathbin{\text{\llap{\textminus}}}}
\mathcode-="8000 }

-

The en dash is in position "15 in the T1 encoding:

\begingroup\uccode~=-
\uppercase{\endgroup\def~}{\mathbin{\text{\char"15 }}}
\AtBeginDocument{\mathcode-="8000 }


Alternatively, there's \textminus in the TS1 encoding:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{libertine}
\usepackage{textcomp}
\usepackage{amsmath}
\begingroup\uccode~=-
\uppercase{\endgroup\def~}{\mathbin{\text{\textminus}}}
\AtBeginDocument{\mathcode-="8000 }

\begin{document}
$-$
\end{document}

-
But I need a minus, not the en dash...? –  Jörg Aug 24 '12 at 15:43
@Jörg There's no minus sign in the T1 encoding. –  egreg Aug 24 '12 at 16:28
Brilliant, thanks. But I think there is no need to load amsmath here. –  Jörg Aug 24 '12 at 17:52
Sorry, I'm lost. I do not understand that is intended here. Even zooming at huge font size, I cannot see any difference between the customized $-$ with \textminus nor the simple -- in text mode using this MWE. –  Fran Aug 24 '12 at 18:03
@Jörg You need at least amstext for \text`. –  egreg Aug 24 '12 at 19:42