All entities implementing IText share the same default font.
The "Default" style is applied to all text-derived entities that do not specify a different devDept.Eyeshot.Entities.Text.StyleName.
There are two ways to change it:
- If you want change font to all text-derived entities you need to change Default Font to Workspace.TextStyles keyed collection.
The following code fragment shows how to change Default Font to Arial.
design1.TextStyles["Default"].FontFamilyName = "Arial"; -
If you want change font only to some text-derived entities the correct way to do it is adding a new TextStyle item to TextStyles keyed collection and specify the new item to StyleName property of Text entity.
The following code fragment shows how to change the Font to Arial only to an entity.
design1.TextStyles.Add(new TextStyle("Arial", "Arial", fontStyle.Regular)); devDept.Eyeshot.Entities.Text example = new devDept.Eyeshot.Entities.Text(Point3D.Origin, "Caption Text.", 8); example.StyleName = "Arial"; design1.Entities.Add(example, Color.Red);
Comments
Please sign in to leave a comment.