jMonkeyEngine / jMonkeyEngine/jmonkeyengine

Minor BitmapFont code architecture issues

Open
#2,221 2 comments 1 reaction 1 assignee View on GitHub

@jaime-jmebot is already working on this.

Since Sep 19, 2026.

Dominant language
Java
Stars
4.3k
Forks
1.2k
Avg merge
4d 7h
Merged PRs (30d)
14

Description

Minor BitmapFont code architecture issues. Functionally it works just fine :)

  1. https://github.com/jMonkeyEngine/jmonkeyengine/blob/master/jme3-core/src/main/java/com/jme3/font/BitmapTextPage.java constructor takes in parameter arrayBased. It never uses it, it is always true. Some of these have been deprecated already in the hierarchy, maybe this one should also be. Now it is just confusing
  2. https://github.com/jMonkeyEngine/jmonkeyengine/blob/ea715d80257c7c2c9a17d0e44ccd86176e5a0dc2/jme3-core/src/main/java/com/jme3/font/BitmapTextPage.java#L153 is called every frame your text changes. This might be all the time, like with the jME FPS counter. pageQuads is LinkedList, and the said method heavily uses get(int) on it. This is not great, n^2 problem, right?
  3. https://github.com/jMonkeyEngine/jmonkeyengine/blob/ea715d80257c7c2c9a17d0e44ccd86176e5a0dc2/jme3-core/src/main/java/com/jme3/font/ColorTags.java#L68, same with all the implementations that use this in jME code. Go through the collection using get(int).

LinkedList is probably utilized since its steady add performance and that it doesn't leave potentially big arrays behind (if your text goes from being 2,147,483,647 to 1 character... you'll never recover). At least point 2 could be covered by a for each loop on the LinkedList and having a manual counter for the index as it is needed elsewhere.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.