• Resolved WebTrooper

    (@webtrooper)


    Is there any way to set which font categories can be included or excluded in the typography options? I don’t see it in the docs but I tried anyway, by adding it as a default. I was attempting to exclude Display fonts.

    Kirki::add_field( 'content_google_font', array(
      'type'        => 'typography',
      'settings'    => 'content_google_font',
      // 'label'       => esc_attr__( 'Content', 'textdomain' ),
      'section'     => 'fonts',
      'default'     => array(
        'font-family'   => 'Slabo 13px',
        'variant'       => 'standard',
        'category'      => array(
        // 'categories'      => array(
          'serif',
          'sans-serif',
          'handwriting',
          'monospace',
        ),
      ),
      'priority'    => $priority++,
      'choices' => array(
        'fonts' => array(
          'standard' => array(
            'serif',
            'sans-serif',
            'monospace',
          ),
        ),
      ),
      'transport'		=> 'auto',
      'output'      => array(
        array(
          'element' => 'body',
        )
      ),
    ));
    

    You can see I tried both “category” and “categories”, but of course neither of them worked. Is there such an option and, if so, how can I implement it?

    If not, it seems this would be a much desired option for those of us who don’t want end users writing all their blog posts in, say, Libre Barcode. 😮

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter WebTrooper

    (@webtrooper)

    Looking at google fonts api, it appears such an option is not possible. The only practical way I can achieve this is by grabbing a list of all the fonts and remove those that are too gaudy for main content. Or trust that bloggers on my network will use common sense? Well, looks like I have my work cut out for me.

    I think this would be an interesting option… I started working on a possible implementation, I hope I’ll have something to show in a few days.

    Thread Starter WebTrooper

    (@webtrooper)

    That would be awesome if it’s possible. I know if anyone can do it, you can. 😀

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Typography: Possible to choose font categories?’ is closed to new replies.