のねのBlog

パソコンの問題や、ソフトウェアの開発で起きた問題など書いていきます。よろしくお願いします^^。

afddko tx -u

% tx -u                                                   
tx {[mode][mode options][shared options][files]}*
tx [other options]
  (-***** -h for help)
[modes: default -dump]
-dump write text dump of font data
-ps write PostScript dump of font data
-pdf write PDF dump of font data
-dcf write text dump of CFF font data
-mtx write metrics dump of font data
-cff write CFF (Compact Font Format) FontSet
-cff2 write CFF2 FontSet
-t1 write Type 1 font
-cef write CEF (Compact Embedded Font) font
-afm write AFM representation of font data
-svg write SVG font
-ufo write UFO font
-path test path handling code
[shared options]
-g <list>
  comma separated glyph selector: 
  tag, cid, or  glyph name.
  May use ranges. 
  Example: '-g Aacute,three.superior,100-123'

-gx <list>
  comma separated glyph exclusion selector: 
  tag, cid, or glyph name.
  May use ranges.
  All glyphs except those listed are copied.
  The '.notdef' glyph will never be excluded.

-fd <index>     
  only select glyphs belonging to specified font dict

-fdx <index>    
  only select glyphs not belonging to specified font dict
  font dict index list arg may be a range or comma-delimited list.
  '-fd 1' or '-fd 3,4,7' or '-fd 3-5' are all valid.
-p <percent>    
  select random <percent> of src glyphs [repeatable]
-P <percent>    
  select random <percent> of src glyphs [unrepeatable]
-U <list>       
  user design vector (to instantiate an MM or CFF2 font)
-UNC            
  don't clamp the design vector to min/max of font's design space
-i <resid>      
  FFIL sfnt resource or TTC index selector
-y              
  select every font in FFIL or TTC
-x              
  use exact quadratic to cubic curve conversion (TrueType)
-X
  generate combined approximate and exact conversions (TrueType)
-t
  dump PostScript tokens from Type 1/CID font
 -m <arg>
  simulate memory allocation failure
-N
  print filename and FontName to stderr before processing
-pg
  preserve GIDs when subsetting
-n
  remove hints
[files]
*none*          input from stdin, output to stdout
<src>           input from <src>, output to stdout
<src> <dst>     input from <src>, output to <dst>
-f <src>+       input from <src>+, output to stdout
-o <dst> -f <src>+
                input from <src>+, output to <dst>
-a <src>+       input from <src>+, output to <filename>.<mode>
-A <src>+       input from <src>+, output to <FontName>.<mode>
-sr <srcroot>   read files from <srcroot> (combine with above options)
-sd <srcdir>    read files from <srcdir> (combine with above options)
-dd <dstdir>    write files to <dstdir> (combine with above options)
[other options]
-s <script>     read options from <script>
-u              print usage
-h              print general help
-v              print component versions
-r              dump Macintosh resource map
-R              dump AppleSingle/Double entry descriptors

feat.c

feat.c 1786行目付近

/* --- Glyph --- */

/* Map feature file glyph name to gid; emit error message and return notdef if
   not found (in order to continue until hotQuitOnError() called) */
static GID featMapGName2GID(hotCtx g, char *gname, int allowNotdef) {
    GID gid;
    char *realname;

    // if (IS_CID(g)) {
    //     zzerr("glyph name specified for a CID font");
    // }

    gid = mapName2GID(g, gname, &realname);

    /* Return the glyph if found in the font. When allowNotdef is set, we
     * always return and callers should check for GID_UNDEF as we can't return
     * GID_NOTDEF in this case. */
    if (gid != GID_UNDEF || allowNotdef == 1) {
        return gid;
    }

    if (realname != NULL && strcmp(gname, realname) != 0) {
        featMsg(hotERROR, "Glyph \"%s\" (alias \"%s\") not in font",
                realname, gname);
    } else {
        featMsg(hotERROR, "Glyph \"%s\" not in font.", gname);
    }
    return GID_NOTDEF;
}

featgram.c 68行目付近

ID
#ifdef __USE_PROTOS
glyph(char *tok, int allowNotdef)
#else
    glyph(tok, allowNotdef) char *tok;
int allowNotdef;
#endif
{
    GID _retv;
    zzRULE;
    Attrib gname, cid;
    zzBLOCK(zztasp1);
    PCCTS_PURIFY(_retv, sizeof(GID))
    zzMake0;
    {
        _retv = 0; /* Suppress optimizer warning */
        if ((LA(1) == T_GNAME)) {
            zzmatch(T_GNAME);
            gname = zzaCur;

            _retv = featMapGName2GID(g, gname.text, allowNotdef);
            if (tok != NULL)
                strcpy(tok, gname.text);
            zzCONSUME;

        } else {
            if ((LA(1) == T_CID)) {
                zzmatch(T_CID);
                cid = zzaCur;

                _retv = cid2gid(g, (CID)(cid).lval);
                zzCONSUME;

            } else {
                zzFAIL(1, zzerr1, &zzMissSet, &zzMissText, &zzBadTok, &zzBadText, &zzErrk);
                goto fail;
            }
        }
        zzEXIT(zztasp1);
        return _retv;
    fail:
        zzEXIT(zztasp1);
        zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
        zzresynch(setwd1, 0x1);
        return _retv;
    }
}
GNode *
#ifdef __USE_PROTOS
pattern(int markedOK)
#else
    pattern(markedOK) int markedOK;
#endif
{
    GNode *_retv;
    zzRULE;
    Attrib t;
    zzBLOCK(zztasp1);
    PCCTS_PURIFY(_retv, sizeof(GNode *))
    zzMake0;
    {
        GNode **insert = &_retv;
        {
            zzBLOCK(zztasp2);
            int zzcnt = 1;
            zzMake0;
            {
                do {
                    {
                        zzBLOCK(zztasp3);
                        zzMake0;
                        {
                            if ((setwd3[LA(1)] & 0x20)) {
                                {
                                    zzBLOCK(zztasp4);
                                    zzMake0;
                                    {
                                        GID gid;
                                        gid = glyph(NULL, FALSE);

                                        *insert = newNode(h);
                                        (*insert)->gid = gid;
                                        (*insert)->nextCl = NULL;
                                        zzEXIT(zztasp4);
                                    }
                                }
                            } else {
                                if ((setwd3[LA(1)] & 0x40)) {
                                    {
                                        zzBLOCK(zztasp4);
                                        zzMake0;
                                        {
                                            GNode *gc;
                                            gc = glyphClass(false, false, NULL);

                                            *insert = gc;
                                            zzEXIT(zztasp4);
                                        }
                                    }
                                } else {
                                    zzFAIL(1, zzerr16, &zzMissSet, &zzMissText, &zzBadTok, &zzBadText, &zzErrk);
                                    goto fail;
                                }
                            }
                            zzEXIT(zztasp3);
                        }
                    }
                    {
                        zzBLOCK(zztasp3);
                        zzMake0;
                        {
                            if ((LA(1) == 156)) {
                                zzmatch(156);

                                if (markedOK) {
                                    /* Mark this node: */
                                    (*insert)->flags |= FEAT_MARKED;
                                } else
                                    zzerr("cannot mark a replacement glyph pattern");
                                zzCONSUME;

                            } else {
                                if ((setwd3[LA(1)] & 0x80)) {
                                } else {
                                    zzFAIL(1, zzerr17, &zzMissSet, &zzMissText, &zzBadTok, &zzBadText, &zzErrk);
                                    goto fail;
                                }
                            }
                            zzEXIT(zztasp3);
                        }
                    }
                    {
                        zzBLOCK(zztasp3);
                        zzMake0;
                        {
                            while ((LA(1) == K_lookup)) {
                                zzmatch(K_lookup);
                                zzCONSUME;
                                zzmatch(T_LABEL);
                                t = zzaCur;

                                {
                                    int labelIndex;
                                    if ((*insert) == NULL)
                                        zzerr("Glyph or glyph class must precede a lookup reference in a contextual rule.");

                                    labelIndex = featGetLabelIndex(t.text);
                                    (*insert)->lookupLabels[(*insert)->lookupLabelCount] = labelIndex;
                                    (*insert)->lookupLabelCount++;
                                    if ((*insert)->lookupLabelCount > 255)
                                        zzerr("Too many lookup references in one glyph position.");
                                    _retv->flags |= FEAT_LOOKUP_NODE; /* used to flag that lookup key was used.  */
                                }
                                zzCONSUME;

                                zzLOOP(zztasp3);
                            }
                            zzEXIT(zztasp3);
                        }
                    }
                    insert = &(*insert)->nextSeq;
                    zzLOOP(zztasp2);
                } while ((setwd4[LA(1)] & 0x1));
                zzEXIT(zztasp2);
            }
        }
        (*insert) = NULL;
        zzEXIT(zztasp1);
        return _retv;
    fail:
        zzEXIT(zztasp1);
        zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
        zzresynch(setwd4, 0x2);
        return _retv;
    }
}
void
#ifdef __USE_PROTOS
substitute(void)
#else
substitute()
#endif
{
    zzRULE;
    zzBLOCK(zztasp1);
    zzMake0;
    {
        GNode *targ;
        GNode *repl = NULL;
        int targLine;
        int type = 0;
        {
            zzBLOCK(zztasp2);
            zzMake0;
            {
                if ((LA(1) == K_except)) {
                    zzmatch(K_except);
                    type = GSUBChain;
                    h->syntax.numExcept++;
                    zzCONSUME;

                    targ = pattern(1);

                    targ->flags |= FEAT_IGNORE_CLAUSE;
                    addSub(targ, NULL, type, zzline);
                    {
                        zzBLOCK(zztasp3);
                        zzMake0;
                        {
                            while ((LA(1) == 155)) {
                                zzmatch(155);
                                zzCONSUME;
                                targ = pattern(1);

                                targ->flags |= FEAT_IGNORE_CLAUSE;
                                addSub(targ, NULL, type, zzline);
                                zzLOOP(zztasp3);
                            }
                            zzEXIT(zztasp3);
                        }
                    }
                } else {
                    if ((setwd5[LA(1)] & 0x10)) {
                    } else {
                        zzFAIL(1, zzerr23, &zzMissSet, &zzMissText, &zzBadTok, &zzBadText, &zzErrk);
                        goto fail;
                    }
                }
                zzEXIT(zztasp2);
            }
        }
        {
            zzBLOCK(zztasp2);
            zzMake0;
            {
                if ((LA(1) == K_reverse)) {
                    {
                        zzBLOCK(zztasp3);
                        zzMake0;
                        {
                            zzmatch(K_reverse);
                            type = GSUBReverse;
                            zzCONSUME;

                            targ = pattern(1);

                            targLine = zzline;
                            {
                                zzBLOCK(zztasp4);
                                zzMake0;
                                {
                                    if ((LA(1) == K_by)) {
                                        zzmatch(K_by);
                                        zzCONSUME;
                                        {
                                            zzBLOCK(zztasp5);
                                            zzMake0;
                                            {
                                                if ((LA(1) == K_NULL)) {
                                                    zzmatch(K_NULL);
                                                    addSub(targ, NULL, type, targLine);
                                                    zzCONSUME;

                                                } else {
                                                    if ((setwd5[LA(1)] & 0x20)) {
                                                        repl = pattern(0);

                                                        addSub(targ, repl, type, targLine);
                                                    } else {
                                                        zzFAIL(1, zzerr24, &zzMissSet, &zzMissText, &zzBadTok, &zzBadText, &zzErrk);
                                                        goto fail;
                                                    }
                                                }
                                                zzEXIT(zztasp5);
                                            }
                                        }
                                    } else {
                                        if ((LA(1) == 157)) {
                                        } else {
                                            zzFAIL(1, zzerr25, &zzMissSet, &zzMissText, &zzBadTok, &zzBadText, &zzErrk);
                                            goto fail;
                                        }
                                    }
                                    zzEXIT(zztasp4);
                                }
                            }
                            zzEXIT(zztasp3);
                        }
                    }
                } else {
                    if ((LA(1) == K_substitute)) {
                        {
                            zzBLOCK(zztasp3);
                            zzMake0;
                            {
                                zzmatch(K_substitute);
                                zzCONSUME;
                                targ = pattern(1);

                                targLine = zzline;
                                {
                                    zzBLOCK(zztasp4);
                                    zzMake0;
                                    {
                                        if ((setwd5[LA(1)] & 0x40)) {
                                            {
                                                zzBLOCK(zztasp5);
                                                zzMake0;
                                                {
                                                    if ((LA(1) == K_by)) {
                                                        zzmatch(K_by);
                                                        zzCONSUME;
                                                    } else {
                                                        if ((LA(1) == K_from)) {
                                                            zzmatch(K_from);
                                                            type = GSUBAlternate;
                                                            zzCONSUME;

                                                        } else {
                                                            zzFAIL(1, zzerr26, &zzMissSet, &zzMissText, &zzBadTok, &zzBadText, &zzErrk);
                                                            goto fail;
                                                        }
                                                    }
                                                    zzEXIT(zztasp5);
                                                }
                                            }
                                            {
                                                zzBLOCK(zztasp5);
                                                zzMake0;
                                                {
                                                    if ((LA(1) == K_NULL)) {
                                                        zzmatch(K_NULL);
                                                        zzCONSUME;
                                                    } else {
                                                        if ((setwd5[LA(1)] & 0x80)) {
                                                            repl = pattern(0);

                                                        } else {
                                                            zzFAIL(1, zzerr27, &zzMissSet, &zzMissText, &zzBadTok, &zzBadText, &zzErrk);
                                                            goto fail;
                                                        }
                                                    }
                                                    zzEXIT(zztasp5);
                                                }
                                            }
                                        } else {
                                            if ((LA(1) == 157)) {
                                            } else {
                                                zzFAIL(1, zzerr28, &zzMissSet, &zzMissText, &zzBadTok, &zzBadText, &zzErrk);
                                                goto fail;
                                            }
                                        }
                                        zzEXIT(zztasp4);
                                    }
                                }
                                addSub(targ, repl, type, targLine);
                                zzEXIT(zztasp3);
                            }
                        }
                    } else {
                        zzFAIL(1, zzerr29, &zzMissSet, &zzMissText, &zzBadTok, &zzBadText, &zzErrk);
                        goto fail;
                    }
                }
                zzEXIT(zztasp2);
            }
        }
        zzEXIT(zztasp1);
        return;
    fail:
        zzEXIT(zztasp1);
        zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
        zzresynch(setwd6, 0x1);
    }
}
void
#ifdef __USE_PROTOS
statement(void)
#else
statement()
#endif
{
    zzRULE;
    zzBLOCK(zztasp1);
    zzMake0;
    {
        {
            zzBLOCK(zztasp2);
            zzMake0;
            {
                if ((LA(1) == K_feature)) {
                    featureUse();
                } else {
                    if ((LA(1) == K_script)) {
                        scriptAssign();
                    } else {
                        if ((LA(1) == K_language)) {
                            languageAssign();
                        } else {
                            if ((LA(1) == K_lookupflag)) {
                                lookupflagAssign();
                            } else {
                                if ((LA(1) == T_GCLASS)) {
                                    glyphClassAssign();
                                } else {
                                    if ((LA(1) == K_ignore)) {
                                        ignoresub_or_pos();
                                    } else {
                                        if ((setwd14[LA(1)] & 0x1)) {
                                            substitute();
                                        } else {
                                            if ((LA(1) == K_markClass)) {
                                                mark_statement();
                                            } else {
                                                if ((setwd14[LA(1)] & 0x2)) {
                                                    position();
                                                } else {
                                                    if ((LA(1) == K_parameters)) {
                                                        parameters();
                                                    } else {
                                                        if ((LA(1) == K_sizemenuname)) {
                                                            sizemenuname();
                                                        } else {
                                                            if ((LA(1) == K_feat_names)) {
                                                                featureNames();
                                                            } else {
                                                                if ((LA(1) == K_subtable)) {
                                                                    subtable();
                                                                } else {
                                                                    if ((LA(1) == 157)) {
                                                                    } else {
                                                                        zzFAIL(1, zzerr69, &zzMissSet, &zzMissText, &zzBadTok, &zzBadText, &zzErrk);
                                                                        goto fail;
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                zzEXIT(zztasp2);
            }
        }
        zzmatch(157);
        zzCONSUME;
        zzEXIT(zztasp1);
        return;
    fail:
        zzEXIT(zztasp1);
        zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
        zzresynch(setwd14, 0x4);
    }
}

ERROR: Could not install packages due to an EnvironmentError:

pip install -r requirements.txt

以下のようなエラーが出た。

何回も、

pip install -r requirements.txt

を行うと、進むときもある。

進まない場合だけ、個別に、ダウングレードを行った。

ERROR: Could not install packages due to an EnvironmentError: [WinError 5] アクセスが拒否されました。: 'c:\\users\\m_fuj\\documents\\pych
arm\\my_project\\venv\\lib\\site-packages\\pytz-2020.1.dist-info\\'
Consider using the `--user` option or check the permissions.
Installing collected packages: appdirs, pytz, Babel, fonttools, pyclipper, booleanOperations, jmespath, urllib3, six, python-dateutil, do
cutils, botocore, s3transfer, boto3, certifi, chardet, compreffor, cu2qu, defcon, fontMath, fontParts, setuptools, fs, future, idna, imag
esize, MarkupSafe, Jinja2, lxml, macholib, numpy, pyparsing, packaging, pandas, pefile, pip, Pygments, pywin32-ctypes, PyInstaller, sip,
PyQt5, PyQt5-sip, requests, snowballstemmer, sphinxcontrib-websupport, ufoLib, ufo-extractor, ufo2ft, unicodedata2, xlrd
  Attempting uninstall: pytz
    Found existing installation: pytz 2020.1
    Uninstalling pytz-2020.1:
ERROR: Could not install packages due to an EnvironmentError: [WinError 5] アクセスが拒否されました。: 'c:\\users\\m_fuj\\documents\\pych
arm\\my_project\\venv\\lib\\site-packages\\pytz-2020.1.dist-info\\'
Consider using the `--user` option or check the permissions.
>pip install --user -r requirements.txt
ERROR: Can not perform a '--user' install. User site-packages are not visible in this virtualenv.