Discuții » Cerere de creare

Setting the font size in google doc (very tricky!)

§
Postat în: 21-10-2018

Setting the font size in google doc (very tricky!)

Hi! I've written this script: https://gist.github.com/WiliTest/b78ad2c234565ba8ce40df15440540d9 but I don't find the way to change the font size. The help of a js' Guru would be super!

  //---------------full script in the link above-----------------

        function dispatchkeyboard(key) {
            if (key.altKey  &&  key.code === "KeyJ") {

                var divfont = document.getElementById("fontSizeSelect");
                console.log(divfont);
                var inputt = divfont.getElementsByTagName('input')[0];
                inputt.select();
                inputt.value = "6";
                consol.log('done');

                var ev = document.createEvent('Event');
                ev.initEvent('keypress');
                ev.which = ev.keyCode = 13;
                console.log(ev);
                inputt.dispatchEvent(ev);
            }
        }
§
Postat în: 29-10-2024

Discover the perfect TypeType font for your project. With styles for every aesthetic, our fonts enhance clarity and bring character to your brand’s visual identity: https://typetype.org

Postează un raspuns

Autentifică-te pentru a posta un răspuns.