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

[Request] [Layout API] More options to organize tables #1027

Open
Fredosixx opened this issue Jan 4, 2025 · 1 comment
Open

[Request] [Layout API] More options to organize tables #1027

Fredosixx opened this issue Jan 4, 2025 · 1 comment

Comments

@Fredosixx
Copy link

Fredosixx commented Jan 4, 2025

Unless I am wrong, there seems to be nothing for basic formatting of table:

  • cell margins - currently text is too close to the cell borders - workaround: create thin columns and lines and hide their borders
  • cell justifying - currently, no options - just Top Left - no easy workaround
  • text wrapping and cell height adjustment - currently nothing - workaround: I have to compute it myself and adjust the height of lines

A large part of the problem could be resolved if there was an extra method for FormattedText, where you could:

  • Specify a bounding box and an anchor type (to justify and wrap)
  • Get the actual height of the formatted text (after setting the style)

Currently:

bb = Geom::Bounds2d.new 1, 1, wid, hgt
ftext = Layout::FormattedText.new(some long text, bb)   # the text is wrapped but no way to justify it in the box
height = ftext.bounds.height    # return the SAME height as <bb> regardless of the text, not the actual height

What is requested:

bb = Geom::Bounds2d.new 1, 1, wid, hgt
ftext = Layout::FormattedText.new(some long text, bb, anchor_type)   # the text is wrapped and justified
real_height = ftext.bounds.height    # should return the actual height of the text
@thomthom
Copy link
Member

thomthom commented Jan 6, 2025

@ackarkka - are we missing all of this?

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

No branches or pull requests

2 participants