Kirki: Adding variants for custom fonts in typography

Created on 15 Aug 2016  路  4Comments  路  Source: kirki-framework/kirki

Issue description:

Right now "typography" font family list is returning all Google fonts but how can we add own fonts in list of font family?

Version used:

(Did you try using the develop branch from github? There's a chance your issue has already been adressed there)
Latest form w.org

Using theme_mods or options?

theme_mods

Code to reproduce the issue (config + field(s))

simply type "typography". i just want to add custom fonts in font family list.

bug typography feature

Most helpful comment

Would be great if we could also control Font Variants for custom fonts like this:

function add_my_custom_font( $standard_fonts ) {
    $fonts['my_custom_font'] = array(
        'label' => 'My Font',
        'variants' => array('300','300italic','regular','italic'),
        'stack' => '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif',
    );
    return $fonts;
}
add_filter( 'kirki/fonts/standard_fonts', 'add_my_custom_font' );

All 4 comments

You can use the kirki/fonts/standard_fonts filter for example:

function add_my_custom_font( $standard_fonts ) {
    $fonts['my_custom_font'] = array(
        'label' => 'My Font'
        'stack' => '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif',
    );
    return $fonts;
}
add_filter( 'kirki/fonts/standard_fonts', 'add_my_custom_font' );

Would be great if we could also control Font Variants for custom fonts like this:

function add_my_custom_font( $standard_fonts ) {
    $fonts['my_custom_font'] = array(
        'label' => 'My Font',
        'variants' => array('300','300italic','regular','italic'),
        'stack' => '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif',
    );
    return $fonts;
}
add_filter( 'kirki/fonts/standard_fonts', 'add_my_custom_font' );

Can't seem to be able to add available variants for my custom font either...

Fixed in 3.0

Was this page helpful?
0 / 5 - 0 ratings

Related issues

stylethemes picture stylethemes  路  6Comments

allysonsouza picture allysonsouza  路  3Comments

rahulv3a picture rahulv3a  路  3Comments

Radzio1615 picture Radzio1615  路  4Comments

Vishal-Deshpande picture Vishal-Deshpande  路  3Comments