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?


Independent Software Vendors: 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!


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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VBA Shell can't Find Word document 11 155
vbModal 12 75
IF ELSE Statement in Excel Macro VBA 16 103
Count text color with conditional formating in Excel 4 68
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…
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…
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…

751 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