のねのBlog

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

setsnap

sub ShowUsage {
  print STDOUT &fix(<<ENDUSAGE);
  setsnap.pl Version 02/16/2018
  setsnap.pl [-u] [-h]
  setsnap.pl < stemHist-generated-stemwidth-reports
  setsnap.pl -s [-n] < stemHist-generated-stemwidth-reports
  setsnap.pl [-o [-b<bot_pt_size>] [-t<top_pt_size>] [-r<dpi>]] [-n] < stemHist-generated-stemwidth-reports
  Calculates highest-frequency or optimal stem width values in one or more
  stemHist-generated stemwidth reports.
ENDUSAGE
}

sub ShowHelp {
  print STDOUT &fix(<<ENDHELP);
  OPTIONS:
   -u = Displays only the version and command-line options
   -h = Displays this help page

   -o = Calculate optimal values based on point size range and resolution
   -b = Bottom (lower) end of point size range; 
           used only with '-o' option
   -t = Top (upper) end of point size range; 
           used only with '-o' option
   -r = Resolution expressed in dpi; 
           used only with '-o' option

   -n = Disables the writing of a newline character
           (this is useful when executing from another script)

   -s = Writes to STDOUT a new stemHist output file that includes only the
        stem counts and their widths in decreasing stem-count order
       (this is useful when concatenating multiple stemHist output files)

       When no options are used, 
       the highest-frequency stem width value is reported, 
       along with its frequency in parentheses.

        When the '-o' option is used, 
        the '-b', '-t', and '-r' options can also be used, 
        and their default values are 9 (points), 24 (points), and 72 (dpi),
        respectively. 

      The optimal value is output in brackets, followed by secondary
        and tertiary values.
ENDHELP

perl-scripts/setsnap.pl at master · adobe-type-tools/perl-scripts · GitHub

psstemhist

This program is actually the same tool as psautohint but with a different face. It provides reports which help in selecting the global hint data and alignment zones for Type 1 hinting. You should look at the reports from this tool in order to select the most common stem widths, and then use a program such as FontLab or RoboFont to set the values in the font. This should be done before hinting the font. Works with Type 1 and OpenType/CFF fonts only.

sfntedit help

/* Print usage information */
static void printUsage(void) {
    printf(
"Usage:\n"
"    %s [options] <srcfile> [<dstfile>]\n"
"OR: %s  -X <scriptfile>\n"
"\n"
"Options:\n"
"    -x <tag>[=<file>][,<tag>[=<file>]]+ extract table to file\n"
"    -d <tag>[,<tag>]+ delete table\n"
"    -a <tag>=<file>[,<tag>=<file>]+ add (or replace) table\n"
"    -l list sfnt directory (default)\n"
"    -c check checksums\n"
"    -f fix checksums (implies -c)\n"
"    -u print usage\n"
"    -h print help\n"
"    -X execute command-lines from <scriptfile> [default: sfntedit.scr]\n"
            "\n"
            "Build:\n"
            "    Version: %s\n"
            "\n",
            global.progname,
            global.progname,
            VERSION);
}

afdko/main.c at 01a35dacc9e8d1735b7f752f3232d38c34e6f843 · adobe-type-tools/afdko · GitHub

ERROR: Font has neither StemSnapV nor StdVW!

ERROR: Font has neither StemSnapV nor StdVW!

if hasattr(privateDict, "StemSnapV"):
    vstems = privateDict.StemSnapV
elif hasattr(privateDict, "StdVW"):
    vstems = [privateDict.StdVW]
else:
    if allow_no_blues:
        # dummy value. Needs to be 
        #larger than any hint will likely be,
        # as the autohint program 
        # strips out any hint wider than twice
        # the largest global stem width.
        vstems = [upm]
    else:
        raise FontParseError(
            "Font has neither StemSnapV nor StdVW!")

psautohint/otfFont.py at master · adobe-type-tools/psautohint · GitHub

    def getFontInfo(self,
         allow_no_blues,
         noFlex,
         vCounterGlyphs,
         hCounterGlyphs,
         fdIndex=0):
def get_fontinfo_list_withFDArray(
    options,
    font,
    glyph_list,
    is_var=False):

    lastFDIndex = None
    fontinfo_list = {}
    for name in glyph_list:
        # get new fontinfo string 
        # if FDarray index has changed,
        # as each FontDict has 
        # different alignment zones.
        fdIndex = font.getfdIndex(name)
        if not fdIndex == lastFDIndex:
            lastFDIndex = fdIndex
            fddict = font.getFontInfo(
                          options.allow_no_blues,
                          options.noFlex,
                          options.vCounterGlyphs,
                          options.hCounterGlyphs,
                          fdIndex)
            fontinfo = fddict.getFontInfo()
        fontinfo_list[name] = (fontinfo, None, None)

    return fontinfo_list

psautohint/autohint.py at master · adobe-type-tools/psautohint · GitHub