1. Rich edit control problem: bitmap font shows twice as wide as it should
Got a real strange one here. I'm using a rich edit control as a
display window in an app I'm writing. Because I need to display some
special characters that are not generally available, I have created a
bitmap font (.FNT file) that has the necessary characters in it. I
can load this font correctly and display characters from it, except
they show up twice as wide as they should.
The font is 7 wide by 12 tall, and it's placed in the resource script
for my app. Loading it is a two step operation. In my WM_CREATE
handler, I do the following:
GetModuleFileName(NULL, namebuff, MAX_PATH);
SendMessage(HWND_BROADCAST, WM_FONTCHANGE, 0, 0);
and then in the rich edit control creation code, I do this:
cf.cbSize = sizeof(CHARFORMAT);
cf.dwMask = CFM_FACE | CFM_SIZE;
cf.dwEffects = 0;
cf.yHeight = 12;
cf.bCharSet = DEFAULT_CHARSET;
cf.bPitchAndFamily = FIXED_PITCH | FF_DONTCARE;
My best guess as to why it's failing is found in the notes about the
LOGFONT structure, lfWidth member: "If lfWidth is zero, the aspect
ratio of the device is matched against the digitization aspect ratio
of the available fonts to find the closest match, determined by the
absolute value of the difference." Since I can't specify the width in
a CHARFORMAT structure, I'm guessing that it's setting it to 0, and
then trying to map my 7 by 12 font into the closest thing to a square
that it can hit (i.e. 1 to 1 aspect ratio), thus hitting a 14 by 12
Any ideas? TIA.
2. Really Strange
3. need rich edit control for wince to use with EVC
4. Firewall Survey - Which Firewall is the best ? Have your say.
5. Rich Edit Control
6. Internet Explorer has quit working
7. rich edit control
8. .avi files won't play
9. coloring text in a rich edit control
10. How to popup the shortcut menu in a rich edit control?
11. need rich edit control for wince to use with EVC
12. Rich edit control problem (Focus not changing with tab)
13. Rich edit control 2.0 ?