hugi
6th April 2006 15:06 UTC
Install Postscript Type 1 Fonts
Hello,
I have a big problem.
I have to install Postscript fonts for Windows 2000/XP - Systems.
I have three Files : fontXy.AFM, fontXy.INF, fontXy.PFB.
Have anybody experience with installing Type 1 Fonts?
I convert the files in PFM....
This example doesn´t work:
CopyFiles "PFM\fontXy.PFM" $FONTS
System
::Call "GDI32::AddFontResourceA(t) i ('fontXy.PFM | fontXy.PFB ') .s"
>SendMessage ${HWND_BROADCAST} ${WM_FONTCHANGE} 0 0
>
Afrow UK
6th April 2006 16:03 UTC
Is that the exact code you're using?
CopyFiles "PFMfontXy.PFM" $FONTS
This says that the file name is "PFMfontXy.PFM" not "fontXy.PFM".
-Stu
hugi
6th April 2006 16:22 UTC
oh sorry, the right version is:
CopyFiles "fontXy.PFM" $FONTS
But is it required to copy the file to the fonts-Directory? But how do the other operation know where the location of the fontresource is?
Afrow UK
6th April 2006 18:08 UTC
Yes I'm pretty sure it's necessary because AddFontResourceA does not want full paths to font files; it only wants the font file names themselves. Try removing the last space:
System::Call "GDI32::AddFontResourceA(t) i ('fontXy.PFM | fontXy.PFB') .s"
-Stu
hugi
7th April 2006 14:49 UTC
ok, now it works but I don´t know why.
CopyFiles "$EXEDIR\fontXy.PFB" $FONTS
CopyFiles "$EXEDIR\fontXy.PFM" $FONTS
SendMessage ${HWND_BROADCAST} ${WM_FONTCHANGE} 0 0
With Windows XP it works but why? Have someone an idea? The fonts are installed and usable...
kichik
7th April 2006 15:04 UTC
Probably because you've added $EXEDIR to the source file. It's always better to use the full path with CopyFiles to make sure it will work.
hugi
7th April 2006 16:46 UTC
yes that´s right, but it also works without. But my confusion is because a copy-command activate a function that also the fonts are listed in the registry an in the fonts-table. So the function
System::Call "GDI32::AddFontResourceA(t)
ist obsolete!
I also test it with True Type Fonts (ttf) and it´s the same. There is no need for the function...
Okay, one limitation: It only works from win2000 ...