-
AuthorPosts
-
July 23, 2014 at 10:29 am #72463
HI,
I’ve added “Fira Sans” to the admin menu by adding it to framework > functions > global > admin > fonts.php. It shows up in the Typography menu in the customizer now, but the weight choices do not – even though I’ve added them:
‘Fira Sans’ => array(
0 => ‘300’,
1 => ‘300italic’,
2 => ‘400’,
3 => ‘400italic’,
4 => ‘500’,
5 => ‘500italic’,
),as well as adding it to the “function x_font_data_families()” section. Is there somewhere else this needs to be added for the weights to show in the Customizer?
BTW, I tried just adding the @import to the Customizer CSS section – but it did not work for me. Also I cannot get the H tags to obey the font-weight of “300” i’ve assigned to it in my child-theme CSS. It only shows as “400”
July 23, 2014 at 2:27 pm #72592This reply has been marked as private.July 24, 2014 at 12:48 am #72869Hi Trevor,
Thank you for writing in!
You still need to add your weight caption here on same file.
// All Weights // ============================================================================= function x_font_data_all_weights() { $all_weights = array( '100' => __( 'Ultra Light', '__x__' ), '100italic' => __( 'Ultra Light Italic', '__x__' ), '200' => __( 'Light', '__x__' ), '200italic' => __( 'Light Italic', '__x__' ), '300' => __( 'Book', '__x__' ), '300italic' => __( 'Book Italic', '__x__' ), '400' => __( 'Regular', '__x__' ), '400italic' => __( 'Regular Italic', '__x__' ), '500' => __( 'Medium', '__x__' ), '500italic' => __( 'Medium Italic', '__x__' ), '600' => __( 'Semi-Bold', '__x__' ), '600italic' => __( 'Semi-Bold Italic', '__x__' ), '700' => __( 'Bold', '__x__' ), '700italic' => __( 'Bold Italic', '__x__' ), '800' => __( 'Extra Bold', '__x__' ), '800italic' => __( 'Extra Bold Italic', '__x__' ), '900' => __( 'Ultra Bold', '__x__' ), '900italic' => __( 'Ultra Bold Italic', '__x__' ) ); return $all_weights; }
Even if you succeed, it will still not work. X uses google fonts and will fetch these fonts from google. Thus “Fira Sans” does not exists and will just return bad request.
My recommendation is don’t use customizer for your custom font, instead install it the usual way. For example, go to online web font generator and download your generated font, then follow the instructions how you could install it.
Check this http://theme.co/x/member/forums/topic/how-do-i-add-my-own-font-and-use-everywhere/
Still, it will not reflect on customizer.
Thanks!
July 24, 2014 at 7:04 am #72944Fira Sans is a Google Font now, actualy. Does that make a difference?
July 24, 2014 at 7:08 am #72949I have it showing in the customizer – but the weight choices will not show.
July 24, 2014 at 8:42 am #72985ok, instead of trying to add it to the customizer, I simply imported is (@import) to my child CSS. This is working, but unless i delete all but the “300” size i cannot get the H tags to obey the 300 weight designation – despite putting the weight directly into the “h1, h2, h3…etc.” css.
Any ideas?
July 24, 2014 at 11:06 pm #73336This reply has been marked as private.July 25, 2014 at 6:58 am #73397This reply has been marked as private.July 25, 2014 at 7:03 am #73400This reply has been marked as private.July 25, 2014 at 7:06 am #73403This reply has been marked as private.July 25, 2014 at 7:14 am #73405In fact every time I preview – it renders correctly – regardless of using the direct H tag or the Custom Headline short code. However, the paragraph tags – which I also set to Fira – show as helvetica in the preview (but IS Fira on the live site) – very confused…
July 25, 2014 at 7:23 am #73409Fixed it – although I had checked off “Enable Custom Fonts” in the Customizer, but did not go back and change the weight at that point (because they weren’t showing when it WAS enabled). I changed to “Book” and voila. Thanks for the response though!
July 26, 2014 at 4:26 pm #73821Hi Trevor,
Glad to hear you’ve fixed your issue.
Cheers
-
AuthorPosts