Skip to content

fix(tldraw): correct v2 text rendering - font sizes, fonts, line he…#70

Open
ritzalam wants to merge 1 commit intomainfrom
fix-wb-text-not-synched
Open

fix(tldraw): correct v2 text rendering - font sizes, fonts, line he…#70
ritzalam wants to merge 1 commit intomainfrom
fix-wb-text-not-synched

Conversation

@ritzalam
Copy link
Member

…ight, and text wrapping

tldraw v2 whiteboard text shapes were misaligned with pen marks drawn over
them due to incorrect font sizes, wrong font families, missing text width
constraint, and wrong line height in the renderer.

  • Fix v2 font sizes to match bbb-export-annotations (S:18, M:24, L:36, XL:44)
  • Use correct v2 font families (IBM Plex Sans/Serif/Mono, Shantell Sans)
  • Add v2 fonts (IBMPlexSans, IBMPlexSerif, IBMPlexMono, Shantell_Sans)
  • Constrain text width to shape width for proper word wrapping
  • Apply 1.35x line height multiplier matching tldraw v2 client
  • Reset pan/zoom on slide change to prevent stale zoom carry-over

…ght, and text wrapping

  tldraw v2 whiteboard text shapes were misaligned with pen marks drawn over
  them due to incorrect font sizes, wrong font families, missing text width
  constraint, and wrong line height in the renderer.

  - Fix v2 font sizes to match bbb-export-annotations (S:18, M:24, L:36, XL:44)
  - Use correct v2 font families (IBM Plex Sans/Serif/Mono, Shantell Sans)
  - Add v2 fonts (IBMPlexSans, IBMPlexSerif, IBMPlexMono, Shantell_Sans)
  - Constrain text width to shape width for proper word wrapping
  - Apply 1.35x line height multiplier matching tldraw v2 client
  - Reset pan/zoom on slide change to prevent stale zoom carry-over
@ritzalam ritzalam requested a review from kepstin March 11, 2026 04:35
Copy link
Contributor

@kepstin kepstin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure the font files include the version information, and add reuse compliant license files for them.

Formatting check does not currently pass.

)

TEXT_OUTLINE_WIDTH: float = 2.0
# tldraw v2 line height multiplier (from bbb-export-annotations/shapes/TextShape.js)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please find a reference in the actual client rendering code, not the bbb-export-annotations code.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes made here break compatibility with processing recordings made with tldraw v1. Recording processing needs to be backwards compatible.

Copy link
Contributor

@kepstin kepstin Mar 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change appears to be unrelated.

For compatibility reasons with older BBB versions, the pan/zoom of a slide needs to be preserved when switching back to a previously used slide. There is a lot of code in the tool which is there just to preserve the pan/zoom and this change is a hack job that causes that code to still run, but no longer be functional.

SizeStyle.LARGE: 96,
SizeStyle.L: 54,
SizeStyle.XL: 64,
# tldraw v2 text font sizes (from bbb-export-annotations/shapes/Shape.js)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please find a reference in the BBB client code for the font sizes, not bbb-export-annotations.

@kepstin
Copy link
Contributor

kepstin commented Mar 11, 2026

Note that there is another scaling issue affecting line widths and some other features of drawings: #66 - my original suspicion was that this was related to the font sizes being wrong, since the scaling of font sizes and scaling of line widths appears to be similar. It would be good to confirm whether the issue is just the font sizes being changed, or if there is a more fundamental scaling issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants