How do I change the entity default font?

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.Style.

There are two ways to change it:

  • If you want change font to all text-derived entities you need to change Default Font to ViewportLayout.TextStyles Dictionary.

    The following code fragment shows how to change Default Font to Arial.
    viewportLayout1.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 TextStyleData item to TextStyles Dictionary and specify the new item to Style property of Text entity.

    The following code fragment shows how to change the Font to Arial only to an entity.
    viewportLayout1.TextStyles.Add("Arial", new TextStyleData("Arial", FontStyle.Regular)); 
    devDept.Eyeshot.Entities.Text example = new devDept.Eyeshot.Entities.Text(c.StartPoint, "Camption Text.", 8);
    example.Style = "Arial";
    viewportLayout1.Entities.Add(example, Color.Red);
Was this article helpful?
1 out of 1 found this helpful
Have more questions? Submit a request



Please sign in to leave a comment.