Font problem

  • Thread starter Thread starter Johannes Stratmann
  • Start date Start date
J

Johannes Stratmann

we are using a few MFC applications that still have a font problem. In some
tabs or label there is no visible text. I've searched a lot in the NG's and
applied the possible solutions (installing several fonts), but still without
success.
A simple way to reproduce is the 'Hello' Application from the MSDN samples:
..\Samples\VC\MFC\general\hello
This works on a XPpro but not on the XPe image (with german/english mui).
The code used for the output is:
void CMainWindow::OnPaint()
{
CRect rect;
GetClientRect(rect);

CPaintDC dc(this);
dc.SetTextAlign(TA_BASELINE | TA_CENTER);
dc.SetTextColor(::GetSysColor(COLOR_WINDOWTEXT));
dc.SetBkMode(TRANSPARENT);
CString s;
s.LoadString(IDS_HELLO);
dc.TextOut((rect.right / 2), (rect.bottom / 2), s);
}

please help, this 'simple' problem is driving me nuts !
 
Johannes,

This is always a frustrating one. Do you have the following registry entries
in your runtime....

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware
Profiles\Current\Software\Fonts\LogPixels Value=Dword:96
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\FontDPI\LogPixels Value=Dword:96

Also, the International Control Panel brings in some font related fixes.
(You have probably tried this one)

HTH,

Brad
 
Thanks Brad,
I've verifyed that I have these registry entries and also the International
Control Panel, but still the same result. I have also copied and registered
a number of codepages and several fonts.
Interesting is also in the Netmonitor the following: In the frame viewer
window I see only in the upper summary pane some text, the detail and hex
pane show nothing. Then I use the font selector from the display menu and in
the sample view the 'courier new, regular, 8' font is displayed. When I
change the font I get text in all three panes. It seems that some windows
controls don't like some fonts. Maybe this is a problem of GDI/GDI+ ?
 
Happy, Happy !
found an answer by myself: the 'Codepage 1257 (ANSI-Baltic)' was missing. I
don't know why the programs use this CP, but after adding this (manually to
my existing image) five different programs incl. the MFC-Hello Sample are
displaying all the text now correctly.
In fact it was really easy: I used the SysInternals RegMon and it pointed
directly to the the missing CP entry.
 
Back
Top