feature to help book designers debug their line grid #930
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Dear WeasyPrint Team!
First of all: Thanks a lot to the maintainers here for creating WeasyPrint and making it open source. I am in the middle of doing an expansive book-publishing project with WeasyPrint and have found it absolutely great. I'm sure this software has a bright future.
This PR is a piece of functionality that I've added that helps me in debugging design issues for the book. There seems to be a pretty hard rule within the design profession that lines of a book on two opposing pages should always line up to the same raster. This is not always easy to do in HTML, since HTML will reflow stuff and if there is even a single box that is not the height you are expecting it to be, then it will move everything below it and push all the lines to go out of alignment.
So I've created this function where, by adding the parameter
--grid-debug somefile.csv
, weasyprint will create a filesomefile.csv
that the designer can expect to check if lines have the expected heights and their y_positions line up with each other.I'm hoping other people might find this useful, hence the PR.
Thanks again, and keep up the good work!
cheers,
Richard