Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #72463

    Trevor W
    Participant

    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”

    #72592

    Trevor W
    Participant
    This reply has been marked as private.
    #72869

    Rad
    Moderator

    Hi 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!

    #72944

    Trevor W
    Participant

    Fira Sans is a Google Font now, actualy. Does that make a difference?

    #72949

    Trevor W
    Participant

    I have it showing in the customizer – but the weight choices will not show.

    #72985

    Trevor W
    Participant

    ok, 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?

    #73336

    Rad
    Moderator
    This reply has been marked as private.
    #73397

    Trevor W
    Participant
    This reply has been marked as private.
    #73400

    Trevor W
    Participant
    This reply has been marked as private.
    #73403

    Trevor W
    Participant
    This reply has been marked as private.
    #73405

    Trevor W
    Participant

    In 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…

    #73409

    Trevor W
    Participant

    Fixed 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!

    #73821

    Kosher K
    Member

    Hi Trevor,

    Glad to hear you’ve fixed your issue.

    Cheers