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.4.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.4-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.4-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.4-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.4-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.4-cp311-cp311-win_amd64.whl (12.3 MB view details)

Uploaded CPython 3.11Windows x86-64

mctext-1.0.4-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.4-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.4-cp311-cp311-macosx_11_0_arm64.whl (12.8 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

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

Uploaded CPython 3.11macOS 10.12+ x86-64

mctext-1.0.4-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.4-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.4-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.4-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.4.tar.gz.

File metadata

  • Download URL: mctext-1.0.4.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.4.tar.gz
Algorithm Hash digest
SHA256 a1685f46e5b075ade0cf37883a8c65b02a85a5e5b88853ca9fc9a6fed3bb6784
MD5 038b5c5409e5a85fb9daa88bd5a259e2
BLAKE2b-256 c09c3989600e4d95bfd637a06cf7cbdf957b162d246a84735adf829387a4c30a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mctext-1.0.4-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9baed545de8c4aff254804ac82a32582b572fe3e777c9ce39557082ede184786
MD5 22838df5b2d0e4d18965f81b46bb6e03
BLAKE2b-256 ba3ad4af7e94245150776b35073e33d39080e13ad47fcd5a91b94767de600cad

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mctext-1.0.4-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 23de4e9559485ca019a483f6bc9c4b03436a9aba6f0f894d3a6c7d996fcc3817
MD5 b7b2e28d17dff54e4caefbab235ca543
BLAKE2b-256 604dffa0e31ac07d99a96531fd8b7e2f69f0cb53ee5fe7e5895242fffc7eed6e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mctext-1.0.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 22f0c35f1acb8dacbd16cc9e97fcf9a3083eee96f5cb7cbb45c343aca065d127
MD5 84e72333d0e3c30c3d0efc46a9181859
BLAKE2b-256 8899efe774e2b211385248a785f533b97910dc59b65e55ae6dc7df92ebaa988e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mctext-1.0.4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 b4f88e472b9058815f35a8e8f653061564b29b619783601569cddbd4686d86c3
MD5 3210f63746ea4e6bc226965584b9f113
BLAKE2b-256 54fa10295dbfed404cfe73d25ed72418dbc5ab5597e50da136a0a9e19e2c790d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mctext-1.0.4-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.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 19b4a84172d063e86da760b992078726b759cb847c8ed88eb3b5141080a11847
MD5 90f0aef11493207386c04f716f47ba38
BLAKE2b-256 d82abab638b2ef7822eb4097e6887a2931d7ed4f994a3be1ff02a810c1889759

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mctext-1.0.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 83fb15da52a65ce0e11bb655b1b83899dc49196b530cd7d621dff6966d759a6a
MD5 9551b3848a70ab1e3004cd9f210e8ec5
BLAKE2b-256 09c1205e4dcd3004947c9a9e50a4e74906946da02d1d9032f8e46c7a45d5fa84

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mctext-1.0.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 431a718c1562571bf3097595ff0eb7d03bc26bcbefa7957623b40fb9cc444845
MD5 2a1275ede21b5cdd2f68afd081843fb2
BLAKE2b-256 867ab5ac72543cb1174c4bee6c585ec21485c04b9cc7c2e8444f176560eda68a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mctext-1.0.4-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 46c2613db6412ee85977a8279f88ad073728390ef2133c4f7571cb11d68d2306
MD5 786a42d63b0be6a85f6d95ed722d9cb8
BLAKE2b-256 ce438effc48583bc3dabf41d0502599bdda787a27418f04e004bf7a0692356f3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mctext-1.0.4-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 982ba5934518b4b5480f905d2e8a4cb09c54f302ed5cbe27157dc7a5e365ffdb
MD5 ba9a02bb65c88fdaffb92bdb575c9112
BLAKE2b-256 e7a0550de40a6e3b2a69079e39bb9b58361bcb5be4c063e76119c6a9191885c6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mctext-1.0.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 43e3ac453c8f40c6d49e3f6f9a38bfdd9ade3f46fb10acf468e2be406581680d
MD5 61fcfe90a625377ad07dbcb541222024
BLAKE2b-256 ed6ca3f9b72e3bf3f619fe0ef59ca122bc6a90b81d5399ab72bb076f5110dd7d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mctext-1.0.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 bb19672b94b98429347c819cce5c5aadae14b7c12054a0be5dcc707fab705016
MD5 972aaf1c3dc049423e52bd6e22adbcd4
BLAKE2b-256 acdb135c7062516ea03ca2d5fd68b6e0032e091ca73a16a335351e6387f43c69

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mctext-1.0.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f8417fe4d83ac740904199ca7791d9f8043f30977f6bf1c2775d0778d7765f98
MD5 cb68a4dcd1c0c97b8d1c643048c73539
BLAKE2b-256 6e97f22c28f4201cfa0ecc1230bd3a8ea43670697f6b23efb203ab030d5cfb31

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mctext-1.0.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 3aaf0e250b26d0c18ca64091b26dd37500f2d9b0271a75b7081da36cb57eaef4
MD5 4e2504f4dea161d9c944834a36db5f73
BLAKE2b-256 b311642e601378288b5e8da1f27fbdf9ae2a201314c78273ec0d0a1de12d485d

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