/** * Created by Tony on 2018/8/2. */ let fontMapObj = { "宋体": "Smart" ,"楷体": "simkai" ,"黑体": "simhei" // ,"华文中宋": "STZHONGS" // ,"华文宋体": "STSONG" //"宋体": "Smart" }; //下划线在option中支持 //另注意: module.exports = { getActualFont: getActualFont } function getActualFont(mapName, isBold, isItalic) { let rst = ["Smart"]; if (fontMapObj[mapName]) rst[0] = fontMapObj[mapName]; // rst = rst + (isBold?"_bold":"") + (isItalic?"_italic":""); if (isBold) { rst.push("_bold"); } if (isItalic) { rst.push("_italic"); } return rst.join(""); }