fromosimportPathLikefromcompas_viewerimportViewerfromcompas_viewer.sceneimportTagviewer=Viewer()deffind_sys_font(font_name:str)->PathLike:# type: ignorefrommatplotlibimportfont_managerforfontinfont_manager.fontManager.ttflist:iffont.name==font_name:font_dir=font.fnamereturnfont_dir# type: ignore# By default, the text is rendered using the FreeSans font from the library.t=Tag("EN",(0,0,0),height=50)viewer.add(t)# Font specified is possible.t=Tag("EN",(3,0,0),height=50,font=find_sys_font("Times New Roman"))viewer.add(t)# Multi-language text is possible if the machine has the font installed.t=Tag("中文 CN",(3,3,0),height=50,font=find_sys_font("DengXian"))viewer.add(t)viewer.show()