Quote:
Originally Posted by kovidgoyal
Well you can do that in calibre as well without needing SVG by using the canvas element. Something like this for a header template
Code:
<header><canvas><script>
canvas = document.currentScript.parentNode
canvas.height = canvas.parentNode.scrollHeight
canvas.width = 1400
ctx = canvas.getContext("2d");
ctx.font = (canvas.parentNode.scrollHeight / 2) + "px sans-serif"
ctx.fillStyle = 'yellow';
ctx.fillRect(0, 0, canvas.width, canvas.height)
ctx.fillStyle = 'black';
ctx.fillText("section: _SECTION_", 5, canvas.parentNode.scrollHeight / 2);
You will need to edit the various sizes to get it to work well for your conversion.
|
Quote:
Originally Posted by Blaineoreski
Hi, Comfy.n,
Yeah! Lookit' THAT:
https://ibb.co/ykLxjwF
So, sounds like a combination of the plugin and the code. Buddy, that is WICKED cool!    
|
Yes-yes! WICKED cool indeed!
This is what worked:
PHP Code:
<header>
<canvas>
<script>
canvas = document.currentScript.parentNode;
canvas.height = 120;
canvas.width = 1400;
ctx = canvas.getContext("2d");
ctx.font = "12px sans-serif";
ctx.fillStyle = 'yellow';
ctx.fillRect(0, 0, canvas.width, canvas.height);
ctx.fillStyle = 'black';
ctx.fillText("section: _SECTION_", 5, canvas.height / 2 + 5);
working unselectable header - Nineteen eighty-four - George Orwell.pdf