PyxelXL
I am using this for my own game dev purposes, and this is beta-quality software.
"Bloat"-ish extensions for Pyxel, that might not fit the retro game-dev aesthetic, but fits more for the "let's throw up some constraints for our game jam so we can focus" aesthetic.
Fast TTF drawing for Pyxel, including support for layout (align, wrapping) and experimental support for anti-aliasing. This library is in the works to become a general purpose "bloated" set of extensions for Pyxel, but for now it only includes a font rendering extension and a center-rotation extension.
Installation
You can install PyxelXL using pip:
pip install pyxelxl
Usage
To use a TTF font in your Pyxel application:
import pyxel
from pyxelxl.font import Font
from pyxelxl import LayoutOpts
roboto = Font("/path/to/Roboto-Regular.ttf")
zh_font = Font("/path/to/zpix.ttf")
class App:
def __init__(self):
pyxel.init(160, 120, title="PyxelXL Example")
pyxel.run(self.update, self.draw)
def update(self):
pass
def draw(self):
pyxel.cls(1)
roboto.text(
0,
0,
"Hello, World! Antialiased",
7,
font_size=16,
layout=LayoutOpts(max_width=160, horizontal_align="center"),
)
zh_font.text(
0,
40,
"我能吞下玻璃而不伤身体" * 5,
7,
font_size=12,
layout=LayoutOpts(max_width=160),
)
roboto.text(
0, 80, "Hello, World! Not antialiased", 15, font_size=16, threshold=128
) # layout is optional. Thresholding makes the text look pixelated.
App()
LayoutOpts, Text Wrapping, and Alignment
LayoutOpts is a class used to define layout options for text rendering in pyxelxl.
Attributes
-
max_width:Optional[int]- The maximum width of the text layout in pixels. If
None, the width is not constrained. Wrapping will occur if the text exceeds this width.
- The maximum width of the text layout in pixels. If
-
max_height:Optional[int]- The maximum height of the text layout in pixels. If
None, the height is not constrained.
- The maximum height of the text layout in pixels. If
-
horizontal_align:str- The horizontal alignment of the text. It can be one of the following values:
"left""center""right"
- Default is
"left".
- The horizontal alignment of the text. It can be one of the following values:
-
vertical_align:str- The vertical alignment of the text. It can be one of the following values:
"top""center""bottom"
- Default is
"top".
- The vertical alignment of the text. It can be one of the following values:
-
line_height_mult:Optional[float]- The multiplier for line height. If
None, the line height is determined by the font size.
- The multiplier for line height. If
Center Rotation
from pyxelxl.rotate import blt
blt(80 - 32, 60 - 32, self.square, 0, 0, 64, 64, colkey=0, rot=self.angle)
# The rotation center is at (80, 60) in the global coordinate system.
Advantages
- Fast for font rendering
- Easy multi-font size support
- Anti-aliasing algorithm for non-pixel fonts
Acknowledgements
Heavy-lifting done by fontdue, and obviously this library will not be here if not for Pyxel.
Metadata
Release files for pyxelxl 0.0.18
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyxelxl-0.0.18.tar.gz | 165.3 kB | Without provenance | Details for pyxelxl-0.0.18.tar.gz |
Built distributions (wheels)
Total release size: 6.4 MB
Release files / pyxelxl-0.0.18.tar.gz
| Download URL | pyxelxl-0.0.18.tar.gz |
|---|---|
| Size | 165.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b5e3b63c3d4e18066d5c081e54e22b730a2d81d59204bbb2a5ca2f6bf71ea06f
|
|
BLAKE2b-256 checksum How to use checksums |
49f454037c44406263ba46fa40143f8effab01bc0e98dfc553211d1fb7d6f4c0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.7.0
|
Release files / pyxelxl-0.0.18-cp37-abi3-win_amd64.whl
| Download URL | pyxelxl-0.0.18-cp37-abi3-win_amd64.whl |
|---|---|
| Size | 320.5 kB |
| Tags | CPython 3.7 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
63769b7103b003e662253bb7e7c7405b0e7f898ee64220b9c9f29f29a7412fa9
|
|
BLAKE2b-256 checksum How to use checksums |
92be682080b55da2921259b7695c01392131a3e1e8a70a26589b9e962bbc4a7b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.7.0
|
Release files / pyxelxl-0.0.18-cp37-abi3-win32.whl
| Download URL | pyxelxl-0.0.18-cp37-abi3-win32.whl |
|---|---|
| Size | 312.3 kB |
| Tags | CPython 3.7 Windows x86-32 abi3 |
|
SHA-256 checksum How to use checksums |
9c0f92da73b23c8ccce17630ae3391508fcbea0b3e28e6d01d1dd1c701f60115
|
|
BLAKE2b-256 checksum How to use checksums |
ba0cf69352c3ce4527bd8af3fcb69fd938bd891063415673805847dde74553b5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.7.0
|
Release files / pyxelxl-0.0.18-cp37-abi3-musllinux_1_2_x86_64.whl
| Download URL | pyxelxl-0.0.18-cp37-abi3-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 662.7 kB |
| Tags | CPython 3.7 Linux musl 1.2+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
581beabbb1c26e3b34c302759cb2845f90b667102e614ebb6fd634a5488ec664
|
|
BLAKE2b-256 checksum How to use checksums |
4718e43cc2b1372c7ededfc9d0ee9ed15fd48aaaeb33ccb6178bdc7a015c30ea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.7.0
|
Release files / pyxelxl-0.0.18-cp37-abi3-musllinux_1_2_i686.whl
| Download URL | pyxelxl-0.0.18-cp37-abi3-musllinux_1_2_i686.whl |
|---|---|
| Size | 687.9 kB |
| Tags | CPython 3.7 Linux musl 1.2+ x86-32 abi3 |
|
SHA-256 checksum How to use checksums |
cba56f12277d156cd0079f2fbd830204c120a4fd6d1487676376c1ad2bafb684
|
|
BLAKE2b-256 checksum How to use checksums |
099f8c83778a5ee683cb531f36d763b83bb1747ef13f8775109feb1017acde56
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.7.0
|
Release files / pyxelxl-0.0.18-cp37-abi3-musllinux_1_2_armv7l.whl
| Download URL | pyxelxl-0.0.18-cp37-abi3-musllinux_1_2_armv7l.whl |
|---|---|
| Size | 758.0 kB |
| Tags | CPython 3.7 Linux musl 1.2+ ARMv7l abi3 |
|
SHA-256 checksum How to use checksums |
be69149b0ca9fabb15a200294274bddbd11c26aa02ae8bde806fd35f9edecc7a
|
|
BLAKE2b-256 checksum How to use checksums |
519a3e3c861e056312be0adccfcc2237b80e08ed5c7c91c6f9daf5ed78282ec1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.7.0
|
Release files / pyxelxl-0.0.18-cp37-abi3-musllinux_1_2_aarch64.whl
| Download URL | pyxelxl-0.0.18-cp37-abi3-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 669.3 kB |
| Tags | CPython 3.7 Linux musl 1.2+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
53ce6f217b8f1de69870bd9dce06e3d494328e7ad30c5f9941a4cec0b2c290a8
|
|
BLAKE2b-256 checksum How to use checksums |
dc477207f8573e737c952431d38f9ec5d193a2f59dc24c752a3e1fce7ada839d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.7.0
|
Release files / pyxelxl-0.0.18-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | pyxelxl-0.0.18-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 491.5 kB |
| Tags | CPython 3.7 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
7950ac26397c2f8e2d22a21cd22b989117a8d201195a7db549e369271944ce58
|
|
BLAKE2b-256 checksum How to use checksums |
49c6c26294ca4b7e7dbb46cc9c0e0186cc661845c0f87a8aee19033178fb80a6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.7.0
|
Release files / pyxelxl-0.0.18-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
| Download URL | pyxelxl-0.0.18-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl |
|---|---|
| Size | 494.9 kB |
| Tags | CPython 3.7 Linux glibc 2.17+ ARMv7l abi3 |
|
SHA-256 checksum How to use checksums |
3de72854c69d5b461729cf120f39e3467ba9101d2856d8d23963964940efd043
|
|
BLAKE2b-256 checksum How to use checksums |
cebbc7e9dfe3e83f5a6719e47a91603b9fe66b85425dc1a51b8ee118eedce1cd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.7.0
|
Release files / pyxelxl-0.0.18-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | pyxelxl-0.0.18-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 492.4 kB |
| Tags | CPython 3.7 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
57f5fa86c3a644666ade67161822dc385897e48aee9fb9979de5e1f26bae0c82
|
|
BLAKE2b-256 checksum How to use checksums |
65707ea30a9533d060de56acd86ee1a42a3d054213e3326dfb5d4657eeb06c05
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.7.0
|
Release files / pyxelxl-0.0.18-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.whl
| Download URL | pyxelxl-0.0.18-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.whl |
|---|---|
| Size | 515.6 kB |
| Tags | CPython 3.7 Linux glibc 2.5+ x86-32 abi3 |
|
SHA-256 checksum How to use checksums |
2b2cc374c6233b6ff24f820f3d5b5d064bddc21545d651e0ee79473df22720e4
|
|
BLAKE2b-256 checksum How to use checksums |
74ef39106862a7a5f7d1bedbf98f93f4ad5db49c4b78d1dd7b4e7b608cfc9abb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.7.0
|
Release files / pyxelxl-0.0.18-cp37-abi3-macosx_11_0_arm64.whl
| Download URL | pyxelxl-0.0.18-cp37-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 429.9 kB |
| Tags | CPython 3.7 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
e3cb4b5b4734429f90e183021f76ec36775225128347f04e89f86cab51ba5f4d
|
|
BLAKE2b-256 checksum How to use checksums |
e1ccebd58e3737ffdf580c003d23b2bd682a14b154d5a511edd0d709e48ed13d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.7.0
|
Release files / pyxelxl-0.0.18-cp37-abi3-macosx_10_12_x86_64.whl
| Download URL | pyxelxl-0.0.18-cp37-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 436.6 kB |
| Tags | CPython 3.7 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
fd5e62c7ce8703957dc7c267b3c6b195fa73258a0f8d63946d2232d0b100b5c9
|
|
BLAKE2b-256 checksum How to use checksums |
78a3cadd871b92ede4917524f790247ea27e64a40558d5cbf58f3c5a4b505c62
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.7.0
|
Security for pyxelxl 0.0.18
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.