1
$\begingroup$

Is it possible to control style of digits for a given font? In the following example 2nd, 3rd and 4th lines print old style digits. How to get linear digits for these fonts?

Style["abcxyz=0.123456789"]
Style["abcxyz=0.123456789", FontFamily -> "Cambria"]
Style["abcxyz=0.123456789", FontFamily -> "Constantia"]
Style["abcxyz=0.123456789", FontFamily -> "Corbel"]

Note that the fonts used in this example come with Microsoft Windows.

enter image description here

UPFATE: As indicated by Mr. Wizard, a solution is given in Accessing figure style (oldstyle or lining) of TrueType fonts .

But actually I want to use fonts with default OldStyle digits (e.g. Consolas or Corbel) for Ticks in Plot and similar routimes but I need Lining digits in the ticks instead of OldStyle. How to do that?

$\endgroup$
  • $\begingroup$ Can you provide evidence that these fonts contain both sets of glyphs? Some fonts have both, while others have only one. $\endgroup$ – Mr.Wizard Aug 15 '16 at 8:20
  • 1
    $\begingroup$ In any case this appears to be a duplicate of (88733) $\endgroup$ – Mr.Wizard Aug 15 '16 at 8:31
  • $\begingroup$ @Mr.Wizard: I am pretty sure of it. I am using these fonts with LaTeX where it is quite easy ti switch between old-style in linear digits. $\endgroup$ – Igor Kotelnikov Aug 15 '16 at 8:52
  • $\begingroup$ I am unable to find them. The closest I see are the subscript and superscript digits, e.g. Style["₀₁₂₃₄₅₆₇₈₉", FontFamily -> "Constantia", FontSize -> 24] (I am not sure how that will appear here.) If you feel that your question is substantively different from the question linked above please edit it to clarify how it is so; otherwise I shall mark it as a duplicate. On a personal note: Mathematica is sadly lacking in advanced typesetting controls; you are better off using $\LaTeX$ for such things IMHO. $\endgroup$ – Mr.Wizard Aug 15 '16 at 8:59
  • 1
    $\begingroup$ @Mr.Wizard: I extended my question. See update. $\endgroup$ – Igor Kotelnikov Aug 15 '16 at 12:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.