HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


trouble achieving Google Web Fonts from available fonts in editor

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#103128 (In Topic #20198)
Avatar

Fan in action

Hi, I'm having trouble achieving Google Web Fonts from available fonts in editor.

I have used Google Web Fonts to collect the fonts I like, generated the code to put into HTML_HEADER.TPL and added the new font names to the global.css

but... I'll start at the beginning as this is where the problem likely is, because before doing any of the above, when I uncommented the existing Google Web Fonts link in global.css which is then meant to make available use of Open Sans font, it doesn't appear in my list of available fonts in ocportal WYSIWYG editor. So it's not surprising that my additional Google Fonts didn't work later on either

So to test using Google Web Fonts in ocPortal the first lines of code in my HTML_HEADER.tpl read:

 
<link href="http://fonts.googleapis.com/css?family=Open+Sans:400italic,600italic,400,600" rel="stylesheet" type="text/css" />
 
... and lines 177-179 in my global.css read:

body, .email_body, textarea, input, td, th {
 
font-family: 'Open Sans', 'Segoe UI', Tahoma, Verdana, Arial, Helvetica, sans-serif;

Any comments on this and anything else you'd like to share about using Google Web Fonts from your own experience would be much welcomed.

Thanks
Back to the top
 
Posted
Rating:
#103129
Avatar

Hi,

There's no web standards mechanism for detecting fonts. The ones in the editor are just a hard-coded list of common fonts.

Here's how to do it in CKEditor:
CKEditor 4 Documentation
Put code like that into WYSIWYG_SETTINGS.tpl, except I think 'config.' should be 'editor_settings.'.

And then ocPortal's basic Comcode editor font list is in COMCODE_EDITOR.tpl.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
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 ocPortal whenever you see the opportunity.
  • 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 ocPortal 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.
Back to the top
 
Posted
Rating:
#103150
Avatar

Fan in action

There's no web standards mechanism for detecting fonts. The ones in the editor are just a hard-coded list of common fonts

That's good to know, thanks

Here's how to do it in CKEditor:
CKEditor 4 Documentation
Put code like that into WYSIWYG_SETTINGS.tpl, except I think 'config.' should be 'editor_settings.'.
And then ocPortal's basic Comcode editor font list is in COMCODE_EDITOR.tpl.


I just looked at my topic post again and I misworded it, i'm actually more bothered about using Google Web Fonts full stop, I haven't achieved that yet. Having them available in list of fonts in editor wasn't my primary concern, it was using them.

I'll see if there is a way of setting all paragraph text to come out in a certain google font (i've seen the font sizer css for that side of things) etc

I'll try putting a new google font style in the code of a paragraph, that way to at least see if i've got the google web font link working

Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: