-
April 16th, 2004, 02:08 PM
#1
Printing unicode data onto PRINTER using TextOut/TextOutW
Im facing a strange problem while printing unicode data onto my PRINTER using TextOut. On the screen it displays all characters properly(my string includes English, Russian, Japanese and European characters.). When I print this onto the printer, some strange characters are printed. Strangely my English characters and some European characters are printed properly. However, when I use TextOutW some weird Asian characters-looked like Japanese or Chinese to me- are printed. I tried converting my string using MultiByteToWideChar(...) and I started getting some '.' in BOLD..!!! Any idea where Im making mistake?
F1 F1 F1..!! Please help me..!!
Note: I have enen tried with different unicode fonts that supports the languages above. Im working on VC++ 6.0 on WinXP
-
April 17th, 2004, 01:50 PM
#2
This is probably because Windows is trying to optimize the printing for you by sending the text to the printer as text. Windows may be (incorrectly) assuming that your printer has the required font installed.
If the font is not installed on the printer, the printer will select something it thinks is appropriate - this may not be suitable.
One good solution for your situation where you are using many different languages, is to configure the printer to not make these optimizations...
Try enabling Print TrueType As Graphics in the Fonts tab of the printer’s Properties sheet.
This forces the text to be sent to the printer as an image instead of as plain text. The printer will then just draw whatever the text looks like, without trying to interpret it.
Hope this helps,
- Nigel
-
October 22nd, 2007, 05:38 AM
#3
Re: Printing unicode data onto PRINTER using TextOut/TextOutW
Originally Posted by NigelQ
This is probably because Windows is trying to optimize the printing for you by sending the text to the printer as text. Windows may be (incorrectly) assuming that your printer has the required font installed.
If the font is not installed on the printer, the printer will select something it thinks is appropriate - this may not be suitable.
One good solution for your situation where you are using many different languages, is to configure the printer to not make these optimizations...
Try enabling Print TrueType As Graphics in the Fonts tab of the printer’s Properties sheet.
This forces the text to be sent to the printer as an image instead of as plain text. The printer will then just draw whatever the text looks like, without trying to interpret it.
Hope this helps,
- Nigel
Hi,
I'm having trouble printing uncode text to a picturebox. I'm using vb6+ xp+pro sp2. I set a unicode font to the picturebox and use the TextOut API
to print...but some chars doesn't seem to be displayed...any suggestion? What am I missing?
Kind regards
-
February 26th, 2013, 07:58 AM
#4
Re: Printing unicode data onto PRINTER using TextOut/TextOutW
I am having the same problem but not while printing. On screen my strings have not been printed correctly. The English characters have turned to be like Japanese characters.
This is how I create my font:
Font = CreateFontW(-iHeight, 0, iRot2, 0,200,0,(m_cFontStyle & 2)?1:0,(m_cFontStyle & 4)?1:0,DEFAULT_CHARSET,0,0,0,0,TEXT("Arial Unicode MS"));
Font2 = (HFONT)SelectObject(a_GI.m_HDC, Font);
And this is how I do the text output:
WCHAR *m_CBuf = new WCHAR[m_Value[i].length()+1];
TextOut(a_GI.m_HDC, P.x, P.y, m_CBuf, lstrlen(m_CBuf));
Can someone please help me?
Thanks in advance.
-
February 26th, 2013, 09:45 AM
#5
Re: Printing unicode data onto PRINTER using TextOut/TextOutW
I don't see any "English characters" in your m_CBuf... You have not set any character to it at all.
Victor Nijegorodov
-
February 27th, 2013, 12:57 AM
#6
Re: Printing unicode data onto PRINTER using TextOut/TextOutW
Originally Posted by ~faith~
Can someone please help me?
You need to make a small compilable project where you reproduce your current project settings and have the same problem, and post it here. This way you can get some help.
Otherwise you make us guess about your project settings and omitted code parts, that is counterproductive.
Best regards,
Igor
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|