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

Feature Request: Using fill with multiple columns (bg and borders for paragraphs) #1130

Open
kmauric opened this issue Feb 29, 2024 · 4 comments

Comments

@kmauric
Copy link

kmauric commented Feb 29, 2024

Hello everyone,

I'm currently working on creating a 3-column layout, and I've found the text_columns feature to be incredibly useful. However, I'm encountering an issue when trying to add fill color to specific headings.

It appears that I can't use the .set_fill_color method alongside .write. Am I overlooking something here?

If anyone has insight on how to incorporate fill color within text columns, I would greatly appreciate your assistance. Thank you in advance for your help!

@gmischler
Copy link
Collaborator

I'm sure you've noticed that text_columns() doesn't currently support borders and background styling for the columns as a whole.

But what you really seem to want is to set background styling to individual chunks of text within a column. With the traditional methods, this was easy, because each formatted chunk of text requires its own [multi_]cell, which is inherently also a box that can have a background and border. Within text regions such as columns, any part of the text can be formatted differently than the rest, anywhere in the text flow. This makes it tricky to come up with rules about where its background starts and/or ends, because its outline is not necessarily a box. So on the level of individual write() calls, there is no obvious solution.

However, for someting like a heading, which tends to occupy a line (or several) of its own, the paragraph feature could be used. This is not an immediate solution either, but it has recently turned out that paragraphs could generally use some more formatting options than they currently offer (eg. indents, or maybe even specialized paragraph types for things like list items and possibly headings). It might similarly make sense to add a background colour to paragraphs (not quite sure yet about borders, though).

So this is the most likely approach of how your problem might eventually get solved. For now, we'll have to list it as a feature request here. If you (or anyone) want to try to implement it, that would be very welcome. Feel free to ask about any details on how to best integrate it into the existing structure.

@kmauric
Copy link
Author

kmauric commented Mar 4, 2024

Thanks for the response @gmischler . I understand that styling individual text chunks within columns presents challenges. I appreciate the suggestion to utilize the paragraph feature for headings and the potential for expanding paragraph formatting options in the future. Looking forward to any updates on this feature request.

@Lucas-C
Copy link
Member

Lucas-C commented May 24, 2024

@gmischler: should we keep this issue open as a remainder to implement paragraph styling?
Or that does not really need a reminder and we can close this?

@gmischler gmischler changed the title Using fill with multiple columns Feature Request: Using fill with multiple columns (bg and borders for paragraphs) May 24, 2024
@gmischler
Copy link
Collaborator

@gmischler: should we keep this issue open as a remainder to implement paragraph styling?

Well, it's a feature request, so it makes sense to keep it in the list until it gets implemented.

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

3 participants