Show More
@@ -284,9 +284,16 b' div.text_cell_render {' | |||||
284 | color: black; |
|
284 | color: black; | |
285 | } |
|
285 | } | |
286 |
|
286 | |||
287 | .CodeMirror span { |
|
287 | /* The following gets added to the <head> if it is detected that the user has a | |
288 | vertical-align: bottom; |
|
288 | * monospace font with inconsistent normal/bold/italic height. See | |
289 | } |
|
289 | * notebookmain.js. Such fonts will have keywords vertically offset with | |
|
290 | * respect to the rest of the text. The user should select a better font. | |||
|
291 | * See: https://github.com/ipython/ipython/issues/1503 | |||
|
292 | * | |||
|
293 | * .CodeMirror span { | |||
|
294 | * vertical-align: bottom; | |||
|
295 | * } | |||
|
296 | */ | |||
290 |
|
297 | |||
291 | .CodeMirror { |
|
298 | .CodeMirror { | |
292 | line-height: 1.231; /* Changed from 1em to our global default */ |
|
299 | line-height: 1.231; /* Changed from 1em to our global default */ |
@@ -41,33 +41,10 b' $(document).ready(function () {' | |||||
41 | var nh = $('#test1').innerHeight(); |
|
41 | var nh = $('#test1').innerHeight(); | |
42 | var bh = $('#test2').innerHeight(); |
|
42 | var bh = $('#test2').innerHeight(); | |
43 | var ih = $('#test3').innerHeight(); |
|
43 | var ih = $('#test3').innerHeight(); | |
44 | var dialog = $('<div/>'); |
|
|||
45 | if(nh != bh || nh != ih) { |
|
44 | if(nh != bh || nh != ih) { | |
46 | dialog.html('We have detected that your browser is using a '+ |
|
45 | $('head').append('<style>.CodeMirror span { vertical-align: bottom; }</style>'); | |
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 | }); |
|
|||
69 | $('#fonttest').remove(); |
|
|||
70 | } |
|
46 | } | |
|
47 | $('#fonttest').remove(); | |||
71 |
|
48 | |||
72 | if(IPython.read_only){ |
|
49 | if(IPython.read_only){ | |
73 | // hide various elements from read-only view |
|
50 | // hide various elements from read-only view |
General Comments 0
You need to be logged in to leave comments.
Login now