<?php

class StockieExtraAdobeFonts {

    static public function get_abobe_fonts_array() {

        $adobefonts_fonts = StockieSettings::get('adobekit_fonts', 'global');
        $stockie_gf_list = '[';
        if (!empty($adobefonts_fonts) && is_array($adobefonts_fonts)) { $i = 0;
            foreach ($adobefonts_fonts as $adobefonts_font) { $i++;
                $stockie_gf_list .= '
            {
                "font_family": "'.$adobefonts_font['font_family'].'",
                "font_styles": "';
                if (!empty($adobefonts_font['font_styles']) && is_array($adobefonts_font['font_styles'])) {
                    $j = 0;
                    foreach ($adobefonts_font['font_styles'] as $font_style) { $j++;
                        $stockie_gf_list .= $font_style;
                        if ($j != count($adobefonts_font['font_styles'])) {
                            $stockie_gf_list .= ',';
                        }

                    }
                }
                $stockie_gf_list .= ' "
            }';
                if ($i != count($adobefonts_fonts)) {
                    $stockie_gf_list .= ',';
                }
            }
        }
        $stockie_gf_list .= ']';


        return json_decode( $stockie_gf_list );
    }
}