Using special fonts in custom theme

Hi! I'd like to make a new theme, and I really like the Ubuntu font. How could I use this font in my theme?

A) I can download it and turn it into some webfont formats like .eot, and select the appropriate one.

B) Or instead of downloading, I could embed it from Google WebFonts.

If I choose option A, I can use css only to define my fonts, am I correct? But I don't know where to put the embedding code if I choose option B.

Which is the best way? Thanks in advance!

  • For both options you would need to extend core views (read about extending in the documentation). 

    For option A, you can use FontSquirrel and extend 'css/elgg' view. For option B, you can insert <link> to a view that extends 'page/elements/head'

  • You can use fontface and cufons too. If you are using google fonts, use a fallback too for loading your site fine in countries where google servers are blocked. Personaly we support cufons, though its little outdated.

    The views you need to extend are the same mentioned by Ismayil.

  • Thanks! I'll look into this tomorrow. Today I've started to create a custom theme. So far so good!

Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking