Am 20.05.2013 um 23:04 schrieb Romain Diss <romain.d...@yahoo.fr>:

> Le lundi 20 mai 2013, Alan BRASLAU a écrit :
>> On Mon, 20 May 2013 22:29:22 +0200
>> Romain Diss <romain.d...@yahoo.fr> wrote:
>>> The °C symbol is missing in math mode with the dejavu font. I thought
>>> that this should be handled by using the '°' + 'C' symbols instead
>>> but it is not the case.
>>> Is that a bug?
>>> What can I do to get the °C symbol with this font?
>> With dejavu, A, B, and D all work, but C is missing a symbol.
>> A 100℃
>> B 100°C
>> C $100℃$
>> D $100°C$
> The question is: do \unit is supposed to handle this case and automatically 
> switch from C to D if C is missing.
> If not, how can I tell \unit that C is missing and that I want \unit{celsius} 
> to use D?


Hans can add a check for math mode for the symbol:

\unprotect

\unexpanded\def\checkedtextcelsius
  {\ifmmode
     \phys_units_text_celsius
   \else\iffontchar\font"2103\relax
     ℃\else\phys_units_text_celsius
   \fi\fi}

\unexpanded\def\checkedtextfahrenheit
  {\ifmmode
     \phys_units_text_fahrenheit
   \else\iffontchar\font"2109\relax
     ℉\else\phys_units_text_fahrenheit
   \fi\fi}

\protect

\setupbodyfont[dejavu]

\starttext
  Temperature : \unit{100 celsius} works.\par
  Temperature : \m{\unit{100 celsius}} doesn't work.
\stoptext

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to