Giter Site home page Giter Site logo

jis-l2-charactors-writer's Introduction

JIS-L2-Charactors-Writer

なにこれ

特定ディレクトリ内のフォントファイルに基づき、JIS第二水準までの全角文字を画像へ書き出すだけのPythonスクリプトです。

#実際にはJIS-L2.txtを差し替えることで (フォントと文字集合回りの問題さえなければ) あらゆる文字を書き出せるはずなので、本当はRepository名詐欺ですが……

要るもの

  • Python 3.x (開発上は3.6.2を使用)
  • Pillow (PIL Python 3.x fork, PIPでインストール可)
  • 書き出すフォントファイル (.ttcとか.ttfとか、OpenTypeで扱えるなら問題ないはず)

使い方

prop.jsonへ必要事項 (fonts/書き出しフォント、output_dir/出力先ディレクトリ、charfile/文字ファイル、size/出力のサイズ情報) を現行のものを参考に記述の上、以下の要領で実行します。

python script.py prop.json

1フォントあたり6284ファイルが生成されます。

現状の問題

全角スペースはPython的に面倒 (\u3000問題……) であるため出力しません。 この制御はJIS-L2.txtから全角スペースを排除することで行われているため、必要であれば追加することは可能ですが、Pythonは\u3000に対しエラーを吐くことに注意してください。

jis-l2-charactors-writer's People

Contributors

wingsys avatar

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.