Note: You must be registered in order to post a reply.
|
maxhamner |
Posted - Nov 11 2004 : 08:20:27 AM 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: Font.bas 13.31 KB |
CoBreaker |
Posted - Nov 12 2004 : 07:48:41 AM 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... |
Eric Coleman |
Posted - Nov 11 2004 : 08:32:11 AM That's an interesting method you use for calculating the text's width and height. |
|
|
VBGamer |
© |
|
|
|
|