Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pixel width #59

Closed
kashike opened this issue Mar 30, 2020 · 2 comments
Closed

Pixel width #59

kashike opened this issue Mar 30, 2020 · 2 comments
Assignees

Comments

@kashike
Copy link
Member

kashike commented Mar 30, 2020

The ability to find the pixel-width of a single character, or the content of an entire component (and children).

public interface PixelWidthSource {
  int width(final @NonNull Component component);

  int width(final char character);
}
@Electroid
Copy link
Member

My project has an implementation for pixel width you or anyone are free to use, modify, or redistribute:

https://github.com/Electroid/PGM/blob/389839a654c267df55113a32377e1d06a73c4b8e/util-bukkit/src/main/java/tc/oc/util/bukkit/component/ComponentUtils.java#L17 (or anything else in the linked class)

@zml2008
Copy link
Member

zml2008 commented Feb 26, 2022

Based on discussions in #262, we've decided this makes more sense to be released as an external library, unless Mojang changes what they offer us.

@zml2008 zml2008 closed this as completed Feb 26, 2022
@zml2008 zml2008 self-assigned this Feb 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants