找到问题了,下面加了这个方法,之前的功能就会失效。
帮忙看下,这个要怎么改?
- const fontAction = () =>{
- let designer = GC.Spread.Sheets.Designer.findControl('designer-container')
- // 工具栏字体
- let customCNFont = [ { value: "微软雅黑", text: "微软雅黑" }, { value: "黑体", text: "黑体" }, { value: "新宋体", text: "新宋体" },
- { value: "仿宋", text: "仿宋" }, { value: "宋体", text: "宋体" }, { value: "隶书", text: "隶书" }, { value: "楷体", text: "楷体" },]
- let fontFamilyCmd = GC.Spread.Sheets.Designer.getCommand("fontFamily");
- fontFamilyCmd.dropdownList = customCNFont.concat(fontFamilyCmd.dropdownList);
- let ribbonConfig = GC.Spread.Sheets.Designer.DefaultConfig;
- ribbonConfig.commandMap = {fontFamily: fontFamilyCmd}
- designer.setConfig(ribbonConfig)
-
- // 右键单元格字体
- let formatDialogTemplate = GC.Spread.Sheets.Designer.getTemplate(GC.Spread.Sheets.Designer.TemplateNames.FormatDialogTemplate)
- formatDialogTemplate.content[0].children[2].children[0].children[0].children[0].children[1].items.push({text: "微软雅黑", value: "微软雅黑"})
- GC.Spread.Sheets.Designer.registerTemplate(GC.Spread.Sheets.Designer.TemplateNames.FormatDialogTemplate, formatDialogTemplate)
- // let sheet = spread.getActiveSheet();
- // 默认字体
- GC.Spread.Sheets.Themes.Office.bodyFont("宋体")
- }
复制代码
|