https://github.com/hboyd2003/chasm
A text width & spacing library for Minecraft: Java Edition
https://github.com/hboyd2003/chasm
library minecraft minecraft-library minecraft-plugin papermc-library papermc-plugin
Last synced: 22 days ago
JSON representation
A text width & spacing library for Minecraft: Java Edition
- Host: GitHub
- URL: https://github.com/hboyd2003/chasm
- Owner: hboyd2003
- License: other
- Created: 2026-03-18T04:07:52.000Z (4 months ago)
- Default Branch: master
- Last Pushed: 2026-04-13T00:21:34.000Z (3 months ago)
- Last Synced: 2026-04-13T02:23:04.830Z (3 months ago)
- Topics: library, minecraft, minecraft-library, minecraft-plugin, papermc-library, papermc-plugin
- Language: Java
- Homepage:
- Size: 101 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Chasm
A library for calculating the width of and spacing text/components in Minecraft: Java Edition.
Chasm provides the ability to calculate the display width of any text using any font. By default, it provides a
simplified version of Minecraft's default font but provided with a resource pack it can load the fonts within and
provide width calculations for them. For loading of all of Minecraft's default fonts the chasm-plugin is available.
## Getting Started
Use Chasm as a library dependency from your Gradle project.
### Installing
```kotlin
repositories {
mavenCentral()
maven("https://repo.hboyd.dev/snapshots/")
}
dependencies {
implementation("dev.hboyd:chasm-lib:1.0.1")
}
```
## Usage
### Width calculation
`TextWidthProvider` calculates the rendered width of Adventure components, strings, codepoints, and `StyledGlyph`s.
The `TextWidthProvider` uses fonts registered with the `FontRegistry` it is created with.
## License
This project is licensed under the GNU Lesser General Public License v3.0. See [LICENSE.md](LICENSE.md).