*/ public static function display_fonts(): array { return [ 'zilla_slab' => [ 'label' => __( 'Zilla Slab (default)', 'academiccrew' ), 'stack' => "'Zilla Slab', Georgia, 'Times New Roman', serif", 'google' => 'Zilla+Slab:wght@400;500;600', ], 'roboto_slab' => [ 'label' => __( 'Roboto Slab', 'academiccrew' ), 'stack' => "'Roboto Slab', Georgia, serif", 'google' => 'Roboto+Slab:wght@400;600;700', ], 'playfair_display' => [ 'label' => __( 'Playfair Display', 'academiccrew' ), 'stack' => "'Playfair Display', Georgia, serif", 'google' => 'Playfair+Display:wght@400;600;700', ], 'merriweather' => [ 'label' => __( 'Merriweather', 'academiccrew' ), 'stack' => "'Merriweather', Georgia, serif", 'google' => 'Merriweather:wght@400;700', ], 'system_serif' => [ 'label' => __( 'System serif (no web font)', 'academiccrew' ), 'stack' => "Georgia, 'Times New Roman', serif", 'google' => null, ], ]; } /** * @return array */ public static function body_fonts(): array { return [ 'dm_sans' => [ 'label' => __( 'DM Sans (default)', 'academiccrew' ), 'stack' => "'DM Sans', system-ui, -apple-system, sans-serif", 'google' => 'DM+Sans:wght@300;400;500', ], 'inter' => [ 'label' => __( 'Inter', 'academiccrew' ), 'stack' => "'Inter', system-ui, sans-serif", 'google' => 'Inter:wght@400;500;600', ], 'roboto' => [ 'label' => __( 'Roboto', 'academiccrew' ), 'stack' => "'Roboto', system-ui, sans-serif", 'google' => 'Roboto:wght@400;500;700', ], 'open_sans' => [ 'label' => __( 'Open Sans', 'academiccrew' ), 'stack' => "'Open Sans', system-ui, sans-serif", 'google' => 'Open+Sans:wght@400;600;700', ], 'lato' => [ 'label' => __( 'Lato', 'academiccrew' ), 'stack' => "'Lato', system-ui, sans-serif", 'google' => 'Lato:wght@400;700', ], 'system_sans' => [ 'label' => __( 'System sans-serif (no web font)', 'academiccrew' ), 'stack' => 'system-ui, -apple-system, sans-serif', 'google' => null, ], ]; } public static function display_stack( string $slug ): string { $fonts = self::display_fonts(); return $fonts[ $slug ]['stack'] ?? $fonts[ self::DEFAULT_DISPLAY ]['stack']; } public static function body_stack( string $slug ): string { $fonts = self::body_fonts(); return $fonts[ $slug ]['stack'] ?? $fonts[ self::DEFAULT_BODY ]['stack']; } public static function display_google_param( string $slug ): ?string { return self::display_fonts()[ $slug ]['google'] ?? null; } public static function body_google_param( string $slug ): ?string { return self::body_fonts()[ $slug ]['google'] ?? null; } public static function is_valid_display( string $slug ): bool { return isset( self::display_fonts()[ $slug ] ); } public static function is_valid_body( string $slug ): bool { return isset( self::body_fonts()[ $slug ] ); } }