Problem with Fonts continue

A

ARoy

I am still fighting with Fonts not showing correctly for extended ASCII
characters.
My VB6 application needs to display characters for other Languages (ie üÜ in
German).
I am not changing the regional settings for Windows (still English - USA).
It works correctly under XPPro, but the behavior is bizaar under XPe.
Some objects in the project will display the text correctly (ie.
RichTextBox, CommandButton).
Some objects show strange characters in place of the Foreign characters (ie.
Label, PictureBox).
All of these objects are using the same Font (MS Sans Serif).

I wrote a small VB6 application just to explore this issue.
The test app allows me to select different fonts at run time.
It then applies that Font to a sample of various objects.
Most Fonts will display correctly at first (ie. Arial, Courier, Microsoft
SS, Tahoma, Times NR).
Some Fonts will not display correctly on some of the objects (ie. David,
Miriam, MS Sans Serif).
After selecting any one of these Fonts, the previous set of Fonts misbehave
as well.
Then there are Fonts that allways display correctly (ie. MS Serif, Verdana).
After selecting one of these Fonts, the first set of Fonts display correctly
as well.

In addition, not all of the objects are affected by the misbehaved Fonts.
The TextBox, Label and PictureBox objects are affected.
The RichTextBox and CommandButton objects are not affected.
The CheckBox and OptionButton objects are not affected if the
Style=Standard.
But if the Style=Graphical, they suffer.
All of the objects are using the same StdFont object (ie. Set TextBox1.Font
= MyFont).
All of this works correctly under XPPro.

Any ideas?

Andrew
 
S

Slobodan Brcin \(eMVP\)

All of this works correctly under XPPro.
Any ideas?

Switch program to use Unicode :-(
Install fresh copy of Windows XP Pro on English, and check there.

Regards,
Slobodan
 
S

Slobodan Brcin \(eMVP\)

Hi Roy,

Then what do you mean by:"I am still fighting with Fonts not showing correctly for extended ASCII characters."?

With Unicode application you must use try Unicode fonts. They have different code map above ASCII table (0..127) from non Unicode
fonts.
Use Character Map on XPP to check what fonts support Unicode. (Character set will not be grayed with Unicode fonts).

In Unicode your üÜ is always code 252 and 220 in Unicode. Also you do not depend on any regional settings if you are truly using
Unicode.
I have no idea about VB part of Visual Studio but in C++ I had great deal of trouble to use Unicode.
The best test for you would be to type something in Cyrillic and English in the same text label. (If you can do that then I do not
see how can you have any problems)

Regards,
Slobodan
PS:
In character map play with Character Set options to see what is appropriate for your language and set it in VB (in case that it is
not Unicode environment).
 
A

ARoy

Slobodan Brcin (eMVP) said:
Hi Roy,

Then what do you mean by:"I am still fighting with Fonts not showing
correctly for extended ASCII characters."?
See "Problem with Fonts not displayed correctly" Posted 10-21-2004.
With Unicode application you must use try Unicode fonts. They have
different code map above ASCII table (0..127) from non Unicode
fonts.
Use Character Map on XPP to check what fonts support Unicode. (Character
set will not be grayed with Unicode fonts).
In Unicode your üÜ is always code 252 and 220 in Unicode. Also you do not
depend on any regional settings if you are truly using
Unicode.
I have no idea about VB part of Visual Studio but in C++ I had great deal
of trouble to use Unicode.
In VB6 all strings are Unicode. Strings must be converted before passing to
C++ DLL or API.
The best test for you would be to type something in Cyrillic and English
in the same text label. (If you can do that then I do not see how can you
have any problems)
This is not a problem.
Regards,
Slobodan
PS:
In character map play with Character Set options to see what is
appropriate for your language and set it in VB (in case that it is
 
A

ARoy

Slobodan Brcin (eMVP) said:
Use Character Map on XPP to check what fonts support Unicode. (Character
set will not be grayed with Unicode fonts).

Character Map under XPPro shows all relavant characters for these fonts.
Character Map under XPe does not. Does your XPe show Ü for MS Sans Serif?

Andrew
 
S

Slobodan Brcin \(eMVP\)

Andrew,

Finally you are getting to the point although you did not read or understand my babbling.
Character Map under XPPro shows all relavant characters for these fonts.
Character Map under XPe does not. Does your XPe show Ü for MS Sans Serif?

MS Sans Serif is not an Unicode font.
MS Serif is not a Unicode font.
Microsoft Sans Serif is Unicode font.

Look at the "Character Set" box when you pick font from Character Map.

Regards,
Slobodan
 
A

ARoy

Slobodan Brcin (eMVP) said:
Andrew,

Finally you are getting to the point although you did not read or understand my babbling.
Serif?

MS Sans Serif is not an Unicode font.
MS Sans Serif does not work.
MS Serif is not a Unicode font.
MS Serif always works.
Microsoft Sans Serif is Unicode font.
Microsoft Sans Serif does not always work.
Look at the "Character Set" box when you pick font from Character Map.
But why does it work under XPP and not XPe?
And even the Unicode Fonts don't always work under Xpe!
MS Serif always works and it's not Unicode (and it's ugly too).
I like Tahoma; It's a Unicode Font but it does not always work.
If I have to, I will change all the fonts in the app (not easy with VB).
But I prefer to fix the XPe image so it can behave like XPP.

Andrew
 
A

ARoy

Slobodan Brcin (eMVP) said:
We are not communicating, or I'm too tired today to understand you. BTW (I answered your second question).
ASCII take one byte per char.
Unicode take two bytes per char to write characters from many languages in same string.
Yes, I know.
Windows NT, 2000, XP, XPe, etc are natively Unicode. Why would native Unicode programming language >translate strings from Unicode to ASCII when talking with OS. Can you answer this?
Even C++ does not have such awful behavior.
I cannot answer why Microsoft did this, but they did it.
VB6 has builtin translation (Unicode to ASCII) for passing string to API.
If you can write something like
Слободан Брчин (üÜ) Slobodan BrÄin
Yes I can. And it displays OK under XPP but not XPe.
Then you would not have a problem in the first place wouldn't you agree.
I would agree, in theory. But it does not work in practice.

Best Regards,

Andrew
 
S

Slobodan Brcin \(eMVP\)

Hi Andrew,

Start by adding appropriate code page components to your image.
Microsoft Sans Serif does not always work.
I understand that it sometimes work and sometimes do not (program have its own will).
If your XPe is stable and you do not change it, don't you think that something with your application is wrong.
When we are able to pinpoint what is wrong with your application (whether it is codepage, ASCII, Unicode, some VB control, or font
problem) we must have something stable to begin with.

You can't tell us it "does not always work". Meaning of this is elusive.

Regards,
Slobodan

PS: Have you tried Brads component from www.xpefiles.com
 
S

Slobodan Brcin \(eMVP\)

Andrew,

Add Component "German Language Support" go in its settings and chose parameters like in XPP.
Or add Component "English Language Support" go in its settings and chose parameters like in XPP.

Regards,
Slobodan
 
A

ARoy

Slobodan ,

The way I see it, the problem is related to the VB Controls as well as the
OS.
The VB Control objects behave one way under XPP and another way under XPe.
The App file is the same. The OCX files are the same. The Font files are the
same.
The CodePage files are the same. But something must be different.

The XPe image is stable. The FontTracker component is included.
The FontMapper component is included as well.
The same object (ie TextBox with Tahoma Font) may or may not show all
characters correctly.
Somehow, it depends on the previous font shown.

For now I will replace all fonts in the application.
I Just hate to leave a puzzle unsolved.

Thanks for your efforts,

Andrew

Slobodan Brcin (eMVP) said:
Hi Andrew,

Start by adding appropriate code page components to your image.

I understand that it sometimes work and sometimes do not (program have its own will).
If your XPe is stable and you do not change it, don't you think that
something with your application is wrong.
When we are able to pinpoint what is wrong with your application (whether
it is codepage, ASCII, Unicode, some VB control, or font
 
S

Slobodan Brcin \(eMVP\)

Andrew,

Have you checked "Language Support" components and settings in them. Does that help you.
You have some configuration differences in registry, but what they are I have no idea.
I'm strictly using Unicode in our programs and I can't recall that I have ever experienced any problems with them.
I Just hate to leave a puzzle unsolved.
Me too :-(

I hope that someone who faced these issues recently will have some better ideas.

Regards,
Slobodan
 
S

Simon Wilton

Not sure if this has any bearing on this issue or not.

There are bits of VB6 that, although the data representation under the hood
is unicode, the presentation objects are not, or only partly, unicode.
Ususally this is solved when you have the correct local language support on
your OS (I haven't looked for the mechanism used). As I understand it XPP,
as shipped, is international. Unless you explicitly include/turn on all the
same language options in your XPe build, the behaviour will difer.

Also I have vague memories from a project in VB5 days where we needed
support for French date formats, etc. We needed to deploy VB5FR.DLL as an
adjunct to the VB run-time. This also allowed extended character entry, but
only when the locale was set to French. VB6 uses the same mechanism (files
are VB6xx.DLL).

HTH

Simon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top