Forum How do I...?

CSS Ruby

timtribe
Hi,

Thanks for an awesome program.

I have a need to create some Chinese PDFs where some words have markers underneath, kinda equivalent to italics in English. The CSS for this is called Ruby (https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Ruby), but I don't believe the spec has been finalised yet.

I can't find anything in the Prince documentation or forum to suggest how this might be achieved right now.

Help!

Many thanks,

- Tim

mikeday
Using an inline-table you can achieve some ruby effects, like this:
<style>
.ruby { display: inline-table }
.ruby span { display: table-row; text-align: center; font-size: 83% }
</style>
<p>
Hello, <span class="ruby">complicated<span>below</span></span> world!
</p>

However the markup will need to be more intricate if you require more complicated ruby.

(There is also text-emphasis, for putting dots and other markers on characters, but Prince does not support this yet).
timtribe
Many thanks Mike.

My need right now is just to put markers below CJK characters. And I managed to find a way to do that using a linear gradient on a bottom border! But your solution will allow us to go beyond just markers and use actual characters - thanks.

BTW. I think your markup/css could be re-written to use the actual proposed ruby tags :)