Text displays fine, doesn't print!

Text displays fine, doesn't print!

Post by Earle F. Philhower, I » Fri, 07 Feb 1997 04:00:00

Hi, I'm the author of a little utility for printing Zip disk labels,
ZipLabel 1.1 ( http://www.geocities.com/CapeCanaveral/6552/ziplabel.html ).
I am having one heck of a time figuring out why one of my TextOut
calls displays just fine, but will not print on a PostScript or PCL printer.
(But my GDI printer seems just fine!)

Setup:  Win95 (or Win32s in Win31), no MFC, straight Win32 code...

Basically, I draw a 50% gray filled rectangle, create a 9pt Arial Bold
TT font rotated 270 deg, set the text color to white, text background to
transparent, and TextOut it...

code snippet:
FillRect(hdc, &rect, (HBRUSH)GSO(GRAY_BRUSH));
SetTextColor(hdc, RGB(255,255,255));
SetBkMode(hdc, TRANSPARENT);
ft=EzCreateFont(hdc, "Arial Bold", 90, 90, 0, TRUE, 2700); //from
//           Petzold Win95, with param added for rotation (2700)
SelectObject(hdc, ft);
DeleteObject(SO(hdc, GSO(SYSTEM_FONT));

If you are interested, just d/l the ZipLabel program and try printing
on a PS printer and you'll see what I mean!  I admit I am not checking the
DevCaps, but if PS2 cannot generate a rotated font then Adobe has a LOT
of explaining to do. ;)

Any help would be much appreciated by me and my users with HP printers!
I'd appreciate it if you could email me your responses, as my ISP has
a very poor news server.

-Earle F. Philhower, III


1. Text doesn't display correctly

Hi Walter,

I've made some tests with the OnDraw() you attached. It seems to me that it's a
problem with DrawText(). The bug seems to occur only if there are two words in
the text which are equaly wide AND the widest in the whole text.

The string "Extrimely Important" is such a case. If you take "Extr. Important",
it works fine. If you take "Extrimely Important text alignement problem" it also
works fine.

I've also noticed that not all font sizes produce the bug. Using lfText.lfHeight
= 14, or 18 or 8 works fine; 10, 11, 12, 13 doesn't.

Font size 12 and bold works fine, too.



2. Query: software for watermarking PDF files?

3. drop down list box - doesn't drop, doesn't list, doesn't remember.

4. Shared Borders mssing

5. VBPs compile at command prompt, runs fine, VBG doesn't work

6. Help! Fontmonger and Unique ID's

7. VB: why doesn't text alignment work in text box?

8. FS: EGS Spectrum 24/28 graphics card **SOLD**

9. Print doesn't Print

10. invalid conversion from 'const void*' to 'void*' : works fine on Windows but

11. ActiveX control doesn't display on PIE

12. BitBlt on 256+ colors desktop doesn't display

13. bitmap doesn't display properly at higher resolutions/colors