Trouble with italic font widths in Windows
Having read the recent post about creating font bitmaps (here) I decided to write a program to do just that. I know there's a freeware "Bitmap Font Builder" available, but it doesn't do everything that I need, such as minimising the area of the resulting bitmap and allowing only certain character ranges to be entered.
I've now written my own version in VB and it's working nicely. However, I'm having trouble calculating the width of characters when the font is italic. The TextWidth() method of the VB controls doesn't work. It doesn't increase when the font is made italic. I searched the web, where I saw several people mention this fact, but found no solution. I then decided to try to work around it by writing to an autosizing label and then reading the label's width, but the label doesn't autosize correctly either. The character spills over the edge.
Looking at the Windows API there are a number of GetCharxxxx() functions, but these are either Windows 2000 only, work only with True Type fonts, or yield results that don't seem to make sense.
Does anyone know a way of calculating the width of an italic character for a certain font/DC?
Moot
Edited by - Moot on February 23, 2001 12:38:57 PM
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement