473,659 Members | 3,605 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 2344
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.Cen timetersToPoint s. 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.Cen timetersToPoint s. 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|Paragrap h|LineSpacing=E xactly 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
21634
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 get some good real world examples. Fire away! :) Regards, Peter Foti
115
7180
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 ..." Yet if I use 'x-small' instead of 9pt, I get bigger type on IE6 and smaller type on Mozilla. My choices seem to be:
7
3937
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 mso-bidi-font-family) then the "SmallerText" assigned as a class to a div tag produces larger text than the "SmallerText2". So x-small is treated as a bigger font size than plain old small. How the heck is one supposed to know all the MS stuff one needs...
9
3770
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 body like <br><br> Abc <font size=+1> Abc <font size=+1> Abc <font size=+1> Abc <font size=+1> Abc <font size=+1>
7
19529
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 it completely fills the label? For example, if the text is "Santa Claus" the font size might have to be 130 points to fill up a 637x476 label, where if the text is "Once upon a midnight dreary / while I pondered weak and weary / over many a...
60
4759
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 = 81.25
12
2168
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 pt size 3 = 21 pt
30
4524
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 work: ;;; p {
16
5784
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 different. If I want a font equal in size to Windows' Tahoma 8pt, I need to set 11 as font size. This has the result that text on my website is too small for Linux systems at the moment. Could you tell me what I need to do in order to get the same...
0
8851
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8748
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8531
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5650
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4175
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4335
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2754
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1978
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1739
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.