Windows 7 如何在windows 7上获取type1字体的post脚本名称
如何在64位Windows7上获取post脚本名称、类型1字体的完整路径?AdobeATM库仅为32位win操作系统提供了这些API,如-ATMGetPostScriptName、ATMGetFontPath等 据我所知,操作系统现在支持1类字体。对于TTF和OTF字体,我可以通过GetFontData、RegQueryMultipleValues等获取所有这些字体信息,但对于type1字体(.pfm、.pfb字体),这些API都失败了 我第一次使用这个论坛,希望有人能尽快帮助我 提前感谢,,Windows 7 如何在windows 7上获取type1字体的post脚本名称,windows-7,fonts,postscript,Windows 7,Fonts,Postscript,如何在64位Windows7上获取post脚本名称、类型1字体的完整路径?AdobeATM库仅为32位win操作系统提供了这些API,如-ATMGetPostScriptName、ATMGetFontPath等 据我所知,操作系统现在支持1类字体。对于TTF和OTF字体,我可以通过GetFontData、RegQueryMultipleValues等获取所有这些字体信息,但对于type1字体(.pfm、.pfb字体),这些API都失败了 我第一次使用这个论坛,希望有人能尽快帮助我 提前感谢,,
Vijendra我遇到了类似的问题,我想要postscript名称并将字体转换为postscript。该解决方案位于一个名为ttf2pt1的小库中,位于 下面是您需要的例行程序。该例程使用OutlineTextMetrics挖掘字体的所有内部名称。nameFace值就是您想要的值
short i;
short val;
long offset;
OUTLINETEXTMETRIC *otm;
UINT nSize;
UINT retVal;
char *sptr;
char *nameFamily;
char *nameFace;
char *nameStyle;
char *nameFull;
int fontType;
char otmBuffer[4096];
SelectObject(hdc, theFont);
nSize = GetOutlineTextMetrics(hdc, 0, NULL);
if(nSize){
otm = (OUTLINETEXTMETRIC *) otmBuffer;
retVal = GetOutlineTextMetrics(hdc, nSize, otm);
val = otm->otmTextMetrics.tmPitchAndFamily;
offset = (long) otm->otmpFamilyName;
sptr = &otmBuffer[offset];
nameFamily = sptr;
offset = (long) otm->otmpFaceName;
sptr = &otmBuffer[offset];
nameFace = sptr;
offset = (long) otm->otmpStyleName;
sptr = &otmBuffer[offset];
nameStyle = sptr;
offset = (long) otm->otmpFullName;
sptr = &otmBuffer[offset];
nameFull = sptr;
if(val & TMPF_TRUETYPE){
fontType = kFontTypeTrueType;
}
else{
if(val & TMPF_VECTOR){
fontType = kFontTypePostscript;
}
}
}
else{
fontType = kFontTypeUnknown;
}