Solved

Font name

Posted on 2000-02-17
13
728 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
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
 

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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
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…

630 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