I have tried that and it doesn't work. Thanks.
Main Topics
Browse All TopicsHello,
I am trying to use the 3 of 9 Barcode font which is a true type font, but it doesn't work. Other fonts do work. Does anybody know why and how to make
it work. The following is the code I am using in OnPrint:
LOGFONT logFont;
memset(&logFont,0,sizeof(L
logFont.lfFaceName,TEXT("3
CFont font;
CFont* pOldFont=NULL;
if (font.CreateFontIndirect(&
pOldFont=pDC->SelectObject
pDC->TextOut(0,200,"12345"
Thanks
Charles G.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Try a program from Codeguru: http://codeguru.earthweb.c
Send the font to me from my email listed on www.fengyuan.com, and I shall give you a solution.
I tried the following on Windows 2000, and does not have problem:
LOGFONT lf;
memset(&lf, 0, sizeof(lf));
lf.lfHeight = -64;
lf.lfCharSet = ANSI_CHARSET;
strcpy(lf.lfFaceName, "3 of 9 Barcode");
HFONT hFont = CreateFontIndirect(& lf);
HGDIOBJ hOld = SelectObject(hDC, hFont);
TextOut(hDC, 100, 100, "0130869856", 10);
SelectObject(hDC, hOld);
DeleteObject(hFont);
lf.lfHeight = - 32;
lf.lfCharSet = ANSI_CHARSET;
strcpy(lf.lfFaceName, "Times New Roman");
hFont = CreateFontIndirect(& lf);
hOld = SelectObject(hDC, hFont);
TextOut(hDC, 100, 50, "ISBN 0-13-086985-6", 18);
SelectObject(hDC, hOld);
DeleteObject(hFont);
Hello Feng,
I tried setting lfHeigth to -64 and lfCharSet to ANSI_CHARSET in my code, which is in OnPrint which uses pDC, pDC->TextOut... etc. But it doesn't work. Why does it not work? Your code refers to hDC but I think you left out a couple of lines, one would be HDC hDC, then what did you initialize it to?
Charles G.
This code shown is with OnDraw(HDC hDC), so HDC is from BeginPaint.
If you only have problem with printing, not displaying, it may be the printer driver can't download font properly (if you're printing using a PCL5/6 or Postscript printer).
One way to check whether it's your problem, or printer driver's problem is capture EMF spool file, and display using www.fengyuan.com/EMF.exe.
If it's printer driver problem, you can avoid it by rendering text into a bitmap first and then send to printer driver.
Feng, I don't think it has anything to do with the printer because the font works on Word and Wordpad. It should also work in my program. Do you think I have the following settings right?
LOGFONT lf;
memset(&lf,0,sizeof(lf));
lf.lfHeight= 64;
lf.lfWidth=0;
lf.lfEscapement=0;
lf.lfOrientation=0;
lf.lfWeight=400;
lf.lfItalic=0;
lf.lfUnderline=0;
lf.lfStrikeOut=0;
lf.lfCharSet = ANSI_CHARSET;
lf.lfOutPrecision=3;
lf.lfClipPrecision=2;
lf.lfQuality=1;
lf.lfPitchAndFamily=82;
lf.lfFaceName, "3 of 9 Barcode";
CFont font;
CFont* pOldFont=NULL;
if (font.CreateFontIndirect(&
pOldFont=pDC->SelectObject
pDC->TextOut(0,200,"12345"
It's time to clean up this topic area and that means taking care of this question. Your options at this point are:
1. Award points to the Expert who provided an answer, or who helped you most. Do this by clicking on the "Accept Comment as Answer" button that lies above and to the right of the appropriate expert's name.
2. PAQ the question because the information might be useful to others, but was not useful to you. To use this option, you must state why the question is no longer useful to you, and the experts need to let me know if they feel that you're being unfair.
3. Ask Community Support to help split points between participating experts. Just comment here with details.
4. Delete the question because it is of no value to you or to anyone else. To use this option, you must state why the question is no longer useful to you, and the experts need to let me know if they feel that you're being unfair.
If you elect for option 2, 3 or 4, just post comment with details here and I'll take it from there. We also request that you review any other open questions you might have and update/close them. Display all your question history from your Member Profile to view details.
PLEASE DO NOT AWARD THE POINTS TO ME.
__________________________
Hi Experts:
In the event that the Asker does not respond, I would very much appreciate your opinions as to which Expert ought to receive points (if any) as a result of this question. Likewise, you can also suggest that I PAQ or delete the question.
Experts, please do not add further "answer" information to this question. I will be back in about one week to finalize this question.
Thank you everyone.
Moondancer :)
Community Support Moderator @ Experts Exchange
I will do this for you, although you can always accept the comment which served your needs to award that expert directly by choosing that comment and converting it to the accepted answer. To assist you, though, I will take this action for you and assume an "A" grade.
Moondancer
Community Support Moderator @ Experts Exchange
Business Accounts
Answer for Membership
by: FengYuanPosted on 2001-02-12 at 10:12:01ID: 5835561
May be should set character set to SYMBOL_CHARSET