Viewing 14 replies - 1 through 14 (of 14 total)
  • Thread Starter jankdc

    (@jankdc)

    I am bumping this, I really want readers to be able to increase the font size on my website.

    From the site, put one of these in your theme where you want the link:

    Beispiel-FontSize:

    <a href="fname('serif','content');">fontstyle serif auf das ID content</a>
    <a href="fname('Verdana','page');">fontstyle Verdana auf das ID page</a>

    This one seems to have two parameters: Font face, and div ID. (My German is a little shaky [nil], so if anyone cares to correct this…)

    Beispiel-FontStyle:

    <a href="fsize('1.2','em','content');">fontsize 1.2em auf das ID content</a>
    <a href="fsize('10','%','page');">fontsize 10% auf das ID page</a>

    This one appears to have three parameters: Value, units, and div ID.

    Thread Starter jankdc

    (@jankdc)

    I put them into my theme and all I got were links that said

    fontstyle serif auf das ID content fontstyle Verdana auf das ID page fontsize 1.2em auf das ID content fontsize 10% auf das ID page

    that went nowhere.

    Well, if you’ve got javascript enabled it shouldn’t go anywhere, but should just change your font face/size. You can change the German text within the link to whatever you want them to say.

    Thread Starter jankdc

    (@jankdc)

    thanks for the reply. how do I enable the javascript?

    You enable javascript in your browser.

    Thread Starter jankdc

    (@jankdc)

    That wasn’t it. I have javascript enabled and it didn’t fix the problem. I still got an error message.

    Not Found
    The requested URL /fname(‘serif’,’content’); was not found on this server.

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

    I’d try contacting the plugin author, then. It might be a problem with their code. That, or see if there’s another plugin that does the same thing (hopefully in English!)

    I think I understand what this is supposed to do. For the fname function, you pass it a font name like Palatino and the id that you wish it to be applied to, like Content. The fsize function takes a numeric size that corresponds to the second parameter units and then the third parameter is the id you wish it applied to.

    Most browsers already implement this. In Firefox, it’s under View->Text Size.
    Nevertheless, this ought to work:

    <a href="javascript:void(0);" onclick="
    var fs = document.body.style.fontSize ;
    document.body.style.fontSize = (
    isNaN(parseFloat(fs))
    ? '18pt'
    : (parseFloat(fs) + 2) + fs.substring(parseFloat(fs).toString().length)
    );
    ">Increase Font Size</a>
    
    <a href="javascript:void(0);" onclick="
    var fs = document.body.style.fontSize;
    document.body.style.fontSize = (
    isNaN(parseFloat(fs))
    ? '18pt'
    : (parseFloat(fs) - 2) + fs.substring(parseFloat(fs).toString().length)
    );
    ">Decrease Font Size</a> 
    
    <a href="javascript:void(0);" onclick="
    document.body.style.fontSize = '18pt';
    ">Default Font Size</a>

    Change “18pt” in all links to font sizes better suited to your site as a default. Tested only in Firefox, and that with only a very simple DOM. You may want to add image instead of a text link.

    Cheers
    aquazero

    Alternatively, you could google “PHP stylesheet switcher”, and you’ll come up with a ton of stuff. That’s really all you need.

    Thread Starter jankdc

    (@jankdc)

    I tried using aquazero’s recommendation, which worked but increased all of the font sizes including the title on the title page. Can I just increase the body and link? Also, what would work for adding a picture?

    I used

    <img src="https://www.spinalalignment.com/wp-content/uploads/Decrease%20Font%20Size.gif" align="right" onclick=" var fs = document.body.style.fontSize; document.body.style.fontSize = ( isNaN(parseFloat(fs)) ? '18pt' : (parseFloat(fs) - 2) + fs.substring(parseFloat(fs).toString().length) );" title="Increase Font size" /> <img src="https://www.spinalalignment.com/wp-content/uploads/Increase%20Font%20Size.gif" align="right" onclick=" var fs = document.body.style.fontSize; document.body.style.fontSize = ( isNaN(parseFloat(fs)) ? '18pt' : (parseFloat(fs) - 2) + fs.substring(parseFloat(fs).toString().length) );" title="Decrease Font size" />

    but it did some strange things (both images at first increased font size then would only decrease the font size.

    Thanks

    Well, search google for the Batavia theme. It comes with a font sizer (a js file) and the code in the theme (not sure now which file it is, just have to look through it to find the relevant code) to implement it. It’s not a “real” plugin, it’s just an external js file and the head link to call it, plus the code in the theme to implement the upsize/downsize.

    makes the link description shorter and more presentable in example….

    <a href="javascript:void(0);" onclick="
    document.body.style.fontSize = '18pt';
    "><img src=" ./yourimage.jpg" /></a>
Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Increase font size plugin’ is closed to new replies.