Forum Feature requests

picture height must be multiple of line height

jim_albright
I am building a conversion for img of lines to points

*[size='9lines'] { height: 117pt;}
*[size='10lines']{ height: 130pt;}
*[size='11lines']{ height: 143pt;}
*[size='12lines']{ height: 156pt;}
*[size='13lines']{ height: 169pt;}

But if someone says this should be 10/12 instead of 11/13 I would need to change.

picture/image sizes in multiples of lines helps keep the horizontal alignment and backing up working. I don't know if CSS has considered lines as a unit of measure. Only works vertically though. The width needs to stay proportionally.

Just thinking ... I wonder if we could have a setting that would allow picture to fill column width (or page width) and height would be proportional with added padding to make the height come out to be multiple of the line height. Now that would really save me time.

Jim Albright
Wycliffe Bible Translators

oliof
So you want to avoid text to run out-of-register when embedding images?

I'm looking for the same, but not only for images, but tables, side bars, etc. as well.

Using a fixed, absolute line height would be very important.
jim_albright
out-of-register


Thanks for adding to my vocabulary.

An imperfect REGISTER, meaning that the two sides of a printed sheet do not back each other perfectly, or the impression is not in correct position in relation to the other matter already ruled or printed on the sheet.
http://palimpsest.stanford.edu/don/dt/dt2403.html

Amazing when we use the precise word we actually have a chance of communicating.

Yes. For every object (like a picture or table) added to the page it must fill a multiple of the line height in order to maintain "register".

Jim Albright
Wycliffe Bible Translators

oliof
I've been battling with register'd layout via Princexml for quite some time now.

The problems are as follows:

* If you have any kind of borders, these need to be computed agains line height, margin and padding to keep line height uniform. This might be a direct result from the box model which does stack like this:

content > margin > border > padding

* tables are a very bad special case of this. You need to craft your table-specific CSS very carefully, or your lines will go out-of-register

* It seems like defining a line-height does not implicity set a base line for fonts – I still have to provide source-code proof, but it seems that different base lines for different members of a font family (italic vs. small-caps) result in small deviations in line-height which puts the whole typeset out-of-register

* there is no clean way to have images scale to line-heights, unless you are define the body height a perfect multiple of line-height. If it is a clean divisor of the height, let's say the body has a height of 50 lines at 10pt, you should be able to scale in 2 percent steps. This will most probably clash with golden cut visual design rules.

Please note: I'm just an amateur, blindly feeling my way around this whole topic. I begin to wonder if we're taking PrinceXML to the limits of what it's designed for.

How to check if your layout registers on-screen: Create an image which is a multiple of line-height, having vertical bars for every single line of text you want to see and put this as a repeating background in your body style.
You will have strong visual cues to which parts of your layout throw stuff out-of register. Main culprits in my case: h[1234], unordered lists, definition lists, tables, styled elements with borders.

Here is a sample image for a line-height of 10pt:

jim_albright
Hello,

I like your background idea.

Thanks for the heads up on where to watch out. I haven't had problem with tables YET. Just because the gospel of Mark didn't have tables in it.

I had two columns so was able to increase size and just look to see if in register.

I have high hopes for CSS and Prince that they will be able to handle registration problems. We just have to be smart in using the tools.

Jim Albright
Wycliffe Bible Translators

mikeday
Have you tried "line-stacking-strategy: grid-height"? This will try to ensure that lines in a block end up with a line-height that it is an integral multiple of the block line-height, which helps when some lines would otherwise break the register.

That being said however, there are still cases in which the grid will not be maintained, such as tables and block-level images. This kind of layout is still new for CSS, and hopefully it's something that we and the CSS working group can improve over time.
jim_albright
I have developed a front end to Prince that insures that inserted pictures are a multiple of the line height. It is working well.

We still are waiting on being able to have an image span 2 columns.

Jim Albright
Wycliffe Bible Translators

oliof
Are you willing to share your frontend?
jim_albright
Yes. I'll contact you by email.

Program is Windows only for now.

Jim Albright
Wycliffe Bible Translators