This is a little tutorial on how to add custom fonts to the font-settings drop-down in the template parameters.
In this example i will explain how you can add the custom font Bebas (used in the reaction template) to the other gantry templates. i will be using Juxta template in my example.
1. Adding the font files
a) Download the reaction template and locate the following font files for the Bebas font
../templates/rt_reaction_j15/fonts/Bebas.eot
../templates/rt_reaction_j15/fonts/Bebas.ttf
b) Use your ftp or file manager to paste the 2 files to the same location on your install, if you are using for example the Juxta template, the following location is correct:
../templates/rt_juxta_j15/fonts/..
please note: you may have to create the "font" directory manually if it is not present.
2. Adding the necessary css code
Open your ..templates/rt_juxta_j15/css/template.css file and copy/paste the following code at the end:
- /* Adding Font Bebas */
- @font-face {font-family: Bebas;src: url(../fonts/Bebas.eot);}
- @font-face {font-family: "Bebas";src:local("Bebas"), url(../fonts/Bebas.ttf) format("truetype");}
- .font-family-bebas h1, .font-family-bebas h2.title, .font-family-bebas .rt-joomla .user legend, .font-family-bebas .rt-joomla .contact legend, .font-family-bebas .componentheading , .font-family-bebas .edit-article legend {font-family: Bebas,Helvetica,Arial,sans-serif;letter-spacing: normal;font-weight: normal;
3. Adding the info to the font-settings dropdown
a) Open your ../templates/rt_juxta_j15/templateDetails.xml file and locate the following code:
- <param name="family" type="selectbox" default="georgia" label="FONT_FAMILY" description="" isbodyclass="true" setbyurl="true" setinsession="true" setbysession="true" setincookie="true" setbycookie="true">
- <option value="geneva">Geneva</option>
- <option value="georgia">Georgia</option>
- <option value="helvetica">Helvetica</option>
- <option value="lucida">Lucida</option>
- <option value="optima">Optima</option>
- <option value="palatino">Palatino</option>
- <option value="trebuchet">Trebuchet</option>
- </param>
- <param name="family" type="selectbox" default="georgia" label="FONT_FAMILY" description="" isbodyclass="true" setbyurl="true" setinsession="true" setbysession="true" setincookie="true" setbycookie="true">
- <option value="bebas">Bebas</option>
- <option value="geneva">Geneva</option>
- <option value="georgia">Georgia</option>
- <option value="helvetica">Helvetica</option>
- <option value="lucida">Lucida</option>
- <option value="optima">Optima</option>
- <option value="palatino">Palatino</option>
- <option value="trebuchet">Trebuchet</option>
- </param>
No comments:
Post a Comment