39
$\begingroup$

Bug introduced in 10.0.0 and persisting through 10.3.0 or later


I've upgraded my home installation of Mathematica from version 9 to 10 today on a Windows 8.1 machine, and I'm getting a weird font issue - the fonts are not anti-aliased, and look unbalanced and weird. Just look:

HALP

For comparison, here what it looks on Linux with Mathematica V10

Mathematica graphics

At this point you may object, as these issues are too minor to get worked up about. But neither I nor my otherwise benign OCD can work like this. Any ideas?

EDIT I've just had an idea, that maybe I need to manually remove old fonts leftover from the old Mathematica 9 installation. I've read somewhere that they were not going to pollute the main font catalog with symbol fonts in the next release, and maybe the new Mathematica is using old fonts for some reason. I can't test it right now myself, unfortunately.

$\endgroup$
17
  • 2
    $\begingroup$ It is because you used UpperCaseFirstLetter. These are meant to be used by Mathematica only. Try it with lowerCaseFirstLetter as in foo[] instead of Foo[], it will look much better ! $\endgroup$
    – Nasser
    Commented Jul 16, 2014 at 22:56
  • 8
    $\begingroup$ Yeah, exactly. You don't even see what the hell I'm talking about; and it's driving me insane! It's not UpperCaseFirstLetter, though. Look at it, it's all messed up! Look at that equals sign. Why is one bar smaller than the other? $\endgroup$
    – Gleno
    Commented Jul 17, 2014 at 0:24
  • 5
    $\begingroup$ I don't have any fix, but thought I'd point out the M in "Halp Me plz!" is asymmetric too. $\endgroup$
    – evanb
    Commented Jul 17, 2014 at 0:26
  • 4
    $\begingroup$ I know I'm not helping, but that does look horrible $\endgroup$
    – acl
    Commented Jul 17, 2014 at 16:12
  • 6
    $\begingroup$ This was reproduced in my Mathematica 10.0.0 in Windows 7, 64 bit. In v9, I have never seen unbalanced "=" characters in any notebook magnifications. But in v10, I saw unbalanced ones in some magnifications. This is not an anti-aliasing problem (as you can see when you magnify fonts in screenshots). This seems to be the problem of showing specific characters such as "[", "_", "]", "=", etc. Interestingly, all of these characters seem to be rendered using MathematicaMono font which is introduced in v10. I found this when I "Save As" the notebook in PDF and open it in Adobe Illustrator. $\endgroup$ Commented Jul 19, 2014 at 15:30

3 Answers 3

42
+100
$\begingroup$

This problem is probably due to the MathematicaMono font which is introduced in v10.

Defining the problem:
Some fonts ("[","_","]","=", etc.) are rendered badly with strange thinning in v10 in some notebook magnifications. This is obvious when you compare the renderings from v10 with those from v9.

comparison v9 v.s. v10

Analyzing the problem:
I found that all of these ugly-looking fonts were rendered in MathematicaMono font (specifically, MathematicaMono-Bold.ttf font in this example) by using the method described in my comment for the question section. MathematicaMono fonts are new in v10: we only have fonts named Mathematica1Mono, Mathematica2Mono, and so on, up to v9. These results suggested that the problem is caused by the new MathematicaMono fonts.

Next, to test this hypothesis, I substituted the MathematicaMono-Bold.ttf by Mathematica1mb.ttf (which contains Mathematica1Mono-Bold font) copied from my v9 installation folder. I renamed the name property of Mathematica1mb.ttf by using FontForge program ("Mathematica1Mono-Bold" to "MathematicaMono-Bold") and installed in the v10 font folder as MathematicaMono-Bold.ttf.

After the substitution, the notebook was rendered as in v9 at least for characters like "_" and "=": v10 after font substitution

Sadly, "[" and "]" were not fixed because Mathematica1Mono font lacks glyph for these characters. But anyway, the substitution experiment partially confirmed my hypothesis.

What's wrong in MathematicaMono font?:
I have no answer yet. So I can not provide the complete solution. But I found a strange thing in MathematicaMono font. In all of the newly introduced MathematicaXXX.ttf fonts in v10, "Win Ascent" and "Win Descent" properties for OpenType fonts are in strangely big values (5000 and 3500) compared with the values in v9 Mathematica fonts (1747 and 479). This makes the previews of MathematicaXXX fonts small in a strange way when you open the fonts in Windows font viewer program. But, I could not fixed the original problem even when I edited "Win Ascent" and "Win Descent" values of MathematicaMono-Bold font in FontForge.

I hope my answer helps someone to solve this problem.

Update 7/22: I found a clear evidence that the problem is in the MathematicaMono fonts. After you "install" the MathematicaMono.ttf and MathematicaMono-Bold.ttf, you can use MathematicaMono fonts in softwere other than Mathematica. Here is the MathematicaMono fonts rendered in Microsoft Word:
MathematicaMono fots in MS Word
The rendering problems reported in Mathematica were completely reproduced in MS Word! This indicates that the problem is not in the Mathematica Front-end but in the font itself.

$\endgroup$
4
  • 1
    $\begingroup$ Thanks for all the investigative work! I just wish we could have found some kind of workaround, apart going to therapy of course. $\endgroup$
    – Gleno
    Commented Jul 26, 2014 at 17:16
  • 1
    $\begingroup$ I have the same problem here with Mathematica 10.0.1.+ Win 7. Does any body use Mathematica 10.0.2 have this problem? And are there good candidate math font for substitution? $\endgroup$
    – Nick
    Commented Feb 2, 2015 at 1:09
  • $\begingroup$ Half solution: The strange thinning/unevenness of the equal sign becomes normal when I set the magnification to 125%. And it turns to bad again on 150%. It switches between Good and Bad with the increase of magnification ratio. So wired! $\endgroup$
    – Nick
    Commented Feb 2, 2015 at 9:14
  • 1
    $\begingroup$ 10.2.0.0 has this bug as well. $\endgroup$ Commented Sep 6, 2015 at 18:11
7
$\begingroup$

I analyzed which fonts are loaded when starting Mma v10 compared to v9. The problem could be tracked down to the loading of the fonts in the Folder

$InstallationDirectory\SystemFiles\Fonts\TrueType

If you open Mathematica-Bold.ttf or MathematicaMono-Bold.ttf, you will see how ugly these are.

To prevent loading these fonts one should make a backup copy of this TrueType folder and than delete all .ttf files that are in it. A simple renaming of the folder increased the Mma startup time and is therefore not a good idea.

Edit/Warning:
AutoReplacements will not work after this customization!

$\endgroup$
2
  • $\begingroup$ I also tried to remove FrontEnd`FileName[{$InstallationDirectory, "SystemFiles", "Fonts"}] from the list in the Option Inspector: Global Options -> File Locations -> PrivatePaths -> "Fonts", but this did not solve the problem. $\endgroup$
    – Karsten7
    Commented Jul 20, 2014 at 1:43
  • 1
    $\begingroup$ Yes, how ugly they are! I moved these fonts away, some symbols could not displayed. (I know I probably should not do this.) Is there any high-quality math font we could substitute with them? $\endgroup$
    – Nick
    Commented Feb 2, 2015 at 1:01
2
$\begingroup$

As a follow-up to Tetsuo Ichii's answer, the thinnings observed in version 10 are also present in 11.0.1:

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.