Hi, would you please consider support text-emphasis properties? I'm aware that these properties are still under draft, but however, have been already implemented in major browsers. Additionally, these properties are quite necessary in formatting some Asian languages (CJK languages), and there seems to be no acceptable workarounds without using these properties.
Hi, this is not a real substitute for built-in support, but if you are interested in a hack that can be used with Prince today I've managed to get the jQuery.emphasis library to work. It can be applied to the document in a reasonably clean way without adding a jQuery dependency or lots of JavaScript to the document itself.
Finally, you probably need to write a short helper script applying jQuery.emphasis() commands to the parts of the document you want emphasised. For example, if you have used the EM markup and a specific class name you would apply text-emphasis markup to - say
<p>Here is <em>emphasis applied</em>.</p>
<p class="dot-marked">This whole paragraph is marked with dots</p>
Thanks, this is quite helpful. I will give it a try.
Something not directly related to this topic, but it seems to be pretty tricky to get popular JS libraries work with Prince, e.g. MathJax. Now I need to call phantomjs first to generate an intermediate document with all formulas rendered as SVG and then feed it into Prince to build PDF. Do you have any idea if there is a way to get it work directly with Prince, let's say, with some sort of a hack script? Does it work differently using "--script" option instead of linking the script inside the document?
I have done some investigations of MathJax requirements already. Unfortunately that's a really tricky library to get working in Prince - not very surprising, it requires a lot of information about DOM dimensions and text metrics and so on to arrange the formulas, and when Prince runs JavaScript before doing layout that information simply isn't available. I can get MathJax to run with some compat hacks, but the formulas it generated looked like a mess of letters because of the missing layout metrics.
Now, Prince developers are very aware of this problem so perhaps the capability of reflowing a page and running JS along with layout, browser-style, will eventually land. It's a major, major job to implement though - touches how the entire architecture of the various parts gets organised.
Anyway, if I eventually find a hack that lets MathJax run I'll sure let you know
BTW - if there are other popular JS libraries you'd like to use, just let me know - for example create a new forum thread for each. It's often possible to make things work with a few fixes or hacks.
It's very nice to hear that the dev team is always ready to help.
MathJax is not an urgent issue, because it's OK for me to just let phantomjs do its job, and I think Prince should stick on its core features rather than to implement a full support towards Javascript.