Adding a custom Font Family to Help Center
Posted Oct 16, 2013
It's my first try at Community tips, English manual writing and explaining CSS. Bear with me :-)
With the new Help Center a lot of nice stuff has become available. Including CSS modding. This allows for the modification of your font family. Let's explain some things first.
Note: If you'd like to use Google Fonts, check out this tip from Wes Drury.
About font families
Most companies use a regular font like Arial or Helvetica. These fonts are a way of showing your text. Some fonts are really modern while others are more elegant. The way you want to show your text, is a personal taste. Most businesses have requirements when it comes to writing text. In almost every case the font family and the size is a basic requirement.
Here is where the tricky part starts. Some companies, like mine, use a custom font. Specially tailored to your needs, a custom font a very cool way of making eye candy out of everything. But it requires some additional work when it comes to websites and Help Centers from Zendesk. So let's get started.
Ingredients
-
A custom web font, with the following files
- webfont.ttf
-
webfont.eot
-
webfont.svg
-
webfont.woff
-
Custom theme in the Help Center
-
Some CSS skills (Beginner HTML & CSS Level is good enough)
How to do it
Now you have all the ingredients, lets start baking the new font into your Help Center.
Steps:
- Open the Help Center.
-
From the tools panel, select Customize design.
-
Select Edit Theme.
-
Open up the Assets folder
-
Upload all four files. Zendesk will create a link for you.
-
Go to the CSS Tab and write the following code. (Somewhere you can remember. I suggest at the bottom.)
@font-face {
font-family: 'Regular';
src: local ("Regular"),
src: url('//company.zendesk.com/hc/assetslink.eot');
src: url('//company.zendesk.com/hc/assetslink.eot?#iefix') format('eot'),
url('//company.zendesk.com/hc/assetslink.woff') format('woff'),
url('//company.zendesk.com/hc/assetslink.ttf') format('truetype'),
url('//company.zendesk.com/hc/assetslink.svg#webfont') format('svg');
font-weight: 400;
font-style: normal;
}
Note: If you modify your Zendesk URL, you must insert that in the code. In my case, that's support.connexys.nl. That will replace the company.zendesk.com part. When agents log in, the URL changes, making the Font not available, but customers will see the proper font.
7.
Replace the zdassets.com URLs with your URLs. Be very careful with the ' at the beginning and ' at the end.
- You may rename the font family anything you like. Just remember, don´t use the spacebar, use_an_underscore.
- Now let's activate the font within the CSS.
- Go to the Body { code. Add in the following code. The $font_1; should be there already. Replace this. And of course, replace your_webfont_name. > /* font-family: $font_1; */
font-family: your_webfont_name;
- Go to the a { code. Add in the following code. $font_2 should be there. Replace this. > /* font-family: $font_2; */
font-family: your_webfont_name;
-
Go to the h1, h2, h3, h4, h5, h6 { code. Add the following.
font-family: your_webfont_name;
-
Go to the .dropdown-toggle. Add the following.
/* font-family: "entypo"; */
font-family: your_webfont_name;
That's it!
Now you have replaced most of the fonts within the CSS. Your Help Center will now appear in your (custom) font. If you find any text that isn't showing in your font, look in the CSS for 'Font-family: not-your-font; And replace this.
Note: Don't add the Font of the CSS .search:before, .search-small:before. It will remove the Search icon in the Swiftest Elk theme.
The best way of replacing font codes is using one of the examples above. In those examples we exclude the Zendesk code without deleting it. If you ever want it back, it saves you a lot of searching and typing.
Happy coding!
3
59 comments
lucero
Hi jay darado
I put this, but the font didn´t solve
0
Sumita Themes
Hey lucero,
You have to write the font name under the double quotes (" "), Just replace use the below code and it will solve your problem
font-family: "Gilroy";
Let me know if you have any issue
Regards
Jay
0
lucero
Hello,
I have tried to insert a font family Gilroy, but it is not recognized in CSS. Please help me!!. this is my code:
1.
2. in the file style.css company= I know the company is a reference
@font-face {
font-family: 'Gilroy';
src: url('//company.zendesk.com/hc/Gilroy-Regular.eot');
src: url('//company.zendesk.com/hc/Gilroy-Regular.eot?#iefix') format('embedded-opentype'),
url('//company.zendesk.com/hc/Gilroy-Regular.woff2') format('woff2'),
url('//company.zendesk.com/hc/Gilroy-Regular.woff') format('woff'),
url('//company.zendesk.com/hc/Gilroy-Regular.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
3.finally I put font-family in the code, body, H1,H2,H3......
5.
0
markta ♡ Büro
Hey guys!
help needed :) i went through the guidelines of this article a few times but it doesn't work. first of all - the interface of my assets folder looks different and it shows the url/link to the source files differently than in the guide. might this be the problem? What else could be wrong?
@font-face {
font-family: 'CircularStd-Book';
src: local ("CircularStd-Book");
src: url('$assets-circularstd-book-otf'),
url('$assets-circularstd-book-woff'),
url('$assets-circularstd-book-ttf'),
url('$assets-circularstd-book-eot'),
url('$assets-circularstd-book-ttf');
font-weight: 400;
font-style: normal;
}
And another question - how do i install two different typefaces? I'd like to change the headline and copy text seperately. Is that possible?
Thank you, Maria
1
Karl Löfdahl
A great big thanks to Jan B for creating this to begin with.
However, this guide is really tricky to follow: It presupposes understanding, fails to elaborate on some important details and does not use visual aides and formatting that would help a lot.
I do not think it is a coincidence so many of us are having issues to begin with. I just got it to work, but not using the guide but rather by reading the comments.
It'd also be nice to get a quick explanation of why all these different file types are needed (and perhaps why/when it is not). I know now that it's because of browser compatibility but at first I thought I could not do this because I do not have access to all file versions.
1
Irene Vozzi
That worked wonderfully! Thanks for flagging the error.
0
Trapta Singh
@Irene Vozzi, got it. Update your code from
to
and let us know the results.
Thanks
Team Diziana
0
Irene Vozzi
Hi @Trapta. I tried that as well. This is the result:
http://www.clipular.com/c/4721323130224640.png?k=_Eg4Fw0Rp2RBCjDFnikWVCEDTOI
For reference, this looks nothing like the custom font I uploaded. Although it is a different result from the one that I have if I add the $:
http://www.clipular.com/c/4721323130224640.png?k=_Eg4Fw0Rp2RBCjDFnikWVCEDTOI
None of those options are the correct font, albeit the latter looks slightly better/more in brand. Any thoughts?
0
Trapta Singh
Hi @Irene Vozzi,
Please remove the $ sign from font name in your CSS code.
Let us know how it goes for you.
Thanks
Team Diziana
0
Jessie Schutz
Hey Irene! I'm going to see if one of our Community Moderators can look over this code for you.
0
Post is closed for comments.