<commit_before><?php
/**
 * $Id$
 *
 * @author <NAME>, 2013 <<EMAIL>>
 */

namespace cd;

class Css3FontFaceSrc
{
    var $format;
    var $url;
}

class Css3FontFace
{
    var $font_family;
    var $font_stretch = 'normal';
    var $font_style   = 'normal';
    var $font_weight  = 'normal';
    var $sources      = array();

    public function addSource($format, $url)
    {
        if (!in_array($format, array('woff', 'truetype')))
            throw new \Exception ('unknown format: '.$format);

        $src = new Css3FontFaceSrc();
        $src->format = $format;
        $src->url = $url;
        $this->sources[] = $src;
    }

    public function render()
    {
        $sources = array();

        foreach ($this->sources as $src)
            $sources[] = 'url('.$src->url.') format("'.$src->format.'")';

        return
        '@font-face'.
        '{'.
            'font-family:"'.$this->font_family.'";'.
            ($this->font_stretch != 'normal' ? 'font-stretch:'.$this->font_stretch.';' : '').<commit_msg>also recognize opentype & eot fonts<commit_after><?php
/**
 * $Id$
 *
 * @author <NAME>, 2013 <<EMAIL>>
 */

namespace cd;

class Css3FontFaceSrc
{
    var $format;
    var $url;
}

class Css3FontFace
{
    var $font_family;
    var $font_stretch = 'normal';
    var $font_style   = 'normal';
    var $font_weight  = 'normal';
    var $sources      = array();

    public function addSource($format, $url)
    {
        if (!in_array($format, array('truetype', 'opentype', 'woff', 'eot')))
            throw new \Exception ('unknown format: '.$format);

        $src = new Css3FontFaceSrc();
        $src->format = $format;
        $src->url = $url;
        $this->sources[] = $src;
    }

    public function render()
    {
        $sources = array();

        foreach ($this->sources as $src)
            $sources[] = 'url('.$src->url.') format("'.$src->format.'")';

        return
        '@font-face'.
        '{'.
            'font-family:"'.$this->font_family.'";'.
            ($this->font_stretch != 'normal' ? 'font-stretch:'.$this->font_stretch.';' : '').
{'fraction_non_alphanumeric': 0.19368723098995697, 'fraction_numerical': 0.006695361071257772, 'mean_word_length': 2.228395061728395, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6184245', 'n_tokens_mistral': 711, 'n_tokens_neox': 701, 'n_words': 148}