Skip to content

Conversation

privatestefans
Copy link
Contributor

@privatestefans privatestefans commented Jul 11, 2025

Description of change
  • Ensure multi-line text spacing looks similar with new PIXI.Text(...)
  • Allow BitmapText to override the lineHeight configured in a custom font that installed using BitmapFont.install(...). This ensures the lineHeight configured by the user in BitmapText takes precedence, while the value originally set in BitmapFont will be ignored.”
  • Fix final BitmapText height when using the lineHeight
Pre-Merge Checklist
  • Tests and/or benchmarks are included
  • Lint process passed (npm run lint)
  • Tests passed (npm run test)

Preview

Playground: https://www.pixiplayground.com/#/edit/V6gL8z_bGalT5yiW4Mqv2 (v8.11.0)

Before: electron_9psb71oQEt
After: electron_TGf0negTN8

Link

- Ensure multi-line text spacing looks similar with `new PIXI.Text(...)`
- Allow overriding the `lineHeight` from a custom font that installed using `BitmapFont.install(...)`
- Fix final `BitmapText` height when using the `lineHeight`
- If no `lineHeight` is specified when installing the `BitmapFont`, the default value will be `fontMetrics.fontSize`, which may affect the layout of any `BitmapText` that does not explicitly set a `lineHeight`.
Copy link

codesandbox-ci bot commented Jul 11, 2025

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 272dc68:

Sandbox Source
pixi.js-sandbox Configuration

…l tests

If no custom line height is specified when using BitmapText, I decided to use the font size from the font metrics when calculating the line height — and it seems it's fixed the characters that shifted downward on some tests.
Copy link

pkg-pr-new bot commented Jul 23, 2025

pixi.js-basepixi.js-bunny-mark

npm i https://pkg.pr.new/pixijs/pixijs/pixi.js@11531

commit: ebc5008

@Zyie Zyie added the ✅ Ready To Merge Helpful when issues are in the queue waiting to get merged. This means the PR is completed and has t label Aug 5, 2025
@Zyie Zyie added this pull request to the merge queue Aug 5, 2025
Merged via the queue into pixijs:dev with commit a2c0986 Aug 5, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✅ Ready To Merge Helpful when issues are in the queue waiting to get merged. This means the PR is completed and has t
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: BitmapText's lineHeight is incorrect Bug: Using dynamically generated BitmapFont prevents lineHeight & fill
2 participants