Page 1 of 1

Text formatting

PostPosted: Mon Jan 15, 2018 12:16 am
by xxxdevxxx
Hi forum,

i am supporting an legacy application that uses 6.3 for custom drawing. Is there a way to to do custom text formatting? I am drawing a PointText and i want to format some characters of the text in a different way than other characters (color, background). I've looked at the TextAppearance property, but i haven't found a way.


Re: Text formatting

PostPosted: Thu Jan 18, 2018 10:23 am
by Frank Hileman

Formatting text is quite a complex topic. What you describe should not be so complex, but it requires to know exactly where each string of contiguous styling is precisely positioned. Using separate PointText objects for each style is the simplest solution. You may have to tweak the positioning, and it may not be accurate. While you could resort to CustomElement and draw everything youself, you will then find yourself becoming an expert in font metrics (not an easy task).

A installation should have a file called in the AppData\Local\ X sub directory (it is under the version number). In that zip file, in the Extras folder, is a sample called PathTextSample. Please see if that can help you to create your own CustomElement.