diff --git a/IPython/frontend/html/notebook/static/css/notebook.css b/IPython/frontend/html/notebook/static/css/notebook.css index 3202f37..684735d 100644 --- a/IPython/frontend/html/notebook/static/css/notebook.css +++ b/IPython/frontend/html/notebook/static/css/notebook.css @@ -242,9 +242,16 @@ div.text_cell_render { color: black; } -.CodeMirror span { - vertical-align: bottom; -} +/* The following gets added to the if it is detected that the user has a + * monospace font with inconsistent normal/bold/italic height. See + * notebookmain.js. Such fonts will have keywords vertically offset with + * respect to the rest of the text. The user should select a better font. + * See: https://github.com/ipython/ipython/issues/1503 + * + * .CodeMirror span { + * vertical-align: bottom; + * } + */ .CodeMirror { line-height: 1.231; /* Changed from 1em to our global default */ diff --git a/IPython/frontend/html/notebook/static/js/notebookmain.js b/IPython/frontend/html/notebook/static/js/notebookmain.js index 69562d1..db2b61f 100644 --- a/IPython/frontend/html/notebook/static/js/notebookmain.js +++ b/IPython/frontend/html/notebook/static/js/notebookmain.js @@ -41,31 +41,8 @@ $(document).ready(function () { var nh = $('#test1').innerHeight(); var bh = $('#test2').innerHeight(); var ih = $('#test3').innerHeight(); - var dialog = $('
'); if(nh != bh || nh != ih) { - dialog.html('We have detected that your browser is using a '+ - 'monospace font that has an '+ - 'inconsistent size between '+ - 'normal, '+ - 'bold, and '+ - 'italic '+ - 'variants, which are used by IPython for syntax highlighting. '+ - 'This will cause visual artifacts. (The font is probably "Courier New") '+ - 'We recommend that you configure your browser to use a different '+ - 'monospace font.

'+ - 'normal='+String(nh)+'px bold='+String(bh)+'px italic='+String(ih)+'px'); - $(document).append(dialog); - dialog.dialog({ - resizable: false, - modal: true, - title: "Bad fonts detected", - closeText: '', - buttons : { - "Ok": function () { - $(this).dialog('close'); - } - } - }); + $('head').append(''); $('#fonttest').remove(); }