-
Notifications
You must be signed in to change notification settings - Fork 2
Managing Font Families
These are the steps you need to take for adding a new font to the theme
Proper font is:
- free
- readable
- standard
- popular
- retrieved from a reliable source
From the font's styles, select 2 weights as normal and bold considering the following ranges:
- Normal: From 300 (light) to 600 (semi-bold)
- Bold: From 600 (semi-bold) to 900 (black)
Thin and extra-light is excluded due to readability concerns. Also there are only two weights being used in the theme to avoid some extra kilobytes of download for blog visitors.
The font needs to support all modern web-browsers. So These file-formats must be included:
- EOT
- WOFF2
- WOFF
- TTF
In case the font pack was not containing any of these formats, use a generator.
Make sure that all of the 8 files are named in the following structure:
- for normal:
FontName
- for bold:
FontName-Bold
FontName = Name of the font in PascalCase case-format
We are using a solid name structure due to these reasons:
- Font files are being dynamically attached to
@font-face
by PHP variables. - We are attempting to keep files as tidy as possible.
- Locate fonts directory:
assets/fonts
- Then create a new directory named as:
FontName
- Place the font-files inside that directory.
- Go to
/inc/customizer.php
- Locate the comment
// Font Families
- Look for the related typeface in the comments; or add a new comment, in case none of them was related.
- Append a new line under the typeface defining font's "file" and "display" name. The new line should be like:
'FontName' => 'Font Name',
The default font-family should be the most standard, readable, popular, well-suited one among the font-families. Do not change it unless you are sure there is a better alternative for it.
Anything?! Let's discuss