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
Fix vertical offset due to bold/italics, and bad browser fonts. #1883
Conversation
Hi Bob, I have tested this pull request and it does fix the problem!! So I am +1. We all owe you a beer for fixing this, thanks so much for your work! |
Mmh, this is odd... I reverted to Courier New on Chrome 19 to try to see the problem (my monospaced font is normally Consolas, that doesn't have the bug). But it seems to me that this PR makes things worse, not better... With master, I get: But with this PR, I see this instead: It seems to me that with this PR, the bold words are clearly pixel off from the rest... Am I misunderstanding something? |
Well, poop. That didn't happen for me. You could try the other vertical-align If it doesn't, we'll have to just remove the bold/italic. Fernando Perez [reply@reply.github.com] wrote:
"The individual has always had to struggle to keep from being overwhelmed by |
On Sat, Jun 9, 2012 at 9:23 AM, Bob McElrath
Nope, I see the same behavior with all, very strange. Linux 12.04, Chrome 19.
You don't mean permanently disabling bold/italic from our syntax It's very unfortunate that we're hit by this font/chrome bug, but if """ ... and as far as we know, the ones to avoid are: .... """ While we strive hard to provide good defaults out of the box for new The removal of bold/italics would degrade the editing experience |
Fernando Perez [reply@reply.github.com] wrote:
I would hope having users run into this bug, and be unable to edit text in the
As I mentioned before, I think it may be possible to detect this situation by I think no one would read a novel about browser bugs on the website. Cheers, Bob McElrath "The individual has always had to struggle to keep from being overwhelmed by |
On Sat, Jun 9, 2012 at 2:05 PM, Bob McElrath
Oh, how does it prevent editing? What I see are ugly but purely |
Fernando Perez [reply@reply.github.com] wrote:
Once you have more than about 10 lines with some bold/italics, the cursor is Cheers, Bob McElrath "The individual has always had to struggle to keep from being overwhelmed by |
On Sat, Jun 9, 2012 at 2:25 PM, Bob McElrath
Ah, I see that now... OK, that's indeed horrible and completely unacceptable, since it I tested and with this PR, the slightly wonky looking pixel offset of In light of this discussion, my vote would be to merge this PR:
Would you agree? |
I added to this branch a method to detect the bad font situation, and inform the user. With that, I'd be happy reverting the Does |
No, I didn't see any other problems with Consolas one way or another. |
OK, this is great, esp. with the new dialog warning. Awesome job, @mcelrath! I'm going to merge it now, it's seen enough review and it does address a pretty serious problem. Thanks! |
Fix vertical offset due to bold/italics, and bad browser fonts. Adds a dialog warning users when a problematic monospaced font is detected, so they can change their configuration.
Hi, sorry that I didn't manage to reply over the weekend. Yes, previously the notebook was pretty much unusable in my Chrome, as Bob explained. This pull request makes it usable again. However, the dialog is super annoying. I understand what the issue is and I don't mind one pixel discrepancy. I don't want to touch my Chrome setting, I am happy with the way it is. Right now every time I refresh a page or open any notebook a dialog pops up. I wonder what other solutions could be applied. Maybe reporting the issue into Chrome bug tracker and then adding a non-intrusive note somewhere near the top of the page, saying "Note: your Chrome broswer suffers from the bug ##### (+link), the fonts will be one pixel off." And the user could click the link to learn more about the bug. And one could close this note, or just leave it be. Bob --- do you think I should report this bug into the Chrome bug tracker? |
You really want to stay with that font? I was just too lazy to change it Anyway, I was also thinking of silently applying the 'vertical-align: bottom' Ondřej Čertík [reply@reply.github.com] wrote:
"The individual has always had to struggle to keep from being overwhelmed by |
The dialog pretty much forces me to change the font. It's not such a big deal, so I will just change it and be done with it. But in general I think that ipython should not force users to change their fonts. |
I just looked at the options for vertical-align, with Courier New, and they're The reason I made a dialog is because I was worried about having IPython look I was also worried about future people working on IPython having a very hard So: I just pushed a patch which silently applies a fix, and adds a commented-out I'll let the lead developers decide which solution they like better. Cheers, Bob McElrath "The individual has always had to struggle to keep from being overwhelmed by |
Bob, would you mind creating the bug in Chrome's bugtracker? You have much more knowledge about this than I do. From what you say, it seems to me, that this is indeed a clear bug in either the font or Chrome. Then we can maybe leave the modal dialog, but add there a link to this bug, so that users understand, that this is a bug in Chrome that needs to be fixed, that makes IPython look crappy. |
The bug is in the font. I reproduced it in Firefox too. The fonts in question are 20-year old Microsoft fonts that probably, no one I think the bug should be considered in CodeMirror, for not measuring the height Ondřej Čertík [reply@reply.github.com] wrote:
"The individual has always had to struggle to keep from being overwhelmed by |
Ah, thanks for the clarification. So I can see now that if it is a bug in the font as well as it is some old font, the solution really is to change the font. So I did that. I just assumed that I was using the Ubuntu default's settings and then no program should force me to change it just to work. |
Still, given the experience Ondrej reports, I'm having second thoughts about the dialog too... I can imagine being in an environment where you can't change the settings (a lab computer at a school) and being driven absolutely bonkers by the dialog popping up on every file open. Should we reconsider that dialog? |
Playing with css I found that the Thanks. |
Fix vertical offset due to bold/italics, and bad browser fonts. Adds a dialog warning users when a problematic monospaced font is detected, so they can change their configuration.
The identified bad mono fonts are "Courier New" from Microsoft's Core fonts:
http://en.wikipedia.org/wiki/Core_fonts_for_the_Web
and Nimbus Mono L
http://en.wikipedia.org/wiki/Nimbus_Mono_L
The bold/italic variants evidently don't have a consistent baseline. This is completely fixed by setting the vertical-align property on the span tag. (Yes, it has to be the span tag, putting it on the div or pre doesn't work)
This fixes #1503.