Board index » delphi » Type1 Output Font names

Type1 Output Font names

Bit of an odd ball question this one - I'm not sure which group it
best fit's into, so sorry if this is not totally on subject.

I am using Delphi 32 on Windows 95 and have access to Borland C++,
Visual C++, SDK and DDK information , code etc.

The problem is as follows :

I am developing a custom WYSIWYG editor which requires to save it's
contents as EPS and postscript.

All is well and the task is complete except for the font names used in
the postscript for type 1 fonts.

According to article Q77215 on the Microsoft knowledge base, Type one
fonts have two names. That used for Windows and another used for the
output device.  The article indicates that :

Quote
>>A PostScript font has two font names:
>>1.The Windows name for the font, such as "AvantGarde," which appears in the font list in the Fonts dialog box in Control Panel. 2. The PostScript name for the font, such as "itc avant garde gothic," which can vary by printer manufacturer and which the printer driver sends to the printer to select the font.
>>If the font is a downloadable soft font defined in the printer font metrics (PFM) file format, the Windows name and the PostScript name for a font can be determined. The PFM file header has a field (dfFace) that points to the Windows font name and a field (dfDriverInfo) that points to the driver- specific PostScript font name.
>>If the font is an internal printer font defined for a specific printer, it is necessary to enumerate fonts in a given printer driver to find the Windows font name. There is no device-independent way to retrieve the PostScript font name for an internally defined printer font.
>>For more information concerning the PostScript PFM file format, refer to Chapter 4 of the "Microsoft Windows Device Development Kit Printers and Fonts Kit."  

The result of the two names is that the font is unknown on the output
device and generates an 'unknwon font' error.

As I can't find this information anywhere in my DDK my question is
simple :

What API do I need to obtain the output device font name for type 1
fonts ?  Or am I on the totally wrong track.

All advice greatfully accepted.  Please E-Mail your reply as well as
post if possible.

Thanks

Stephen Meeke
Online Software & Services Limited
Scotland, UK

 

Re:Type1 Output Font names


Quote
ste...@pwick.demon.co.uk wrote:
>Bit of an odd ball question this one - I'm not sure which group it
>best fit's into, so sorry if this is not totally on subject.

>All is well and the task is complete except for the font names used in
>the postscript for type 1 fonts.

The names are indeed in the PFM files and this is documented somewhere
in the Windows 3.1 Device Driver Kit.
----------------------------------------
Aandi Inston  qu...@dial.pipex.com
Visit http://ds.dial.pipex.com/quite for info on PostScript,
PSAlter, psalters, tea, and small {*word*141} animals. And stuff.  

Re:Type1 Output Font names


WHAT FONT NAME IS THE MOST POPULAR ON THE NET?

Quote
In article <332143b6.409...@news.demon.co.uk>, ste...@pwick.demon.co.uk wrote:
> Bit of an odd ball question this one - I'm not sure which group it
> best fit's into, so sorry if this is not totally on subject.

> I am using Delphi 32 on Windows 95 and have access to Borland C++,
> Visual C++, SDK and DDK information , code etc.

> The problem is as follows :

> I am developing a custom WYSIWYG editor which requires to save it's
> contents as EPS and postscript.

> All is well and the task is complete except for the font names used in
> the postscript for type 1 fonts.

> According to article Q77215 on the Microsoft knowledge base, Type one
> fonts have two names. That used for Windows and another used for the
> output device.  The article indicates that :

> >>A PostScript font has two font names:
> >>1.The Windows name for the font, such as "AvantGarde," which appears

in the font list in the Fonts dialog box in Control Panel. 2. The
PostScript name for the font, such as "itc avant garde gothic," which can
vary by printer manufacturer and which the printer driver sends to the
printer to select the font.
Quote
> >>If the font is a downloadable soft font defined in the printer font

metrics (PFM) file format, the Windows name and the PostScript name for a
font can be determined. The PFM file header has a field (dfFace) that
points to the Windows font name and a field (dfDriverInfo) that points to
the driver- specific PostScript font name.
Quote
> >>If the font is an internal printer font defined for a specific

printer, it is necessary to enumerate fonts in a given printer driver to
find the Windows font name. There is no device-independent way to retrieve
the PostScript font name for an internally defined printer font.
Quote

> >>For more information concerning the PostScript PFM file format, refer

to Chapter 4 of the "Microsoft Windows Device Development Kit Printers and
Fonts Kit."  

- Show quoted text -

Quote

> The result of the two names is that the font is unknown on the output
> device and generates an 'unknwon font' error.

> As I can't find this information anywhere in my DDK my question is
> simple :

> What API do I need to obtain the output device font name for type 1
> fonts ?  Or am I on the totally wrong track.

> All advice greatfully accepted.  Please E-Mail your reply as well as
> post if possible.

> Thanks

> Stephen Meeke
> Online Software & Services Limited
> Scotland, UK

Re:Type1 Output Font names


Quote
Stud...@sc.maricopa.edu (Student) wrote:
>WHAT FONT NAME IS THE MOST POPULAR ON THE NET?

Fonts are barely used on the net. There are tens of thousands of fonts
available. Some have both upper and lower case letters.
----------------------------------------
Aandi Inston  qu...@dial.pipex.com
Visit http://ds.dial.pipex.com/quite for info on PostScript,
PSAlter, psalters, tea, and small {*word*141} animals. And stuff.  

Re:Type1 Output Font names


Quote
ste...@pwick.demon.co.uk wrote:

> Bit of an odd ball question this one - I'm not sure which group it
> best fit's into, so sorry if this is not totally on subject.

> I am using Delphi 32 on Windows 95 and have access to Borland C++,
> Visual C++, SDK and DDK information , code etc.

> The problem is as follows :

> I am developing a custom WYSIWYG editor which requires to save it's
> contents as EPS and postscript.

> All is well and the task is complete except for the font names used in
> the postscript for type 1 fonts.

> According to article Q77215 on the Microsoft knowledge base, Type one
> fonts have two names. That used for Windows and another used for the
> output device.  The article indicates that :

> >>A PostScript font has two font names:
> >>1.The Windows name for the font, such as "AvantGarde," which appears in the font list in the Fonts dialog box in Control Panel. 2. The PostScript name for the font, such as "itc avant garde gothic," which can vary by printer manufacturer and which the printer driver sends to the printer to select the font.
> >>If the font is a downloadable soft font defined in the printer font metrics (PFM) file format, the Windows name and the PostScript name for a font can be determined. The PFM file header has a field (dfFace) that points to the Windows font name and a field (dfDriverInfo) that points to the driver- specific PostScript font name.
> >>If the font is an internal printer font defined for a specific printer, it is necessary to enumerate fonts in a given printer driver to find the Windows font name. There is no device-independent way to retrieve the PostScript font name for an internally defined printer font.

> >>For more information concerning the PostScript PFM file format, refer to Chapter 4 of the "Microsoft Windows Device Development Kit Printers and Fonts Kit."

> The result of the two names is that the font is unknown on the output
> device and generates an 'unknwon font' error.

> As I can't find this information anywhere in my DDK my question is
> simple :

> What API do I need to obtain the output device font name for type 1
> fonts ?  Or am I on the totally wrong track.

> All advice greatfully accepted.  Please E-Mail your reply as well as
> post if possible.

> Thanks

> Stephen Meeke
> Online Software & Services Limited
> Scotland,

I'm not too familiar with windows environment, but I think the field
"dfDriverInfo" in the pfm file is the name which should be used
in the PostScript code you generate. You should check, but, if this
name matches the name shown by ATM when showing the installed fonts.

Re:Type1 Output Font names


Quote
On Sat, 08 Mar 1997 11:06:28 GMT, ste...@pwick.demon.co.uk wrote:
>What API do I need to obtain the output device font name for type 1
>fonts ?  Or am I on the totally wrong track.

Just though I should let any interested parties know what the final
solution was.

Thanks for all replies.

The following function will extract a psotscript font from a Type1 PFM
file :

{*****************************************************************************}
{ Returns the PS name associated with a given PFM file

Quote
}

function TAtm.GetPSNameFromPFM(Path : string) : string;
Var
  PFMFile : TFileStream;
  Offset : longint;
  Name   : string;
  C : char;
begin
{This is all good fun, it works like this -
 Every Type 1 font has a Printer Font Metric file pointed to by
ATM.ini.
 At offset 0x8B (139 Decimal) in this file is a four byte pointer
which points
 to a null terminated string which is the font name needed for the
postscript.
 Easy - Huh !}

try
{Open the file}
PFMFile := TFileStream.Create(Path,fmOpenRead);

{Goto the offset which contains the four byte pointer}
PFMFile.Position := PFM_POINTER_OFFSET;

{Now read in the four bytes into a longint}
PFMFile.ReadBuffer(Offset,4);

{Now seek to the position pointed to and read the null terminated
string}
PFMFile.Position := Offset;
Name := '';
PFMFile.ReadBuffer(C,1);
While(C <> #0) do
  begin
  Name := Name + C;
  PFMFile.ReadBuffer(C,1);
  end;
GetPSNameFromPFM := Name;

{Tidy Up}
PFMFile.Free;
except
  GetPSNameFromPFM := '';
  end;
end;

Other Threads