Anti Alias'ed fonts

Posted on 1998-06-03
Last Modified: 2013-12-02
Could Anyone Help me with drawing Anti-Aliasing Fonts
and Gradient Fills on A 'label' control in VB5 PE?

I REEEEEEEELLLLY need this for a Character Generator program
so pls pls pls pls reply.
Question by:KEWL
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4

Author Comment

ID: 1462442


Expert Comment

ID: 1462443
You won't be able to use screen fonts and make them anti aliased unless the user has MS Screen Smoothing installed.  The only thing you can do on a machine where it is NOT installed, is to display the font as a graphic.  A label control would have its caption set with the text and font, but would not appear anti aliased without the utility from MS.  

Expert Comment

ID: 1462444
Oh yeah... the gradiant fills..  You can do that with various objects in VB5, but not label controls to the best of my knowledge.  There are tons of bits of available code on the web to do the gradiant fills.

Here's the one I use and like best:

Sub Gradient(TheObject As Object, Redval&, Greenval&, Blueval&)

'TheObject can be any object that supports the Line method (like forms and pictures).
'Redval, Greenval, and Blueval are the Red, Green, and Blue starting values from 0 to 255.

Dim Step%, Reps%, FillTop%, FillLeft%, FillRight%, FillBottom%, HColor$

'This will create 63 steps in the gradient. This looks smooth on 16-bit and 24-bit color.
'You can change this, but be careful. You can do some strange-looking stuff with it...
Step = (TheObject.Height / 63)
FillLeft = 0
FillRight = TheObject.Width
FillBottom = FillTop + Step

'If you changed the number of steps, change the number of reps to match it.
'If you don't, the gradient will look all funny.
For Reps = 1 To 63
    TheObject.Line (FillLeft, FillTop)-(FillRight, FillBottom), RGB(Redval, Greenval, Blueval), BF
    'This decreases the RGB values to darken the color.
    'Lower the value for "squished" gradients. Raise it for incomplete gradients.
    'Also, if you change the number of steps, you will need to change this number.
    Redval = Redval - 4
    Greenval = Greenval - 4
    Blueval = Blueval - 4
    'This prevents the RGB values from becoming negative, which causes a runtime error.
    If Redval <= 0 Then Redval = 0
    If Greenval <= 0 Then Greenval = 0
    If Blueval <= 0 Then Blueval = 0
    FillTop = FillBottom
    FillBottom = FillTop + Step
End Sub

I didn't submit this as an answer, because I'm not entirely sure from your question if this was what you were after..  If it is, you can let me submit this as the answer.  K?


Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.


Author Comment

ID: 1462445
Where do I get MS Screen Smoothing From?

and Does ne1 know what VB5 uses instead of 'print' to print text onto objects the way vb4 does?

Accepted Solution

EvanL earned 200 total points
ID: 1462446
Get the free font smoother from:

I suppose you could include this with your program, but you should read the licencing agreement first to make sure.  On Windows 95, anti-aliased screen fonts is an option, not a default.  Don't know what you mean by your last question.  Please rephrase..

Author Comment

ID: 1462447
Just Chekin the site out... brb

Author Comment

ID: 1462448
Not xactly what I wanted, but good enough

Expert Comment

ID: 1462449
The other thing you could try (don't know how well it would work), is to try to use text in jpg, gif, or bmp pictures.  That way, you can antialias the text, and it would appear smooth on anyone's computer.  

Didn't know if you saw, but you go to your Display Properties in the Win95 Control Panel > Plus! to adjust the new features that that download gave you.  


Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Suggested Courses
Course of the Month9 days, 22 hours left to enroll

624 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