Text formatting

Anything other than problems and feature requests.

Moderators: Frank Hileman, Anne Szyjan

Post Reply
xxxdevxxx
Posts: 1
Joined: Thu Jan 11, 2018 8:48 am

Text formatting

Post by xxxdevxxx » Mon Jan 15, 2018 12:16 am

Hi forum,

i am supporting an legacy application that uses vg.net 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.

regards,
xxxdevxxx

User avatar
Frank Hileman
Site Admin
Posts: 1400
Joined: Sun Jul 25, 2004 8:16 pm
Location: California
Contact:

Re: Text formatting

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

Hello,

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 VG.net installation should have a file called SamplesExtras.zip in the AppData\Local\VG.net 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.

Regards,

Post Reply