I'm trying to figure out how to get the width of a string in a paragraph so that I can set the size of a table column to fit the text. I have this so far:
Code:
XFont f = new XFont(FontFamily.GenericSansSerif.GetName(0), 1);
Graphics g = Graphics.FromHwnd(IntPtr.Zero);
//g.PageUnit = GraphicsUnit.Inch; //this has no effect for some reason
XGraphics xg = XGraphics.FromGraphics(g, new XSize(100, 100), XGraphicsUnit.Inch);
XSize size = xg.MeasureString("(30 days ago)", f);
But I have no idea what the units are in, and it isn't linked to the font and size used in the table cell's paragraph.