Dynamic font size, possible?

This forum is for all Flare issues related to the HTML5, WebHelp, WebHelp Plus, and Adobe Air Targets
Post Reply
nickatwork
Sr. Propeller Head
Posts: 457
Joined: Thu Sep 16, 2010 6:31 am
Location: London

Dynamic font size, possible?

Post by nickatwork »

Hi all,
Just wondering if, somewhere tucked away in Flare, there is the ability to make font size adjustable for an end user?
I'm publishing to WebHelp and quite like the smaller font size, but I'm sure there are users who wont. Would be nice to cater for everyone with a user selected font size.

Any ideas?

Thanks,
Nick
lacastle
Propellus Maximus
Posts: 1028
Joined: Thu Apr 12, 2007 7:28 am
Location: Wilmington, DE
Contact:

Re: Dynamic font size, possible?

Post by lacastle »

if you use a percentage-based font size in your CSS, your users should be able to adjust the size of their fonts in their browser. (ctrl, + or - in firefox)
nickatwork
Sr. Propeller Head
Posts: 457
Joined: Thu Sep 16, 2010 6:31 am
Location: London

Re: Dynamic font size, possible?

Post by nickatwork »

Not quite what I'm after. You can do that without using % font sizes. But it increases everything on the page. Buttons, images etc. I just want to change the font size. This forum has a font size control top right under the search box. Something like that would work.
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Dynamic font size, possible?

Post by LTinker68 »

What you're looking for isn't something that's native to Flare or stylesheets, but it can be done using JavaScript. A quick Google search turned up this article -- http://davidwalsh.name/change-text-size ... javascript. I haven't tested it, but it's an example of how it could be done. You'd want to put the script in the masterpage so it's available to every topic. I'm not sure if the best way to tie it into the front-end for the user. Probably a couple of new buttons you'd add to the toolbar that calls the script and passes the values.

If you do something like this, you'd need to modify your stylesheet so all font sizes are based on relative values, and that means you might also have to specify font sizes where you didn't before, because the browser default is to decrease font sizes the deeper you go in the tag structure. For instance, a list item inside another list is generally smaller font than the parent list. In that case, you'd need to set the <li> tag to a font size of 100%, so it always matched the parent font size.

You also need to test this thoroughly at the different font sizes, because larger fonts might move other elements on the page or compress them together and smaller font sizes might space things out too much.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Post Reply