.net Labels display text wrong
using a true type font that's symbolic/graphic like wingdings
the ttfont only has 20 characters mapped to the symbols/images
the rest are unmapped.
in vb6, eg, a label would correctly display the ttfont as the symbols for characters in the right range that were typed into the caption while correctly displaying blanks for all other characters.
if A-Z was mapped to a symbol, any char between A-Z should show a symbol and any other char such as 0,1,a,b,c should show a blank.
in .net, the label correctly shows symbols for A-Z but incorrectly shows the default sanserif character where no symbol was mapped. Setting label text to 01abc will display exactly that 01abc, not blanks as it should.
anyone have a clue how to get proper label behavior back again?
(vb.net is a deception...Not vb More like java)
Could you use a regular expression to replace non-alphabetic characters with spaces?
Dim RegEx As New System.Text.RegularExpressions.Regex("[^A-Za-z]")
Label.Text = RegEx.Replace(sText, " ")
Please post questions to the forums, where others may benefit.
I do not offer free assistance by e-mail. Thank you!
Unfortunately, there is no way to know ahead of time which characters are mapped and which pick up a default. I have to deal with 8 or more ttfonts symbolic/graphic, all using some to many of the first 128 characters with blanks before and after the mapped groups.
The 2nd 128 are all blank so that's easy to deal with. In the future they may expand into the 2nd 128.
SO, I need an expert in fonts, use of textmetrics or whatever to find a way to read back each character slot (index?) in the ttfont and determine if it is a mapped graphic or custom vector, or assigned something representing a default character set (ms san serif). This has me pulling my hair out! Maybe gdi32 has something but i haven't spotted it yet. Just started using vb.net a few weeks ago.
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center