Solved

fontsize

Posted on 2002-07-23
3
429 Views
Last Modified: 2010-05-02
How do i print with at fontsize between 9 and 10?

fontsize =9.9
print "test"
fontsize =9.8
print "test"
fontsize =9.7
print "test"
fontsize =9.6
print "test"
fontsize =9.5
print "test"
fontsize =9.4
print "test"
fontsize =9.3
print "test"
fontsize =9.2
print "test"
fontsize =9.1
0
Comment
Question by:stigc
3 Comments
 
LVL 20

Expert Comment

by:hes
ID: 7173013
Basically you can't
Visual Basic doesn't raise an error when you assign an unsupported size of a font, but silently uses the closest valid font size that is less than the requested size.
So in your case if 9 and 10 are valid font Sizes VB will
convert it to 9 in each of your cases.
0
 

Author Comment

by:stigc
ID: 7174487
Is it possible from other language?
0
 

Accepted Solution

by:
paulll earned 100 total points
ID: 7175689
The screen is a virtual size, not an actual size. Since you have a fixed number of pixels, you cannot print a font size of 9 and a font size of 9.1.  It would occupy the same pixels and would not show a difference even though a printer which has higher resolution would show the difference with no problem using the same code as you have.
If you used a font size of:
fontsize =9.9 * 4  
print "test"
fontsize =9.8 * 4
print "test"
fontsize =9.7 * 4
print "test"
fontsize =9.6 * 4
print "test"
fontsize =9.5 * 4
print "test"
fontsize =9.4 * 4
print "test"
fontsize =9.3 * 4
print "test"
fontsize =9.2 * 4
print "test"
fontsize =9.1 * 4
you could see a difference even though windows would still set it to the nearest legal size.  Even then, there will still be some fonts that still show no difference.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question