By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,952 Members | 1,686 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,952 IT Pros & Developers. It's quick & easy.

Font Sizing in Metric

P: 3
Hi

I was wondering is there a way to draw your fonts in Millimeters or inches instead of using point in VB. I know that you can use the graphics class to draw the text, but you still have to specify a font size in points.
Sep 19 '07 #1
Share this Question
Share on Google+
3 Replies


SammyB
Expert 100+
P: 807
Hi

I was wondering is there a way to draw your fonts in Millimeters or inches instead of using point in VB. I know that you can use the graphics class to draw the text, but you still have to specify a font size in points.
If you are using VBA in an Office app, then you use Application.CentimetersToPoints. In VB6 and VB.NET, you can create your own function using the fact that one point = 0.03527777777 centimeters or 1 centimeter = 28.34645669 points. Ref http://msdn2.microsoft.com/en-us/lib...ffice.11).aspx
Sep 19 '07 #2

P: 3
If you are using VBA in an Office app, then you use Application.CentimetersToPoints. In VB6 and VB.NET, you can create your own function using the fact that one point = 0.03527777777 centimeters or 1 centimeter = 28.34645669 points. Ref http://msdn2.microsoft.com/en-us/lib...ffice.11).aspx

Thanks for the repy, but different fonts display at different sizes at the same point size. For example Arial at any point size will be greater than Times New Roman at the same point size. How is it possible that 1 point = 0.03527777777 centimeters when the heights of the two fonts are different.
Sep 20 '07 #3

SammyB
Expert 100+
P: 807
Thanks for the repy, but different fonts display at different sizes at the same point size. For example Arial at any point size will be greater than Times New Roman at the same point size. How is it possible that 1 point = 0.03527777777 centimeters when the heights of the two fonts are different.
Well, if you create a Word document with two columns and paste the same text in both columns and make one column Times & the other Ariel, you will see that we are both correct. Notice that the lines are the same distance from the top in both columns, so Word causes them to take up the same space, but Ariel uses up more of the available room, so you could use Format|Paragraph|LineSpacing=Exactly and make the Times closer together, but notice that the exact measurement is in points, so if you set both sides to 12 point Exact Line Spacing, they will still lineup. In VB.Net, the graphics object has a MeasureString method that will give you the exact size of a string. It would be different for Times vs Ariel. Nothing is simple, except that 1 point = 0.03527777777 cm. HTH! --Sam
Sep 21 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.