Skip to content

Commit

Permalink
Use "Courier New" as monospaced font for text drawer. (#2816)
Browse files Browse the repository at this point in the history
* from unittest.mock import patch

* .

* line-heigh and background

* Courier New

* adjust test
  • Loading branch information
1ucian0 committed Jul 18, 2019
1 parent 515a2a3 commit bfd1f85
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions qiskit/visualization/text.py
Expand Up @@ -459,8 +459,9 @@ def __str__(self):
def _repr_html_(self):
return '<pre style="word-wrap: normal;' \
'white-space: pre;' \
'line-height: 15px;' \
'font-family: SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace">' \
'background: #fff0;' \
'line-height: 1.1;' \
'font-family: &quot;Courier New&quot;,Courier,monospace">' \
'%s</pre>' % self.single_string()

def _get_qubit_labels(self):
Expand Down
6 changes: 3 additions & 3 deletions test/python/visualization/test_circuit_text_drawer.py
Expand Up @@ -540,9 +540,9 @@ def test_text_measure_html(self):
""" The measure operator. HTML representation. """
expected = '\n'.join(["<pre style=\"word-wrap: normal;"
"white-space: pre;"
"line-height: 15px;"
"font-family: SFMono-Regular,Consolas,Liberation Mono,Menlo,"
"Courier,monospace\">"
"background: #fff0;"
"line-height: 1.1;"
"font-family: &quot;Courier New&quot;,Courier,monospace\">"
" ┌─┐",
"q_0: |0>┤M├",
" └╥┘",
Expand Down

0 comments on commit bfd1f85

Please sign in to comment.