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
Text formatting
Moderators: Frank Hileman, Anne Szyjan
- Frank Hileman
- Site Admin
- Posts: 1400
- Joined: Sun Jul 25, 2004 8:16 pm
- Location: California
- Contact:
Re: Text formatting
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,
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,
Frank Hileman
http://www.vgdotnet.com
http://www.vgdotnet.com