Discussions » Creation Requests

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

§
Posted: 2018-10-21

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);
            }
        }
§
Posted: 2024-10-29

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

Post reply

Sign in to post a reply.