CAD设置字体样式疑难杂症,请教各位大侠
我定义字体样式是用得下面得函数public static ObjectId AddTextStyle(Database db, string stylename, string smallfont, string bigfont)
{
TextStyleTable TST = db.TextStyleTableId.GetObject(OpenMode.ForWrite) as TextStyleTable;
ObjectId id = GetIdFromSymbolTable(TST, stylename);
if (id == ObjectId.Null)
{
TextStyleTableRecord TSTR = new TextStyleTableRecord();
TSTR.Name = stylename;
TSTR.FileName = smallfont;
TSTR.BigFontFileName = bigfont;
//TSTR.Font.TypeFace=
////////TSTR.TextSize = height;
////////TSTR.XScale = xscale;
////////TSTR.UpgradeOpen();
id = TST.Add(TSTR);
db.TransactionManager.AddNewlyCreatedDBObject(TSTR, true);
TST.DowngradeOpen();
}
return id;
}
用的时候,是这样引用的:
ObjectId styleid = AddTextStyle(db, "黑体", "simhei.ttf");
ObjectId styleid1 = AddTextStyle(db, "宋体", "simsun");
ObjectId styleid2 = AddTextStyle(db, "仿宋", "simfang.ttf");
得到的字体,宋体和仿宋都是正着的,黑体是躺着的,如下图:
查看文档的字体样式,黑体是@黑体,宋体是宋体,前面不加@,我不想要黑体加@,我想要黑体竖起来,请问各位大侠,我哪里是不是设置错了啊?
宋体的文字样式图片是C:\Users\Administrator\Desktop\2.png 宋体的文字样式图片是C:\Users\Administrator\Desktop\2.png
页:
[1]