正在更改Jupyter Notebook在VSCode中输出的字体类型



我需要帮助更改Jupyter Notebook中输出的字体。不久前,VSCode更新了,我看到输出字体从Consolas改为Segoe UI。我如何将其还原?

这似乎是1.65版本的新渲染器的错误(链接(。

一个变通办法是回到1.64.2。Jupyter扩建项目也需要降级。

command+shift+p,然后VS代码栏将打开添加>并搜索"打开设置(UI(";

快速:直接键入";字体"在";搜索设置";并向下滚动以查看";字体系列"在编辑器中,您可以添加所需的字体系列。

只需在代码的开头插入即可

# Fix for Visual Studio Code
from IPython.core.display import HTML
HTML(r"""
<style>
* {
#color: red;
#font-family: ‘Cascadia Code PL’;#,‘Courier New’, Courier, monospace; 
font-family: ‘Courier New’, Courier, monospace; 
font-size: 10px !important;
line-height: 1.1 !important;
}
.output-plaintext, .output-stream, .output {
font-family: ‘Courier New’, Courier, monospace; # Any monospaced font should work
line-height: 1.3 !important;
font-size: 12px !important;
}
</style>
""")

最新更新