Download Attachment: [url="http://www.vbgamer.com/msgboard/uploaded/maxhamner/2004111181829_Font.bas"][img]icon_paperclip.gif[/img]Font.bas[/url]
|VB6 Font usage|
|maxhamner||Here is the font I use to load fonts for my apps without installing them. Not very special, but handy. I use this instead of making bitmaps of fonts so I can draw text in any size/color in my programs, and even do 'drop shadows' by drawing the font twice (black with offset, normal without offset), and other effects.
The nice part is that DX7 can use them once they (fonts) are added. The calcwidth, calcheight functions make it easy to mange where you will draw the text to center it, handle wrapping etc.
If you have a 'box" where you draw messages you can use "calctextwidth" on each word, and if it doesn't go outside the box use the Directdraw function "drawtext" with the last parameter set to true to append the last draw... makes for a super easy word wrap that works in ANY font/size.
Download Attachment: [url="http://www.vbgamer.com/msgboard/uploaded/maxhamner/2004111181829_Font.bas"][img]icon_paperclip.gif[/img]Font.bas[/url]|
|Eric Coleman||That's an interesting method you use for calculating the text's width and height.|
|CoBreaker||this is very interesting, but! can u help? lol i mean: • what u mean by fontname? its the file name or font name? • does i need to add the extension? (TTF) • how can that be drawn on the form?? i mean i can print it but the font is the default only the size changes when use the size of the fontmod.calctextwidth...|