Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fonts gone crazy after installing v2_018 on Jetbrains [Java renderer] #152

Closed
rahilwazir opened this issue Nov 6, 2015 · 78 comments
Closed

Comments

@rahilwazir
Copy link

Fonts gone crazy after installing the v2.018 but its working fine with v2.010, I did restart Jetbrain IDE. Increasing/Decreasing font have still same effect.

crazy-fonts

@rahilwazir rahilwazir changed the title Fonts gone crazy after installing v2_018 Fonts gone crazy after installing v2_018 on Jetbrains Nov 6, 2015
@chrissimpkins
Copy link
Member

Thanks for reporting it. Can you give us your platform, the editor, and indicate whether you are using the ttf or otf builds?

@rahilwazir
Copy link
Author

Sure, here you go

@rahilwazir
Copy link
Author

Not sure should I open a new issue for this or not but using v2.010 shows same wierd fonts on multiline comments, when writing /** (double asterik)

Example:

code-comments-crazy-fonts

@chrissimpkins
Copy link
Member

We will take a look into the initial issue that you reported. This was a direct upgrade from the v2.010 to the v2.018 release?

@rahilwazir
Copy link
Author

Yes It was

@chrissimpkins
Copy link
Member

thanks!

@fruel
Copy link

fruel commented Nov 29, 2015

Did a direct update from v2.010 to v2.018 today too.
Visual Studio, Sublime Text 3 and all other editors are fine but all JetBrains IDEs are messed up (Android Studio 1.5, PHPStorm 10, IntelliJ 15).

System:
Windows 10 Pro x64
Installed TTF version.

Never had any rendering issues prior to v2.018.

@chrissimpkins
Copy link
Member

are messed up

Can you be more specific? Are you seeing character changes like in the OP image?

@fruel
Copy link

fruel commented Nov 29, 2015

Sorry forgot - pretty much the same as OP reported it.

Example: Laravel composer.json file
image

Edit:

It should look like this:
image

And this is the settings dialog:
image
image

@chrissimpkins
Copy link
Member

Seems to be some strange Windows + JB renderer-specific issue. Here is where I am in PyCharm 4.5 (old version) and the current PyCharm 5.0.2 release:

PyCharm 4.5

pycharm4

PyCharm 5.0.2

pycharm5

My understanding is that PyCharm uses the same Java based text renderer. I modified the text size to 12 and have line spacing at 1.0. This does not seem to influence the display on OS X.

Are either of you willing to submit an issue report on the JetBrains tracker to investigate this? I don't develop on a Windows platform and it will be difficult for me to work through the issue with them. I'd be happy to follow the thread, pitch in information from the standpoint of our fonts (including OpenType table settings if that is where this winds up existing) and implement any changes that they recommend if they are able to identify what is going on with the renderer in the Windows editors.

@chrissimpkins
Copy link
Member

Will take a look at a diff of our OpenType table data between the 2.010 and 2.018 versions this week as well. Perhaps this will lead to some useful information.

If you are willing to take the time, would it be possible to check each of the release versions between 2.010 and 2.018 to determine where we introduced the problem? This might point us in the direction of an answer if it lies in the OpenType table settings.

@fruel
Copy link

fruel commented Nov 29, 2015

It seems to be a general issue with the Java font renderer - not specific to JetBrains IDEs.

I wrote a quick test application using the generic Java Swing GUI system. It prints the text "Hello World" twice - on the left using Hack and on the right using the default monospaced font.

image

Sourcecode: https://gist.github.com/fruel/1e4471b5474708f9c3e1

Maybe someone else can confirm that other Java-based application are affected too.

Edit:
My Java version

java version "1.8.0_66"
Java(TM) SE Runtime Environment (build 1.8.0_66-b18)
Java HotSpot(TM) 64-Bit Server VM (build 25.66-b18, mixed mode)

@fruel
Copy link

fruel commented Nov 29, 2015

Tested the old versions with the test application from the comment above. The issue starts with v2.017.
v2.015 and v2.016 (from here #126) are fine.

@chrissimpkins
Copy link
Member

@fruel Thank you! I will take a look at our OpenType table changes between those versions.

Are you aware of other text editors that use this renderer?

@chrissimpkins
Copy link
Member

Are the editors here being released with a bundled JDK? That seems to be the case on OS X.

@fruel
Copy link

fruel commented Nov 29, 2015

I tested a few other applications with v2.0.17:

jEdit
http://sourceforge.net/projects/jedit/
Is affected by the bug and has definitely no bundled JRE.

eclipse
Version: Mars.1
Not affected
Don't think it has a bundeled JRE.

NetBeans 8.1
Affected
Not sure if JRE is bundled.

I think NetBeans and jEdit use the same GUI system whereas eclipse uses something different. (NetBeans and jEdit have similar look & feel and the font-selection dialogs are identical)

Wikipedia confirms this:

Eclipse implements the graphical control elements of the Java toolkit called SWT, whereas most Java applications use the Java standard Abstract Window Toolkit (AWT) or Swing. 

@chrissimpkins
Copy link
Member

@fruel Thank you very much for all of this information. This is extremely helpful. I will post some information about the differences in our OpenType tables between the identified versions this week.

@fruel
Copy link

fruel commented Nov 29, 2015

New discovery:

I have multiple Java versions installed and only older ones are affected. When installing NetBeans it seems the installer changed the default Java runtime as Hack v2.018 is now working everywhere except in NetBeans.

I tested this manually with the my test application from above:
v2.018 works fine in my test application with JRE 1.8u66 x64 and JDK 1.8u66 x64 but not with JDK 1.8u51 x64 or JDK 1.7u55 x86

What Java version do you have on OSX?

@chrissimpkins
Copy link
Member

java version "1.8.0_05"
Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode)

@fruel
Copy link

fruel commented Nov 29, 2015

OK...this thing is getting really weird....

If I start my test application from the command line using 1.8u51 it does not work but IntelliJ claims to be running with 1.8u51 and it is working now:

image

image

Edit: Of course I restarted all applications every time the Hack version changed

Edit2: Ok...IntelliJ uses a bundled JRE - but why did Hack start to work after installing NetBeans...really weird

@chrissimpkins
Copy link
Member

PyCharm v5.0.2 on OS X:

jre-version

Different than the installed version on my PATH.

@chrissimpkins
Copy link
Member

Please reopen if this remains an issue for you.

@rahilwazir
Copy link
Author

I'm not sure why did you close this issue, but this issue still exist with latest Webstorm v11.0.2 and JDK v8u65

@chrissimpkins chrissimpkins reopened this Dec 16, 2015
@chrissimpkins
Copy link
Member

@rahilwazir More than happy to continue to help here though I am not on Windows and cannot reproduce the issue on OS X versions of JetBrains editors.

@fruel would you be willing to release that code that you used to render fonts with Java? This would be an extremely helpful tool for us and might help us locate the problematic JRE versions. Perhaps with this information, one of the two of you could submit an issue report on the JetBrains issue tracker so that we can explore this in more detail.

@chrissimpkins chrissimpkins changed the title Fonts gone crazy after installing v2_018 on Jetbrains Fonts gone crazy after installing v2_018 on Jetbrains [Java renderer] Dec 16, 2015
@fruel
Copy link

fruel commented Dec 16, 2015

You can find the source code for my demo application linked im my comment from Nov. 29. It's a basic java window.

It still does not work for me in Android Studio but it works in PHPStorm - I'm not sure why or what version of java are affected as it behaved really weird.

@rahilwazir
Copy link
Author

@chrissimpkins Yeah both approaches works, @yoyosan solution is other way around

@chrissimpkins
Copy link
Member

I will add this to the README and let you know when it is available. Thanks again. Odd problem.

@chrissimpkins
Copy link
Member

README updated with workaround for this issue. Users are still having the problem and the issue report remains open on the JetBrains tracker. Will continue to leave the issue open here for reference.

@rahilwazir
Copy link
Author

@chrissimpkins The issue is closed now

@chrissimpkins
Copy link
Member

Alright, I will close this issue. Thanks for raising it @rahilwazir

@texhex
Copy link
Member

texhex commented Feb 7, 2016

@fruel I know this issue is closed, but just for the sake of documentation: The issue that you suddenly had a C:\Windows\Fonts\Hack_Regular.ttf and some C:\Windows\Fonts\Hack_Regular**0**.ttf file is caused by the _Fonts applet.

As soon as you open C:\Windows\Fonts (or use _Fonts_ from Control Panel) and then drag&drop a TTF file that is already there and/or locked, Windows will decide to copy the file as OrignalFileName**_0**.ttf. This doesn't make any sense, but that's what the coder of the Microsoft.Fonts applet did.

@chrissimpkins
Copy link
Member

@texhex Thank you for this information Michael. Appreciate the feedback. Odd that the duplicates that include different file paths lead to such problems...

@rahilwazir
Copy link
Author

@texhex Nice to know, thanks for the inside

@iflp
Copy link

iflp commented Mar 21, 2016

Does anyone have this this issue after upgrading to webstorm 2016?

@rahilwazir
Copy link
Author

@ragingnerd Well you are correct, I forgot to comment here.

@chrissimpkins Can you look into this? PHPStorm 2016 causes this behavior again, even deleting old fonts before installing the new one.

OS: Windows 10 x64,
IDE: PHPStorm 2016.1

@chrissimpkins
Copy link
Member

@ragingnerd @rahilwazir

Can you both confirm that you do not have duplicate fonts as a result of the Fonts applet issue that @texhex reported in #152 (comment)?

@iflp
Copy link

iflp commented Mar 21, 2016

@chrissimpkins

I think that might be the root cause. Font properties for the individual types show up as:

  • Hack-BoldItalic_0.ttf
  • Hack-Italic_1.ttf
  • Hack-Bold_2.ttf
  • Hack-Regular_3.ttf

but all my system fonts have a suffix of _3 (Eg. arial_3.ttf)

I've tried uninstalling the font, doing a clean reboot and reinstalling the fonts by clicking on them individually, then invalidating cache and restarting the ide.

OS: Windows 8.1 x64
IDE: WebStorm 2016.1

@chrissimpkins
Copy link
Member

@ragingnerd any idea how those numbers are being applied? Is that install order or is Windows supplementing the file path with variant meta info through the number? This numbering system in the file paths (on clean installs) seems to be a new Windows issue. I wonder if we are dealing with a change in Windows rather than the JetBrains editors.

@iflp
Copy link

iflp commented Mar 21, 2016

@chrissimpkins no idea at this stage. I've tried reinstalling 2.019 and 2.018 .TTF fonts, the number of times / order I install the fonts in have no bearing on the numbers. I've also tried installing the Hack OTF fonts - no suffixes.

@chrissimpkins
Copy link
Member

@ragingnerd thank you for checking! do you see this problem with the otf builds?

@iflp
Copy link

iflp commented Mar 21, 2016

@chrissimpkins no problem! 2.019 .OTF Bold is fine, the other 3 have _0 appended to them - IDE renders everything in bold.

@chrissimpkins
Copy link
Member

@texhex I think we may need your expertise here. Any thoughts about these issues with the Windows installs?

@texhex
Copy link
Member

texhex commented Mar 21, 2016

@chrissimpkins OK, I will do my very best. Let's see if this is enough :)

@ragingnerd First, we should remove anything "Hack" related in order to have a clean state. Please first go to the Fonts applet (Right-click on Start menu -> Control Panel -> Appearance -> Fonts). Search for Hack and hit delete. Windows should then delete the fonts. If it says something about File XXX in use, can't delete don't worry. Next, restart the machine. Trust me, Windows requires this because of all the caching it does. Once the machine is back, fire up Regedit.exe and move to

HKEY_LOCAL_MACHINE -> SOFTWARE -> Microsoft -> Windows NT -> CurrentVersion -> Fonts

Inside this, locate the entries ("Name") starting with Hack (TrueType) etc. and delete them. Also, check if the column "Data" lists anywhere any Hack_XX.ttf entries. If so, delete them.

Finally, below "Fonts" inside regedit.exe (left side) is another entry called FontSubstitutes. Check if there are any entries listed with "Hack". If so, delete them.

Restart the machine.

Move back to the Fonts applet and check if there is still something "Hack" related listed.
If so delete it and recheck the registry again. There shouldn't be anything, but you never now.

Finally, we do a check if really a files are gone. Open CMD.EXE and execute dir "C:\Windows\Fonts\Hack*.*". There should be no result. If there are files listed, delete them.

Restart the machine one final time. Recheck WebStorm. It shouldn't list Hack anymore and using any other font should be OK. If it still lists Hack, please let me know. In this case we might have the rare case of a damaged Font Cache 3.0 which requires stopping the "Windows FontCache" service and deleting the "FontCache3.0_.dat" file in _C:\Windows\ServiceProfiles\LocalService\AppData\Local*.

Then try to install Hack again by drag&drop the TTF file to the fonts applet. And you know it already: Restart the machine after that before trying to use the font.

That's all I can think of right now. HTH!

P.S.: If you think the font handling of Windows is b0rken by design: I couldn't agree more :).

@chrissimpkins
Copy link
Member

@texhex Wow, that is a convoluted mess on Windows. It sounds like Windows doesn’t intend to have fonts updated very often. Thanks so much for all of this information. @rahilwazir @ragingnerd please let us know if the above works for you.

@texhex
Copy link
Member

texhex commented Mar 21, 2016

@chrissimpkins Yes, it's a total mess. The main problem is that Windows has several "data stores" (Files, Registry, Cache) and no sanity check in place if this all makes sense. I would assume that single coder, that has the full backup from the Windows lead, could get all this sorted out in less than two weeks or so. But hey, it only took them two Windows version to bring the start menu back :-).

@rahilwazir
Copy link
Author

@chrissimpkins Well that actually works 😄

Thanks @texhex once again, so weird shit going on

@chrissimpkins
Copy link
Member

@texhex 👍 !!

@iflp
Copy link

iflp commented Mar 22, 2016

@texhex @chrissimpkins All sorted, thanks for your help!

Btw for anyone having the same problem, when I do a dir "C:\Windows\Fonts\Hack*.*", there are hack files but they are hidden on the font applet. I had to del dir "C:\Windows\Fonts\Hack*.*" on an elevated cmd to get rid of it.

@texhex
Copy link
Member

texhex commented Mar 22, 2016

@ragingnerd Good to hear. Finally you can enjoy the most awesome font ever :-).

Blunt self promotion: I have create a setup.exe for Hack (and some other fonts) that should make installation on a new machine rather easy. It takes also care about those Hack_0/1/2.ttf files and about the Font Cache service(s). You might want to give it a try for the next machine: OS Font Pack.

Note: This setup is not approved by @chrissimpkins, but I hope some day it will.

@chrissimpkins
Copy link
Member

I hope some day it will

I will try to get the docs updated this week. Sorry for the delay and thanks again!

@texhex
Copy link
Member

texhex commented Mar 22, 2016

@chrissimpkins No rush needed Chris, I just wanted to make sure that the setup is not "official". The message wasn't intend to push you to anything. Really.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

6 participants