473,503 Members | 1,687 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Font Sizing in Metric

3 New Member
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
3 2340
SammyB
807 Recognized Expert Contributor
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
jateennaran
3 New Member
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
807 Recognized Expert Contributor
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

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

Similar topics

131
21532
by: Peter Foti | last post by:
Simple question... which is better to use for defining font sizes and why? px and em seem to be the leading candidates. I know what the general answer is going to be, but I'm hoping to ultimately...
115
7105
by: J | last post by:
I've run CSSCheck on my style sheets and I always get a warning similar to this: "font: bold 9pt/100% sans-serif Warning: Absolute length units should not generally be used on the Web ..." ...
7
3931
by: Randall Parker | last post by:
Using IE 6.x (whatever is the latest) on Windows 2000. For these two CSS definitions if I remove the 2 lines that have the "mso-" font family definitions (mso-fareast-font-family, and...
9
3754
by: Dr John Stockton | last post by:
Assuming default set-ups and considering all reasonable browsers, whatever that may mean, what should an author expect that his readers in general will see (with visual browsers) for a page with...
7
19510
by: Joe | last post by:
I have a label control that will be filled with text at runtime. The length of the text will vary, but the label must stay the same size. Is there a way to set the font size of the text such that...
60
4704
by: deko | last post by:
As I understand it, most browser manufacturers have agreed on 16px for their default font size. So, this should be an accurate conversion for percentages: px % 16 = 100 14 = 87.5 13 =...
12
2152
by: Laphan | last post by:
Hi All Strange question this, but could somebody tell me what the old size=1, size=2 .... to size=7 font parameters are in pixels and points. I thought it was: size 1 = 7 pt size 2 = 14...
30
4487
by: Takehiko Abe | last post by:
I have a <pelement with <ttinside: ;;; <p>A paragraph contains <tt>tt element</tt>.</p> I would like to set the font-size of the TT to the same as the containing <p>. This does not seem to...
16
5755
by: Frank Steinmetzger | last post by:
Hello Group On my website I used to have Tahoma 8pt defined in my CSS styles. That gives me the "normal" font Windows uses everywhere in its dialogues. However, on Linux things seem to be...
0
7202
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7086
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7280
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7332
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3167
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3154
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
382
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.