Skip to main content

An extension tool to add fonts to the public "pyxel" library.

Project description

PyxelUniversalFont

PyxelUniversalFontは、公開されている"pyxel"ライブラリにフォントを追加するための拡張ツールです。

目次

機能

  • pyxelで使える追加のフォントを簡単にインストール
  • カスタムフォントの追加サポート
  • pyxelのゲームやアプリケーションでの文字表示を綺麗に、多様に

インストール方法

pip install PyxelUniversalFont

その後、pyxelのプロジェクト内で以下のようにインポートしてください。

import PyxelUniversalFont

使用方法

import pyxel
import PyxelUniversalFont as puf

class App:
    def __init__(self) -> None:
        pyxel.init(500, 100)
        
        # フォントを指定
        self.writer = puf.Writer("IPA_Gothic")
        
        pyxel.run(self.update, self.draw)
        
    def update(self):
        pass
    
    def draw(self):
        pyxel.cls(7)

        # draw(x座標, y座標, テキスト, フォントサイズ, 色, 背景色)
        self.writer.draw(0, 0, "こんにちは、世界!", 48, 0, 7)

if __name__ == "__main__": 
    App()

サポートしているフォント

以下は、デフォルトでサポートされているフォントです。

  • IPA ゴシック
  • IPA Pゴシック
  • IPA 明朝
  • IPA P明朝

次のコマンドで開かれるディレクトリに、任意のフォントを追加できます。

puf edit

コマンド一覧

  1. サンプルアプリケーションの起動:
    puf sample
    
  2. フォント保存用ディレクトリを開く:
    puf edit
    

ライセンス

MITライセンスの下で公開されています。詳細はLICENSEファイルを参照してください。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyxel-universal-font-0.4.6.tar.gz (20.0 MB view hashes)

Uploaded Source

Built Distribution

pyxel_universal_font-0.4.6-py3-none-any.whl (20.0 MB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page