【问题标题】:How to get post script name of type1 fonts on windows 7如何在 Windows 7 上获取类型 1 字体的 postscript 名称
【发布时间】:2015-11-08 02:33:43
【问题描述】:

如何在 64 位 Windows7 上获取 post 脚本名称、type 1 字体的完整路径?这些 API 由 Adob​​e ATM 库提供,仅适用于 32 位 win OS,例如 - ATMGetPostScriptName、ATMGetFontPaths 等。

据我所知,操作系统现在支持 type 1 字体。我可以通过 GetFontData、RegQueryMultipleValues 等获取 TTF 和 OTF 字体的所有这些字体信息,但这些 API 无法用于 type1 字体(.pfm、.pfb 字体)。

我第一次使用这个论坛,希望有人能尽快帮助我。

提前致谢, 维金德拉

【问题讨论】:

    标签: windows-7 fonts postscript


    【解决方案1】:

    我遇到了类似的问题,我想要 postscript 名称并将字体转换为 postscript。该解决方案位于一个名为 ttf2pt1 的小库中,位于 http://ttf2pt1.sourceforge.net/README.html

    您需要的例程如下。该例程使用 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;
    }
    

    【讨论】:

      猜你喜欢
      • 2018-12-11
      • 1970-01-01
      • 2014-04-25
      • 1970-01-01
      • 2019-09-30
      • 1970-01-01
      • 2012-07-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多