Giter Site home page Giter Site logo

subfont's People

Contributors

minacle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

subfont's Issues

Crashed with fontTools.ttLib.TTLibError: specify a font number between 0 and 27 (inclusive)

Trying to use the script against a SVG(intentionally), it crashes with this error:

python3.6 subfont.py -f ~/.local/share/fonts/Adobe\ -\ Source\ Han\ Serif\ 思源宋體\ -\ 開放來源碼的泛\ CJK\ 字體/SourceHanSerif.ttc --output-directory . -- ~/工作空間/社群/台灣在地化社群/臺灣在地化社群的標誌/來源碼/l10n-tw-logo.svg                                                                                  
found 0 characters.                                                                                                                                          
Traceback (most recent call last):                                                                                                                           
  File "/usr/local/bin/pyftsubset", line 11, in <module>                                                                                                     
    sys.exit(main())                                                                                                                                         
  File "/usr/local/lib/python3.6/dist-packages/fontTools/misc/loggingTools.py", line 372, in wrapper                                                         
    return func(*args, **kwds)                                                                                                                               
  File "/usr/local/lib/python3.6/dist-packages/fontTools/subset/__init__.py", line 2954, in main                                                             
    font = load_font(fontfile, options, dontLoadGlyphNames=dontLoadGlyphNames)                                                                               
  File "/usr/local/lib/python3.6/dist-packages/fontTools/misc/loggingTools.py", line 372, in wrapper                                                         
    return func(*args, **kwds)                                                                                                                               
  File "/usr/local/lib/python3.6/dist-packages/fontTools/subset/__init__.py", line 2801, in load_font                                                        
    lazy=lazy)                                                                                                                                               
  File "/usr/local/lib/python3.6/dist-packages/fontTools/ttLib/__init__.py", line 180, in __init__
    self.reader = sfnt.SFNTReader(file, checkChecksums, fontNumber=fontNumber)
  File "/usr/local/lib/python3.6/dist-packages/fontTools/ttLib/sfnt.py", line 62, in __init__
    raise ttLib.TTLibError("specify a font number between 0 and %d (inclusive)" % (self.numFonts - 1))
fontTools.ttLib.TTLibError: specify a font number between 0 and 27 (inclusive)
generation failed ~/.local/share/fonts/Adobe - Source Han Serif 思源宋體 - 開放來源碼的泛 CJK 字體/SourceHanSerif.ttc

subfont.py: error: the following arguments are required: FILE

Is it possible to make this argument optional?
It would be nice to use all characters if FILE is not provided.

Another improvement could be to support also chars instead of argument:
python subfont.py -f MyFont.ttf -- "abcdefghijklmnopqrstuvwxyz0123456789"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.