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

Underscores disappearing in IDEA IDEs (Hack-v2_013-ttf) #100

Closed
treybrisbane opened this issue Sep 14, 2015 · 33 comments
Closed

Underscores disappearing in IDEA IDEs (Hack-v2_013-ttf) #100

treybrisbane opened this issue Sep 14, 2015 · 33 comments
Assignees
Labels

Comments

@treybrisbane
Copy link

I've noticed that within IDEA IDEs (I've noticed this on both IntelliJ and PyCharm so far), underscores seem to be disappearing in what appears to be an issue related to how IDEA handles redraw regions for the caret's current line.

Note in the following screenshot how the caret's current line is highlighted, and the underscores are visible:
capture

Hack is designed such that underscores appear on the top-most pixels of the next line down. When the caret is moved down to the next line, the line highlighting follows it, and the underscores disappear:
capture2

What I suspect is happening is that IDEA is redrawing the current line after the caret moves down, (firstly the background to remove the line highlighting, then the text), but is NOT redrawing the line above. The result is that due to the underscores of the above line being within the redraw region of the current (highlighted) line, they get removed when the current line's background is redrawn to remove its highlighting.

@Huddo121
Copy link

I suspect you're correct. Below is a zoomed in view of the images posted, with the top layer set to 'difference'. As you can see the bottom of the 'p' characters are also being removed.

image

@chrissimpkins
Copy link
Member

This appears to be related to the issue in #45 (and I think that there is at least one other issue report of a similar problem). Can you also verify whether this is a text size dependent phenomenon? With the lowercase g strokes in #45, it only occurs at certain text sizes.

My thought is that this has something to do with the way that these editors are interpreting the vertical metrics of the fonts for the redraws (as you noted above).

@treybrisbane
Copy link
Author

Increasing the text size seems to yield no improvements, however, surprisingly, decreasing the text size to 10pt saw underscores rendered on the correct line, thus solving the issue.

Perhaps an issue may need to be filed with the JetBrains team?

@chrissimpkins
Copy link
Member

@Tbrisbane strange. OK, looking into it.

@chrissimpkins
Copy link
Member

The position of the underscore is too low in the source and it is off center. I will correct these and plan for this change to be in the next release.

As an aside, others have had issues with the width with some renderers. Does it appear too thin on your system?

@manuel-uberti
Copy link

They disappear in Emacs mode line too.

2015-09-17-175316_610x63_scrot

The actual folder is "dotted_line".

@treybrisbane
Copy link
Author

@chrissimpkins The width looks fine to me. :)

With regards to your planned fix for underscores - note that lower-case 'p' characters also lose their bottom-most pixels as mentioned by @Huddo121. I suspect the same will be true of any character with a low tail (lower-case 'y' would also be a good example), so if this isn't in fact a problem with IDEA's font handling, you may be looking at a 1px upwards bump for all glyphs in order to maintain consistency.

@chrissimpkins
Copy link
Member

I have been tinkering with the vertical metrics and am looking at metrics in other fonts. I suspect that this will lead to a fix but it is likely going to require iterations through these various editors and the patterns that you are using to make sure that we have it right.

@manuel-uberti I definitely agree. That is a problem.

Hope to have the first new build out this weekend so that we can see if it helps.

@treybrisbane
Copy link
Author

Excellent. Happy to work with you to resolve this! :)

@chrissimpkins
Copy link
Member

New test build v2.014 (ttf only) is now available and I hope that it addresses the issues that you reported here. The underscore centering, size, and vertical alignment were updated. The vertical metrics of the fonts were updated.

The files are available in #111. Please let me know how they work and what your thoughts are on the new, tighter vertical metrics as well as the new underscore characters.

@manuel-uberti
Copy link

@chrissimpkins thanks, I'll try it asap.

@chrissimpkins
Copy link
Member

From the #111, comment by @Tbrisbane re: changes in the v2.014 ttf file build

PyCharm still has issues with some characters' tails disappearing ('p', 'y', 'g', 'j', etc), however, strangely, these issues are NOT present in IntelliJ

I scanned the above posts and don't see that we addressed your platform and the version of the PyCharm and IntelliJ editors. Mind posting this information and letting me know if they are current builds vs. development/prelease builds? Any chance that this is a font caching issue and a reboot takes care of it in PyCharm?

@manuel-uberti
Copy link

Looks good on Emacs now:
2015-09-21-151434_595x63_scrot

@chrissimpkins
Copy link
Member

@manuel-uberti 👍 great!

@chrissimpkins
Copy link
Member

@manuel-uberti looks like the dash and colon aren't aligned for you. Someone reported this issue in the context of this combo :=. I might raise the colon slightly in the upcoming release as well to address this. Any thoughts on this and anywhere that you see this causing other problems?

@chrissimpkins
Copy link
Member

@manuel-uberti This is in #66. Probably more appropriate to comment over there as it is a separate issue.

@manuel-uberti manuel-uberti mentioned this issue Sep 21, 2015
@treybrisbane
Copy link
Author

@chrissimpkins Good point.

  • OS: My OS is Windows 10 Professional x64
  • IntelliJ: 14.1.4 Ultimate
  • PyCharm: 4.5.4 Professional

No chance of font caching issues, since the updated build resolves the issues with underscores in PyCharm (just not the tails of characters). To be safe, I both rebooted and cleared the Windows Font cache, to no avail.

Some additional info though - In PyCharm, changing the font size yields the following results:

  • 1pt-11pt: Resolves all issues
  • 12pt: Tails are 1px too low
  • 13pt-16pt: Resolves all issues
  • 17pt-18pt: Tails are 1px too low
  • 19pt-22pt: Resolves all issues
  • 23pt: Tails are 2px too low (now it's 2px off, but I suspect the difference relative to the font size is the same, if that makes sense)

@chrissimpkins
Copy link
Member

@Tbrisbane I was under the impression these JetBrains editors were using the same Java font renderer. Do you happen to have different line spacing settings in the two editors or different syntax highlighters that might be doing something different with the text display between the two editors?

@treybrisbane
Copy link
Author

@chrissimpkins I too was under this impression. Same font size, same line-spacing. I know they syntax-highlight in slightly different ways (due to the different languages), but that doesn't affect the size in any way I can see.

I'll take another look through the settings in case I just happened to miss something, but this is very strange.

@chrissimpkins
Copy link
Member

can you show me a screenshot of what you are seeing in PyCharm? I will try it in PyCharm on OS X and compare.

@treybrisbane
Copy link
Author

Sure:
capture

And here's a resized sized version for clarity (naturally, you'll need to open the full-size version):
capture2

Note how on the highlighted line underscores are correctly positioned, however the 'g', 'p', comma, and 'y' characters all go 1px below the line.
If you look at the line above, you'll see the resulting cut-off of those characters (the 'g' is the most prominent example of that).

@chrissimpkins
Copy link
Member

Here is what I am seeing on OS X 10.10.5 in PyCharm Professional 4.5.4:

2015-09-21 at 9 03 pm

Bottom is a highlighted line. Top is not. I am not seeing any overlap between the line highlighting and the tails of characters in the line above. The highlighted area seems to extend too high on your platform and is eliminating the render of the tails on the glyphs on the line above.

Do you happen to see this in any non-JetBrains editors?

@treybrisbane
Copy link
Author

Very strange.

I've tried both Sublime Text 3 and even Notepad - neither exhibit this problem. I'm currently researching this issue to see if it's part of a wider-known problem.

@skewty
Copy link

skewty commented Sep 22, 2015

I submitted the issue to JetBrains. Here is the link:

https://youtrack.jetbrains.com/issue/IDEA-144785

@chrissimpkins
Copy link
Member

@skewty thanks! will keep an eye on it

@treybrisbane
Copy link
Author

@skewty Thanks also. :) I added a bit of info to it in case they miss it here.

@chrissimpkins I've been unable to find a known cause for this, myself. Given that the font works perfectly in Sublime and IntelliJ, I'm definitely of the opinion it's a PyCharm specific issue. Hopefully we'll see some input from JetBrains on it, but either way, thanks for your efforts thus far! :)

@chrissimpkins
Copy link
Member

@Tbrisbane it's my pleasure. Will be interesting to see what JetBrains has to say. We've encountered a number of issues in their editors that don't seem to happen in other editors. I would like to hear more about the Java based renderer that they are using.

@chrissimpkins
Copy link
Member

The issue remains under discussion on the JetBrains issue tracker. Still unresolved at this point. See @skewty comment above for link.

@chrissimpkins
Copy link
Member

@skewty & @Tbrisbane any progress on this issue over on the JetBrains side?

@treybrisbane
Copy link
Author

@chrissimpkins None as of yet, however at this stage they don't require any additional information from us.

@chrissimpkins
Copy link
Member

@Tbrisbane thanks much. Haven't seen any information in that thread that points to the cause.

@treybrisbane
Copy link
Author

@chrissimpkins This appears to be fixed in the v2.015 build, and JetBrains have closed the issue on their end for that reason. I think we can resolve this! :D

@chrissimpkins
Copy link
Member

@Tbrisbane thank you!

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

No branches or pull requests

5 participants