Solved

fontsize

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
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…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

757 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now