Solved

Font name

Posted on 2000-02-17
13
682 Views
Last Modified: 2013-12-03
Hi all,
hi have a problem, i need to retreive the face name of a font when printing under windows
The face name shoul not have any space in it. This face name is used when printing under windows to a postscript driver.  

ex . the face name of  the font Avant Garde is
AvantGarde-Book.  This was found in the postscript file after
the job was printed.

I have tried to play with the GetOutlineTextMetrics(hDC,nByte , psOt) window Function.  The result was that there is nothing comparable to the postscript file name font.  The problem is only accuring with True Type fonts.

Is there a proper way to retreive such information. Need Help .........

I have tried the  ENUMLOGFONTEX, NEWTEXTMETRIC, and nothing
is conclusive.

Can GetFontData() help me, if yes are there some good example.

thanks, later

Charles.
0
Comment
Question by:ctrembla
  • 5
  • 3
  • 2
  • +3
13 Comments
 
LVL 22

Expert Comment

by:nietod
ID: 2531393
Did you check the lfFaceName of the LOGFONT in an ENUMLOGFONT structure?

Why do you need this?
0
 

Author Comment

by:ctrembla
ID: 2531497
I have tried with LOGFONT, and ENUMLOGFONT,
ENUMLOGFONTEX , and the result are not conclusive.

the only problems are with TrueType fonts.

The reason i need this is that i have an export in my application
that export to Adobe Illustrator. The format is a simple postscript
subset, but when dealing with TrueType fonts i need to
have the Postscript name of that font.

When that file is imported into Adobe Illustrator the font is match
to the equivalent true type font.



0
 
LVL 4

Expert Comment

by:nils pipenbrinck
ID: 2531528
truetype font aren't directly supported by postscript printers.. therefore the driver either sends the text as outlines or converts them to type1 and downloads them to the ps printer on the fly.

there are a couple of built in fonts in postscript printers... and if you've installed the adobe type manager you can also use the the additional type 1 fonts. these fonts are directly supported by ps printers and look on the printer as they appear on the screen.

all the others will be (as I said) either converted or mapped to the best matching font. the font mapper will choose which font to use.

so.. my guess is, that you simply can't know which ttf font will map to which printerfont when printing to postscript.


 Nils


0
 
LVL 1

Expert Comment

by:ScottyDawg
ID: 2531546
have you looked at CDC::GetTextFace(...)
0
 

Author Comment

by:ctrembla
ID: 2531635
This is  was i was expecting, but was still hoping :))

thanks
0
 
LVL 4

Expert Comment

by:nils pipenbrinck
ID: 2531671
ctrembla: that's life :)

btw.. for what do you need to get the facename? (just wondering).

Nils
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:ctrembla
ID: 2531682
I have explain it in previous comments :)
0
 

Author Comment

by:ctrembla
ID: 2531684
I have explain it in previous comments :)
0
 
LVL 4

Expert Comment

by:nils pipenbrinck
ID: 2531740
hm.. just an idea..

why don't you install a very uncommon ttf (to make sure it can't be mapped), and export to .ai with a different program... then take a look how the program named the font.

This won't solve your problem, but at least your exporter behaves like the others. :)

Nils
0
 

Author Comment

by:ctrembla
ID: 2531786
I know,

this was the original plan, i was looking for a "better
solution but ...". Anyway i will create a mapping ascii file when reading the True Type fonts.

do you have an idea of a good mapping solution


 
0
 
LVL 2

Accepted Solution

by:
PIG earned 200 total points
ID: 2532858
I You have MSDN Library from July 1999 that have following ariticicle:

"SAMPLE: Adding TrueType, Raster, or Vector Fonts to System"
Article ID: Q130459

It is a sample application that demonstrates how to programmatically add a TrueType, raster, or vector font to the system.  I think that is it. There have simple sample for all operation over fonts in low level programing.

Try it.
0
 
LVL 22

Expert Comment

by:nietod
ID: 2532873
And what does that have to do with the problem?
0
 

Expert Comment

by:auk_ie
ID: 8748327
Hello

I'm also stuck with the same problem i.e I can't get the face name of the font

ex . the face name of  the font Avant Garde is
AvantGarde-Book. As mentioned above.  

however I can't find the above article Q130459 on MSDN, 2 years later have you still got that article you could pass on to me or even a link.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
This article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now