Skip to content

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

Open
@Fredosixx

Description

@Fredosixx

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions