Solved

fontsize

Posted on 2002-07-23
3
425 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

777 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