View Single Post
Old 10-18-2024, 03:24 AM   #32
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,665
Karma: 7908443
Join Date: Sep 2020
Device: none
Quote:
Originally Posted by Blaineoreski View Post

In the GUI conversion interface, which tab should I put this code into? What are the steps?

Ski
Well, as I understand, you can use just _WIDTH_PIXELS_ (or height...) instead of having to guess those values, which vary across different documents.

So, for instance, you can paste this in the Header field:


PHP Code:
<header>
<
canvas style="width: _WIDTH_PIXELS_ ; height: _HEIGHT_PIXELS_;">
<
script>
canvas document.currentScript.parentNode
window.getComputedStyle(canvas)
ctx canvas.getContext("2d");
  
ctx.font "12px sans-serif";
ctx.fillStyle 'grey';
ctx.fillText("_TITLE_"2canvas.height 3);
ctx.fillText("_SECTION_"250canvas.height 3); 
instead of

PHP Code:
<header>
<
canvas style="width: 1400 ; height: 120;">
<
script>
canvas document.currentScript.parentNode
window.getComputedStyle(canvas)
ctx canvas.getContext("2d");
  
ctx.font "12px sans-serif";
ctx.fillStyle 'grey';
ctx.fillText("_TITLE_"2canvas.height 3);
ctx.fillText("_SECTION_"250canvas.height 3); 
The numbers 2 and 250 represent the x-position, Kovid may want to correct me if this is not accurate.

Last edited by Comfy.n; 10-18-2024 at 03:34 AM.
Comfy.n is offline   Reply With Quote