Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] 如何修改 Monaco 编辑器的配置? #325

Open
TTsdzb opened this issue Oct 29, 2024 · 1 comment
Open

[Question] 如何修改 Monaco 编辑器的配置? #325

TTsdzb opened this issue Oct 29, 2024 · 1 comment

Comments

@TTsdzb
Copy link

TTsdzb commented Oct 29, 2024

在使用脚本编辑器模式时,个人认为默认的字体可读性较差:

image

我希望通过某种方式自定义字体和字号,但没有在 GUI 中找到相关入口。请问能否通过修改某个文件实现?

我已经进行过如下尝试:

  1. Monaco Playground 中调整 monaco.editor.create 的第二个参数使字体合适
  2. 将所做的修改(fontFamilyfontSizefontLigatures)复制到 WebGAL_Terre/public/monaco-iframe/monaco.html 相应的函数调用中
  var editor = monaco.editor.create(
    document.getElementById("container"),
    {
      value: "",
-     language: "js" // 初始化语言为 javascript,可以根据需要修改
+     language: "js", // 初始化语言为 javascript,可以根据需要修改
+     fontFamily: "Maple Mono NF CN",
+     fontSize: 16,
+     fontLigatures: true,
    }
  );
  1. 在 DevTools 中禁用缓存,刷新页面

经过以上步骤,脚本编辑器中的字体与字号并没有像预期那样变化。

@tinyAdapter
Copy link
Member

#335

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants