Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 322
  • Last Modified:

Anti Alias'ed fonts

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.
  • 4
  • 4
1 Solution
KEWLAuthor Commented:

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.  
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?


Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

KEWLAuthor Commented:
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?
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..
KEWLAuthor Commented:
Just Chekin the site out... brb
KEWLAuthor Commented:
Not xactly what I wanted, but good enough
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now