[SOLVED!] Use "em" for font sizer

Post

Posted
Rating:
#7058 (In Topic #1922)
Avatar
Standard member
mythus is in the usergroup ‘Community saint’
Hello,

The font sizer affects font sizes. I wanted to change my fonts from how they were to using "em" for even better responsability to differnt resolutions and screen sizes. Of course the better might be using rem, but that requires a little more work and I think em works just fine. Anyways.....

I went into the font sizer tpl file and noticed that it just gives numbers but no way to indicate the unit being used. I thought maybe it would reference a different css file or line, but have yet to find it. 

So great ones, how can I change the font sizer to use ems instead. I'd like to go for something like 0.5 em, 1 em, and maybe 1.25 or 1.5 em. Not sure yet until I play around with it. Or will I have to somehow disable it?

Thanks in advance. 

Last edit: by mythus



Like ocPortal? Want to thank Chris and gang somehow? Then help out in the chat room! It really needs your help! Just open it in a tab everytime you open your web browser, and when you hear a "ding", check it out!
 
"Those who want help should first be willing to give help."
Online now: No Back to the top

Post

Posted
Rating:
#7063
Avatar
Standard member
mythus is in the usergroup ‘Community saint’
Found out how. I just didn't look hard enough lol…


Like ocPortal? Want to thank Chris and gang somehow? Then help out in the chat room! It really needs your help! Just open it in a tab everytime you open your web browser, and when you hear a "ding", check it out!
 
"Those who want help should first be willing to give help."
Online now: No Back to the top

Post

Posted
Rating:
#7082
Avatar
Site director
Chris Graham is in the usergroup ‘Administrators’
I guess you changed the hard coded reference in global.js

Code

function set_font_size(size)
{
   var old_size=read_cookie('font_size');
   var old_sizer=document.getElementById('font_size_'+old_size);
   if (old_sizer) old_sizer.className=old_sizer.className.replace(/ selected/g,'');

   document.body.style.fontSize=size+'px';
   set_cookie('font_size',size,120);

   var new_sizer=document.getElementById('font_size_'+size);
   if (new_sizer) new_sizer.className+=' selected';
}

(No need to reply unless you wanted to, I just wanted to check this myself too)


Become a fan of Composr on Facebook or add me as a friend. Add me on on Twitter. Follow me on Minds (where I am most active). Support me on Patreon

Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Online now: No Back to the top

Post

Posted
Rating:
#7085
Avatar
Standard member
mythus is in the usergroup ‘Community saint’
Actually… um… I simply edited font_sizer.css.

Code

.font_sizer_small {
   font-size: 0.5em;
}
.font_sizer_medium {
   font-size: 1em;
}
.font_sizer_large {
   font-size: 1.5em;
}

That makes me wonder if it did anything at all, or only changed the little font sizer icons instead of actually doing what I set out to do. Hmm lol.


Like ocPortal? Want to thank Chris and gang somehow? Then help out in the chat room! It really needs your help! Just open it in a tab everytime you open your web browser, and when you hear a "ding", check it out!
 
"Those who want help should first be willing to give help."
Online now: No Back to the top

Post

Posted
Rating:
#7086
Avatar
Site director
Chris Graham is in the usergroup ‘Administrators’
Yeah. I think you need to change the numbers in FONT_SIZER.tpl, and then edit that function in global.js to use em (or whatever) instead of px.


Become a fan of Composr on Facebook or add me as a friend. Add me on on Twitter. Follow me on Minds (where I am most active). Support me on Patreon

Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Online now: No Back to the top
1 guest and 0 members have just viewed this.

Statistics

Users online:

MVLipwig, Paul D, John Connor, amit.nigam, Vaiva, Philip, Salman

Forum statistics:
  • 1,342 topics, 5,887 posts, 7,206 members
  • Our newest member is homemaker
Birthdays:
Back to Top