Skip to main content

Minecraft text formatting, parsing, and rendering

Project description

mctext

Minecraft text formatting, parsing, and rendering library. Features all the exact glyphs used ingame, for the fonts of both pre and post-1.13.

Language Support

Language Package Registry
Rust mctext crates.io
Python mctext PyPI
JavaScript @hexze/mctext npm

Features

  • Text Parsing - Parse legacy § formatting codes and JSON chat components
  • Color Support - All 16 named Minecraft colors plus RGB hex colors
  • Style Handling - Bold, italic, underlined, strikethrough, obfuscated
  • Font Rendering - Measure and render text with authentic Minecraft fonts

Font Showcase

Font Showcase

Fonts Only

Looking for just the TTF files? Download them from the releases page:

  • minecraft-fonts-modern.zip - Latest Minecraft fonts (updated, cleaner look)
  • minecraft-fonts-legacy.zip - Classic fonts for those who prefer pre-1.13
  • minecraft-fonts-special.zip - Enchanting and Illager fonts

Usage

Rust

[dependencies]
mctext = "1.0"

# With legacy fonts:
mctext = { version = "1.0", features = ["legacy-fonts"] }
use mctext::McText;

let text = McText::parse("§cRed §lBold");
for span in text.spans() {
    println!("{}: {:?}", span.text, span.color);
}

Python

pip install mctext
import mctext

text = mctext.parse("§cRed §lBold")
for span in text.spans():
    print(f"{span.text}: {span.color}")

JavaScript

npm install @hexze/mctext
import { McText } from '@hexze/mctext';

const text = McText.parse("§cRed §lBold");
for (const span of text.spans()) {
    console.log(`${span.text}: ${span.color}`);
}

License

MIT

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

mctext-1.0.1.tar.gz (28.1 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

mctext-1.0.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.5 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

mctext-1.0.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (12.5 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ ARM64

mctext-1.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.5 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

mctext-1.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (12.5 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

mctext-1.0.1-cp311-cp311-win_amd64.whl (12.3 MB view details)

Uploaded CPython 3.11Windows x86-64

mctext-1.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.5 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

mctext-1.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (12.5 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ ARM64

mctext-1.0.1-cp311-cp311-macosx_11_0_arm64.whl (12.8 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

mctext-1.0.1-cp311-cp311-macosx_10_12_x86_64.whl (12.4 MB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

mctext-1.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.5 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

mctext-1.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (12.5 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ ARM64

mctext-1.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.5 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

mctext-1.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (12.5 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ ARM64

File details

Details for the file mctext-1.0.1.tar.gz.

File metadata

  • Download URL: mctext-1.0.1.tar.gz
  • Upload date:
  • Size: 28.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.10.2

File hashes

Hashes for mctext-1.0.1.tar.gz
Algorithm Hash digest
SHA256 709c90e89392dbd1b6d181d78d1ad72f576365845a07f9a74b22d0b480bf9cf0
MD5 818406d7cb00a4a07061b6bd9199229d
BLAKE2b-256 f678b218c689ea592e3f4e57cfdc18f9e92f2fb617c66e96809b3780db5f364a

See more details on using hashes here.

File details

Details for the file mctext-1.0.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mctext-1.0.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1f151a715fc525f1c10128b4f5baa7df5fcd05ae1fdb2619d42d67d96cda1676
MD5 88ec39b79ead987e026542ff91212c53
BLAKE2b-256 724ee98bccfa880d83cbdb7a8f05120f24bea9f45043ec522fdf80d635baa647

See more details on using hashes here.

File details

Details for the file mctext-1.0.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for mctext-1.0.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 4686a8cfab832f61bce548371aab5f72df3f7782ec7a13eb398e8955b7c72583
MD5 f24702200ecc40f09dbe04da83293722
BLAKE2b-256 779f99f55969d42aa7fce353051e9a5a64fb604bd7f63b448089abc138c4e368

See more details on using hashes here.

File details

Details for the file mctext-1.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mctext-1.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 020737b55963bf44600713da171df648e2487c50b97e81355f2f45f7b5ea0013
MD5 fe5e87dfda0ee97ae8371602e86ab37e
BLAKE2b-256 fe81859ebce54fe669ad442aa713aff0773727de9794545e1cf069eea4e9b438

See more details on using hashes here.

File details

Details for the file mctext-1.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for mctext-1.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 d478ddea378a610bc51e9c87a630ed48ef435d3e5e7ffc7cb28fbad66e7f65b9
MD5 86fb3836f33cd49f66432a159bd6abeb
BLAKE2b-256 5351f09774d20444819168d812fdaacdddedc3f3a6680f40de97608d1e52b59f

See more details on using hashes here.

File details

Details for the file mctext-1.0.1-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: mctext-1.0.1-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 12.3 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.10.2

File hashes

Hashes for mctext-1.0.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 5dda24110afc10190509f945349c41d938eb71cad7ba1e30795fca01b1d815da
MD5 5a405873e575735fb1fa55c48b5ba2a1
BLAKE2b-256 cb5fd97517cdf4c47963174bb2284c9d0a34cacabd2ca41a7520ab7fc275acba

See more details on using hashes here.

File details

Details for the file mctext-1.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mctext-1.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a9a151495a988aaaf2ebe5463d32300465e663601c37cc45356d5b6dcc6ac87b
MD5 3b08823c54d1862a4ac337ee61f3b4fc
BLAKE2b-256 f17c71310083b3aba16190406284376f6e99afd16e0b8339b9064dc070e848c7

See more details on using hashes here.

File details

Details for the file mctext-1.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for mctext-1.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 6e21813e1de90807376a8401bddfaf0f1923ea34b49916b7a2942dc639bdff09
MD5 534f70aa36287353b2d358e4aade4cf4
BLAKE2b-256 6ce209474d39cd2bed9d13f2e4692980c852cb5fcf164bc92ee7effa68517b24

See more details on using hashes here.

File details

Details for the file mctext-1.0.1-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for mctext-1.0.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 712f07ed5ed15ba70b2ea27dafd7e9d776a22a5ddb66ae7bee87be48edda2940
MD5 36eb42e96ca26605361b130688b1e9a0
BLAKE2b-256 cb57368d695317f09b3a3b204db587c6b05b759b26fe6017478da74e1929bda2

See more details on using hashes here.

File details

Details for the file mctext-1.0.1-cp311-cp311-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for mctext-1.0.1-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 4528cb7cac2cdba68b25d0b68249fae73262b58c0ffa6531492ad48c9f3e059c
MD5 61d7ff2a878d51b258da3abf67c93c37
BLAKE2b-256 5c3c5e4d2e348e84dd39233166a71ad584108cc40aa6a62d6562747e79e28a5d

See more details on using hashes here.

File details

Details for the file mctext-1.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mctext-1.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 551f151f776a9b023d8e5368ac300e025ef5c4cd63d7624f0e9d51f68ef26714
MD5 cfd331409a472ce65b6f5d5aac8297d1
BLAKE2b-256 77b07a2fb8d08cd1c28b927efc4dcf994fbaaebe870e706dce6d61a1198cad6c

See more details on using hashes here.

File details

Details for the file mctext-1.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for mctext-1.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 23c940b8ed242573cf44f95b5d30a84db0624428c4a50f4ac0779f0b1a491e65
MD5 9fb27a2a16dc2055b7c0c985340e1be9
BLAKE2b-256 d51ba0dada9e7ef81fce745573a563ca5b389c8f9e137d4b31a9f61184535822

See more details on using hashes here.

File details

Details for the file mctext-1.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mctext-1.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3778b6d22497ee13b256d1e997e221fb63e09b891f3eb89dd6c07e1f4dc57a46
MD5 266a1ec23e706411af6629a00b2e7b0a
BLAKE2b-256 e03b7df0eea0bd6447c48c015c9b7681f13acc2e25c845b5e251c87f505567d9

See more details on using hashes here.

File details

Details for the file mctext-1.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for mctext-1.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 9f5789d77eeda38db21bb010e5311e166d894d11cbf6b28065829c79ffd4e639
MD5 1f32f1233ffa2690696037dc7b6aeb33
BLAKE2b-256 92d31f06613c16dc8f38e067a583609e1cee29533fb1fd0e8f60f96db17ada2d

See more details on using hashes here.

Supported by

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