How do I change the Font Style in ACE editor?

后端 未结 2 1908
小蘑菇
小蘑菇 2021-02-05 06:07

I am using ACE editor on my page,




        
2条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-05 07:00

    To change font you can either add a css rule for #editor. or use

    editor.setOptions({
      fontFamily: "tahoma",
      fontSize: "10pt"
    });
    

    But Ace only supports monospace fonts for now, and tahoma isn't monospace, so cursor position will be wrong.

提交回复
热议问题