Google Fonts can be added to any Skin by way of the $functionality
property and the fonts_google
parameter:
public $functionality = array( 'fonts_google' => true );
After activating Google Fonts in your Skin, Google Fonts will appear with a (G)
next to them in font <select>
dropdowns in the Design Options.
Obviously: All official Thesis Skins from DIYthemes come equipped with Google Fonts functionality.
How to Add Google Fonts to Thesis
By default, Thesis includes all Google Fonts that come in 400, 400 italic, and 700 weights (see the full list below).
If you’d like to add other Google Fonts to Thesis, you can do so via the thesis_google_fonts
array filter, which accepts items in a special format.
In the following example, I’ll illustrate how you can add Google Fonts to any Thesis site with a simple custom filter method:
add_filter('thesis_google_fonts', 'add_google_fonts'); function add_google_fonts($fonts) { $fonts['Dosis'] = array( 'styles' => '400,700', 'type' => 'sans-serif', 'x' => false, 'mu' => false); return $fonts; }
In the code above, Dosis
is the name of the Google Font being added. In order for this font to work properly, you must use the precise name Google uses to refer to its fonts.
Now let’s look at the parameters:
styles
โ whatever styles you want to include should be comma-separated here- To indicate an italic style, you would use:
400i
- To indicate an italic style, you would use:
type
โ (optional) serif, sans-serif, or monospacex
โ (optional) if you know this font’s x-height ratio, include it heremu
โ (optional) if you know the character constant for this font, include it here
Pro tip: You can omit any parameters set to false
. For example, there’s no need to include the x
or mu
parameters in the sample code above.
Default Google Fonts in Thesis
The following Google Fonts all contain 400, 400i, and 700 styles, which are the minimum styles necessary to render typical website content:
- Alegreya
- Alegreya SC
- Alegreya Sans
- Alegreya Sans SC
- Aleo
- Almendra
- Amaranth
- Amiri
- Anonymous Pro
- Archivo
- Archivo Narrow
- Arimo
- Arsenal
- Arvo
- Asap
- Asap Condensed
- Averia Libre
- Averia Sans Libre
- Averia Serif Libre
- B612
- B612 Mono
- Bai Jamjuree
- Balsamiq Sans
- Barlow
- Barlow Semi Condensed
- Be Vietnam
- Bellota
- Bellota Text
- Bitter
- Cabin
- Caladea
- Cambay
- Cantarell
- Cardo
- Caudex
- Chakra Petch
- Chivo
- Comic Neue
- Cormorant
- Cormorant Garamond
- Cormorant Infant
- Courier Prime
- Cousine
- Crimson Pro
- Crimson Text
- Cuprum
- DM Sans
- Droid Serif
- EB Garamond
- Economica
- Exo
- Exo 2
- Expletus Sans
- Fahkwang
- Faustina
- Fira Sans
- Fira Sans Condensed
- Fira Sans Extra Condensed
- Gelasio
- Gentium Basic
- Gentium Book Basic
- Grenze
- Gudea
- Ibarra Real Nova
- Inria Sans
- Inria Serif
- Istok Web
- Josefin Sans
- Josefin Slab
- Jost
- Judson
- K2D
- Kanit
- Karla
- Kodchasan
- KoHo
- Krub
- Kulim Park
- Lato
- Lekton
- Libre Baskerville
- Libre Caslon Text
- Libre Franklin
- Literata
- Livvic
- Lobster Two
- Lora
- Mali
- Manuale
- Marvel
- Merriweather
- Merriweather Sans
- Montserrat
- Montserrat Alternates
- Muli
- Neuton
- Niramit
- Nobile
- Noticia Text
- Noto Sans
- Noto Serif
- Nunito
- Nunito Sans
- Old Standard TT
- Open Sans
- Overlock
- Overpass
- Philosopher
- Playfair Display
- Playfair Display SC
- Poppins
- Prompt
- Proza Libre
- PT Sans
- PT Serif
- Public Sans
- Puritan
- Quantico
- Quattrocento Sans
- Raleway
- Rambla
- Red Hat Display
- Red Hat Text
- Roboto
- Roboto Condensed
- Roboto Mono
- Roboto Slab
- Rosario
- Rubik
- Sansita
- Sarabun
- Scada
- Share
- Source Code Pro
- Source Sans Pro
- Space Mono
- Spectral
- Spectral SC
- Taviraj
- Thasadith
- Tinos
- Titillium Web
- Tomorrow
- Trirong
- Trochut
- Ubuntu
- Ubuntu Mono
- Unna
- Volkhov
- Vollkorn
- Zilla Slab