Show More
@@ -242,9 +242,16 b' div.text_cell_render {' | |||
|
242 | 242 | color: black; |
|
243 | 243 | } |
|
244 | 244 | |
|
245 | .CodeMirror span { | |
|
246 | vertical-align: bottom; | |
|
247 | } | |
|
245 | /* The following gets added to the <head> if it is detected that the user has a | |
|
246 | * monospace font with inconsistent normal/bold/italic height. See | |
|
247 | * notebookmain.js. Such fonts will have keywords vertically offset with | |
|
248 | * respect to the rest of the text. The user should select a better font. | |
|
249 | * See: https://github.com/ipython/ipython/issues/1503 | |
|
250 | * | |
|
251 | * .CodeMirror span { | |
|
252 | * vertical-align: bottom; | |
|
253 | * } | |
|
254 | */ | |
|
248 | 255 | |
|
249 | 256 | .CodeMirror { |
|
250 | 257 | line-height: 1.231; /* Changed from 1em to our global default */ |
@@ -41,31 +41,8 b' $(document).ready(function () {' | |||
|
41 | 41 | var nh = $('#test1').innerHeight(); |
|
42 | 42 | var bh = $('#test2').innerHeight(); |
|
43 | 43 | var ih = $('#test3').innerHeight(); |
|
44 | var dialog = $('<div/>'); | |
|
45 | 44 | if(nh != bh || nh != ih) { |
|
46 | dialog.html('We have detected that your browser is using a '+ | |
|
47 | '<span style="font-family: monospace;">monospace</span> font that has an '+ | |
|
48 | 'inconsistent size between '+ | |
|
49 | '<span style="font-family: monospace;">normal</span>, '+ | |
|
50 | '<span style="font-family: monospace; font-weight: bold;">bold</span>, and '+ | |
|
51 | '<span style="font-family: monospace; font-style: italic;">italic</span> '+ | |
|
52 | 'variants, which are used by IPython for syntax highlighting. '+ | |
|
53 | 'This will cause visual artifacts. (The font is probably "Courier New") '+ | |
|
54 | 'We recommend that you configure your browser to use a different '+ | |
|
55 | 'monospace font.<br/><br/>'+ | |
|
56 | 'normal='+String(nh)+'px bold='+String(bh)+'px italic='+String(ih)+'px'); | |
|
57 | $(document).append(dialog); | |
|
58 | dialog.dialog({ | |
|
59 | resizable: false, | |
|
60 | modal: true, | |
|
61 | title: "Bad fonts detected", | |
|
62 | closeText: '', | |
|
63 | buttons : { | |
|
64 | "Ok": function () { | |
|
65 | $(this).dialog('close'); | |
|
66 | } | |
|
67 | } | |
|
68 | }); | |
|
45 | $('head').append('<style>.CodeMirror span { vertical-align: bottom; }</style>'); | |
|
69 | 46 | $('#fonttest').remove(); |
|
70 | 47 | } |
|
71 | 48 |
General Comments 0
You need to be logged in to leave comments.
Login now