Rewrites the fonts in the output CSS to replace them with our own.
Do this instead of overriding for load times and reduction in hackery.
509085
function rewriteFonts () {
  const style = path.join(target, 'css', 'style.css')
  const css = fs.readFileSync(style)
    .toString()
    .replace(/@import url\(.*?Roboto.*?\);/, `@import url('https://fonts.googleapis.com/css?family=Open+Sans:400,600|Source+Code+Pro:400,600');`)
    .replace(/Roboto/g, 'Open Sans')

  fs.writeFileSync(style, `
    ${css}

    code {
      font-family: 'Source Code Pro', monospace;
    }

    pre > code {
      padding: 0.75em 1em;
      line-height: 1.5em;
    }

    ul, ol {
      margin-bottom: 15px;
    }

    hr {
      border: 0;
      height: 2px;
      background: #f5f5f5;
      margin: 15px 0;
    }

    blockquote {
      border-left: 3px solid #eee;
      padding-left: 0.75em;
      margin-bottom: 15px;
      color: #999;
      font-size: 0.9em;
    }
  `)
}
211423
function() {
    var doc = this._doc;

    // Remove all style tags in head
    this._removeNodes(doc.getElementsByTagName("style"));

    if (doc.body) {
      this._replaceBrs(doc.body);
    }

    this._replaceNodeTags(doc.getElementsByTagName("font"), "SPAN");
  }
1005110
def replace(self, src):
        ""
        for html in self.substitutions.keys():
            if src == html:
                annotation = self.annotation % self.substitutions[src][1]
                return annotation + self.substitutions[src][0]
        return src
690339
public function overwrite()
    {
        if (!$this->previouslyRendered) {
            $this->previouslyRendered = true;
        } else {
            $this->output->remove();
        }
        $this->output->capture();
        $this->render();
    }
209881
def generate_css(self, output_file):
        
        if self.CSS_TEMPLATE_NAME is not None:
            template = TEMPLATE_ENV.get_template(self.CSS_TEMPLATE_NAME)
            style = template.render(self._context())

        if isinstance(style, six.string_types):
            style = style.encode('utf-8')

        output_file.write(style)
1200698
function insertGlyphsRules(rule, result) {
    // Reverse order
    // make sure to insert the characters in ascending order
    let glyphs = result.glyphs.slice(0);
    let glyphLen = glyphs.length;
    while (glyphLen--) {
        let glyph = glyphs[glyphLen];
        let node = postcss.rule({
            selector: '.' + result.opts.fontName + '-' + glyph.name + ':before'
        });
        node.append(postcss.decl({
            prop: 'content',
            value: '\'\\' +
            glyph.unicode[0]
                .charCodeAt(0)
                .toString(16)
                .toUpperCase()
            + '\''
        }));

        rule.parent.insertAfter(rule, node);
    }

    let node = postcss.rule({
        selector: '[class^="' + result.opts.fontName + '-"], [class*=" ' + result.opts.fontName + '-"]'
    });
    [
        {prop: 'font-family', value: '\'' + result.opts.fontName + '\''},
        {prop: 'speak', value: 'none'},
        {prop: 'font-style', value: 'normal'},
        {prop: 'font-weight', value: 'normal'},
        {prop: 'font-variant', value: 'normal'},
        {prop: 'text-transform', value: 'none'},
        {prop: 'line-height', value: 1},
        {prop: '-webkit-font-smoothing', value: 'antialiased'},
        {prop: '-moz-osx-font-smoothing', value: 'grayscale'}
    ].forEach(function (item) {
        node.append(postcss.decl({
            prop: item.prop,
            value: item.value
        }));
    });

    rule.parent.insertAfter(rule, node);
}
1236678
def process_styles (out)
      out.gsub /(<style\b[^>]*?>([\s\S]*?)<\/style>)\s*/i do
        css = $2
        m = $1.gsub /^<style\s([^>]+)>/i do |m|
          attrs(m, 'style', true)
        end
        begin
          css_compressed = MultiCss.min css
          m.gsub!(css, css_compressed)
        rescue Exception => e
          log e.message
        end
        reserve m
      end
    end
800820
function replaceK(s) {
  if (/-/.test(s)) {
    if (/attr/.test(s)) { return 'Attributes Plugin'}
    if (/svg/.test(s)) { return 'SVG Plugin'}
    if (/css/.test(s)) { return 'CSS Plugin'}
    if (/text/.test(s)) { return 'Text Plugin'}
  } else {
    return 'Core Engine';
  }
}
49609
function normalize (src) {

    if (!src) {
        return src;
    }

    if (isRemoteFile(src)) {
        // http://font/font?name=xxx#x
        // http://font/font?
        return src.replace(/#.*$/, '').replace(/\?$/, '');
    } else {
        // ../font/font.eot?#font-spider
        src = src.replace(/[#?].*$/g, '');
        return path.normalize(src);
    }
}
229350
def _process_css_text(self, css_text, index, rules, head):
        
        these_rules, these_leftover = self._parse_style_rules(css_text, index)
        rules.extend(these_rules)
        if head is not None and (these_leftover or self.keep_style_tags):
            style = etree.Element("style")
            style.attrib["type"] = "text/css"
            if self.keep_style_tags:
                style.text = css_text
            else:
                style.text = self._css_rules_to_string(these_leftover)
            head.append(style)
404639
def autoprefixCSS(sassPath):
    '''
    

    '''
    print("Autoprefixing CSS")
    cssPath = os.path.splitext(sassPath)[0] + ".css"
    command = "postcss --use autoprefixer --autoprefixer.browsers '> 5%' -o" + cssPath + " " + cssPath
    subprocess.call(command, shell=True)
346999
function update (src) {
      if (element.styleSheet) {
        element.styleSheet.cssText = src
      } else {
        element.textContent = src
      }
    }
319538
function replaceBadCharacters( text ) {
  var i, repl;
  for ( i = 0; i < rLen; i++ ) {
    repl = replacements[i];
    text = text.replace( repl[0], repl[1] );
  }
  return text;
}
872605
function optimizeCss(source) {
    var ret = '';
    // autoprefixer
    ret = autoprefixer.process(source, opts.autoprefixer).css;
    // minify
    ret = new CleanCSS(opts.cleanCss).minify(ret).styles;

    return ret;
  }
603213
function processStylesheetContent(text) {
        // @NOTE: There is a bug in IE that causes the text layer to
        // not render the font when loaded for a second time (i.e.,
        // destroy and recreate a viewer for the same document), so
        // namespace the font-family so there is no collision
        if (browser.ie) {
            text = text.replace(/font-family:[\s\"\']*([\w-]+)\b/g,
                '$0-' + config.id);
        }

        return text;
    }
1013860
def _installed_fonts(cls):
        
        fonts = {}
        for d in cls._font_directories():
            for key, path in cls._iter_font_files_in(d):
                fonts[key] = path
        return fonts
211478
def create_style_from_font(font):
    

    if font is None:
        return ''

    if type(font) is str:
        _font = font.split(' ')
    else:
        _font = font

    style = ''
    style += 'font-family: %s;\n' % _font[0]
    style += 'font-size: %spt;\n' % _font[1]
    font_items = ''
    for item in _font[2:]:
        if item == 'underline':
            style += 'text-decoration: underline;\n'
        else:
            font_items += item + ' '
    if font_items != '':
        style += 'font: %s;\n' % (font_items)
    return style