You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by Benoite142 October 10, 2024
Hi,
I've been trying to center a TitleStyle for quite some time now. I've been using a TitleStyle for the start_section function used in the TOC placeholder and I am having a lot of trouble trying to center the TitleStyle. I know we can easily center some cell or text with align='C' but I found no way of doing that for the TitleStyle. I know we can put a value to the l_margin to make it look like it is centered, but I can't really use that since all of my titles differs in length.
I also tried aligning everything to the center of the page, but that still doesn't work with TitleStyle and the sections.
Worst case scenario is that I put everything on the left, but I would really want it to be centered.
If anyone knows how I could do this, please let me know.
Thank you for you time 😊
The text was updated successfully, but these errors were encountered:
Lucas-C
changed the title
Feature request: allow horizontal centering in TitleStyle
Feature request: allow horizontal centering in TextStyle
Oct 11, 2024
Proposed solution
.l_margin
in TextStyle.l_margin
is used in FPDF._use_title_style(), if it isAlign.C
, then horizontally align the textThe PR implementing this should include unit tests using
FPDF.start_section()
Discussed in #1280
Originally posted by Benoite142 October 10, 2024
Hi,
I've been trying to center a TitleStyle for quite some time now. I've been using a TitleStyle for the
start_section
function used in the TOC placeholder and I am having a lot of trouble trying to center the TitleStyle. I know we can easily center some cell or text withalign='C'
but I found no way of doing that for the TitleStyle. I know we can put a value to thel_margin
to make it look like it is centered, but I can't really use that since all of my titles differs in length.I also tried aligning everything to the center of the page, but that still doesn't work with TitleStyle and the sections.
Worst case scenario is that I put everything on the left, but I would really want it to be centered.
If anyone knows how I could do this, please let me know.
Thank you for you time 😊
The text was updated successfully, but these errors were encountered: