清除非必须的表
@param {Object} font font对象
10497
function cleanTables(font) {
            delete font.readOptions;
            delete font.tables;
            delete font.hmtx;
            delete font.post.glyphNameIndex;
            delete font.post.names;
            delete font.subsetMap;

            // 删除无用的表
            var cff = font.CFF;
            delete cff.glyf;
            delete cff.charset;
            delete cff.encoding;
            delete cff.gsubrs;
            delete cff.gsubrsBias;
            delete cff.subrs;
            delete cff.subrsBias;
        }
985681
function (rule) {
        var base = this.base;
        var files = [];
        var style = rule.style;
        var that = this;

        var model = new CssParser
        .Model('CSSFontFaceRule')
        .mix({
            id: '',
            family: '',
            files: files,
            selectors: [],
            chars: [],
            options: {}
        });

        
        // 解析 font 相关属性
        Array.prototype.forEach.call(style, function (key) {

            if (key === 'font-family') {

                model.family = utils.unquotation(style['font-family']);

            } else if (key === 'font') {

                model.options = utils.fontValueParse(style.font) || {};
                model.family = model.options['font-family'];

                if (Array.isArray(model.family)) {
                    model.family = model.family[0];
                }

                delete model.options['font-family'];

            } else if (getFontId.keys.indexOf(key) !== -1) {

                model.options[key] = style[key];
            } 
        });



        if (!model.family) {
            return;
        }


        model.id = getFontId(model.family, model.options);

        
        // 解析字体地址
        var src = utils.srcValueParse(style.src);
        var urls = [];
        src.forEach(function (file) {
            file = utils.resolve(base, file);
            file = that._getUrl(file);
            if (file) {
                urls.push(file);
            }
        });

        files.push.apply(files, urls);

        return model;
    }
1159719
function fontValueParse(input) {

    var states = {
        VARIATION: 1,
        LINE_HEIGHT: 2,
        FONT_FAMILY: 3
    };

    var state = states.VARIATION;
    var buffer = '';
    var result = {
        'font-family': []
    };


    for (var c, i = 0; c = input.charAt(i); i += 1) {
        if (state === states.FONT_FAMILY && (c === '"' || c === '\'')) {
            var index = i + 1;

            // consume the entire string
            do {
                index = input.indexOf(c, index) + 1;
                if (!index) {
                    // If a string is not closed by a ' or " return null.
                    // TODO: Check to see if this is correct.
                    return null;
                }
            } while (input.charAt(index - 2) === '\\');

            result['font-family']
            .push(input.slice(i + 1, index - 1)
            .replace(/\\('|")/g, '$1'));

            i = index - 1;
            buffer = '';
        } else if (state === states.FONT_FAMILY && c === ',') {
            if (!/^\s*$/.test(buffer)) {
                result['font-family'].push(buffer.replace(/^\s+|\s+$/, '').replace(/\s+/g, ' '));
                buffer = '';
            }
        } else if (state === states.VARIATION && (c === ' ' || c === '/')) {
            if (/^((xx|x)-large|(xx|s)-small|small|large|medium)$/.test(buffer) ||
                /^(larg|small)er$/.test(buffer) ||
                /^(\+|-)?([0-9]*\.)?[0-9]+(em|ex|ch|rem|vh|vw|vmin|vmax|px|mm|cm|in|pt|pc|%)$/.test(buffer)) {
                state = c === '/' ? states.LINE_HEIGHT : states.FONT_FAMILY;
                result['font-size'] = buffer;
            } else if (/^(italic|oblique)$/.test(buffer)) {
                result['font-style'] = buffer;
            } else if (/^small-caps$/.test(buffer)) {
                result['font-variant'] = buffer;
            } else if (/^(bold(er)?|lighter|[1-9]00)$/.test(buffer)) {
                result['font-weight'] = buffer;
            } else if (/^((ultra|extra|semi)-)?(condensed|expanded)$/.test(buffer)) {
                result['font-stretch'] = buffer;
            }
            buffer = '';
        } else if (state === states.LINE_HEIGHT && c === ' ') {
            if (/^(\+|-)?([0-9]*\.)?[0-9]+(em|ex|ch|rem|vh|vw|vmin|vmax|px|mm|cm|in|pt|pc|%)?$/.test(buffer)) {
                result['line-height'] = buffer;
            }
            state = states.FONT_FAMILY;
            buffer = '';
        } else {
            buffer += c;
        }
    }

    if (state === states.FONT_FAMILY && !/^\s*$/.test(buffer)) {
        result['font-family'].push(buffer.replace(/^\s+|\s+$/, '').replace(/\s+/g, ' '));
    }

    if (result['font-size'] && result['font-family'].length) {
        return result;
    } else {
        return null;
    }
}
607573
public void setFont(Font font) {
		super.setFont(font);

		if (dayChooser != null) {
			dayChooser.setFont(font);
			monthChooser.setFont(font);
			yearChooser.setFont(font);
		}
	}
201422
function fallback( fonts ) {
    return new Promise(function (resolve, reject) {
        var divs = [];
        var body = document.body;
        fonts.forEach(function (font) {
            var div = document.createElement( 'div' );
            div.className = 'tfw-font-loader';
            div.style.fontFamily = font;
            body.appendChild( div );
        });
        // Ugly trick: juste wait 1.5 second.
        window.setTimeout(function () {
            divs.forEach(function (d) {
                body.removeChild( d );
            });
            resolve( fonts );
        }, 1500);
    });
}
797999
function sortFontSizes(fontSizes) {
        var r = {};
        var temp = [];
        var size = 0;
        var biggest = 0;

        for (var prop in fontSizes) {
            if (fontSizes.hasOwnProperty(prop)) {

                size++;

                var val = prop.replace(/[^0-9.\/]/g, '').replace(/\/[0-9]/g, '');

                if (prop.indexOf('%') > -1) {
                    val = 16 / 100 * val;
                }

                if (prop.indexOf('em') > -1
                    || prop.indexOf('rem') > -1
                    || prop.indexOf('vw') > -1
                    || prop.indexOf('vh') > -1) {
                    val = 16 * val;
                }

                if (val === '') {
                    val = prop;
                }

                biggest = val > biggest ? val : biggest;

                if (/[0-9.]/g.test(val)) {
                    temp.push({
                                  viewSizePx:  val,
                                  viewSizeStr: '',
                                  cssSize:     prop,
                                  amount:      fontSizes[prop]
                              });
                } else {
                    temp.push({
                                  viewSizePx:  0,
                                  viewSizeStr: val,
                                  cssSize:     prop,
                                  amount:      fontSizes[prop]
                              });
                }


            }
        }


        r = temp.sort(function (a, b) {
            return b.viewSizePx - a.viewSizePx;
        });

        return r;
    }
973621
def clear_text(self, *args, **selectors):
        
        while True:
            target = self.device(**selectors)
            text = target.info['text']
            target.clear_text()
            remain_text = target.info['text']
            if text == ''  or remain_text == text:
                break
435855
public static String clear(String text) {
        text = StringCleaner.tokenizeURLs(text);
        text = StringCleaner.tokenizeSmileys(text);
        text = StringCleaner.removeAccents(text);
        text = StringCleaner.removeSymbols(text);
        text = StringCleaner.removeExtraSpaces(text);
        
        return text.toLowerCase(Locale.ENGLISH);
    }
237370
def clean(self, text):
        """"""
        return ''.join([c for c in text if c in self.alphabet])
738921
function resolveGlyf(font) {

    var codes = font.cmap;
    var glyf = font.CFF.glyf;

    // unicode
    Object.keys(codes).forEach(function (c) {
        var i = codes[c];
        if (!glyf[i].unicode) {
            glyf[i].unicode = [];
        }
        glyf[i].unicode.push(+c);
    });

    // leftSideBearing
    font.hmtx.forEach(function (item, i) {
        glyf[i].advanceWidth = glyf[i].advanceWidth || item.advanceWidth || 0;
        glyf[i].leftSideBearing = item.leftSideBearing;
    });

    font.glyf = glyf;
}
1209929
public void clearValidationStyles() {
        for (JQMFormWidget widget : widgetValidators.keySet()) {
            UIObject ui = widget.asWidget();
            Collection<Validator> validators = widgetValidators.get(widget);
            for (Validator v : validators) {
                if (notifiedWidgets.containsKey(v)) {
                    ui = notifiedWidgets.get(v);
                }
                removeStyles(v, ui);
            }
        }
    }
775577
function reduceFontSize(e) {
    e.preventDefault();
    if (fontState.size <= MIN_SIZE) return;

    fontState.size--;
    saveFontSettings();
  }
185988
public function clear() {
		$i=0;
		if ($glob=@glob($this->f3->get('ASSETS.public_path').'*'))
			foreach ($glob as $file)
				if (preg_match('/.+?\.(js|css)/i',basename($file))) {
					$i++;
					@unlink($file);
				}
		return $i;
	}
1350148
String trim(String string) {
        BaseFont ft = font.getFont();
        if (ft.getFontType() == BaseFont.FONT_TYPE_CJK && ft.getUnicodeEquivalent(' ') != ' ') {
            while (string.endsWith("\u0001")) {
                string = string.substring(0, string.length() - 1);
            }
        }
        else {
            while (string.endsWith(" ") || string.endsWith("\t")) {
                string = string.substring(0, string.length() - 1);
            }
        }
        return string;
    }
408102
function( buffer, enFamilyName, noMerge) {
			//cancelling in browser merge
			clearTimeout(this.mergeTimeout);

			if ( !enFamilyName ) {
				enFamilyName = this.ot.getEnglishName('fontFamily');
			}

			if ( this.fontMap[ enFamilyName ] ) {
				document.fonts.delete( this.fontMap[ enFamilyName ] );
			}

			var fontface = this.fontMap[ enFamilyName ] = (
				new window.FontFace(
					enFamilyName,
					buffer || this.toArrayBuffer()
				)
			);

			if ( fontface.status === 'error' ) {
				throw new Error('Fontface is invalid and cannot be displayed');
			}

			document.fonts.add( fontface );

			//we merge font that haven't been merge
			if ( !noMerge ) {
				var timeoutRef = this.mergeTimeout = setTimeout(function() {
				mergeFont(
					'https://merge.prototypo.io',
					{
						style: 'forbrowserdisplay',
						template: 'noidea',
						family: 'forbrowserdisplay'
					},
					'plumin',
					buffer,
					true,
					function(mergedBuffer) {
						if (timeoutRef === this.mergeTimeout) {
							this.addToFonts(mergedBuffer, enFamilyName, true);
						}
					}.bind(this)
				);
				}.bind(this), 300);
			}

			return this;
		}
1339374
function cleanStyles(e) {
  if (!e) return;


  // Remove any root styles, if we're able.
  if (typeof e.removeAttribute == 'function' && e.className != 'readability-styled') e.removeAttribute('style');

  // Go until there are no more child nodes
  var cur = e.firstChild;
  while (cur) {
    if (cur.nodeType == 1) {
      // Remove style attribute(s) :
      if (cur.className != "readability-styled") {
        cur.removeAttribute("style");
      }
      cleanStyles(cur);
    }
    cur = cur.nextSibling;
  }
}
345829
function(text) {
        return macros.cleanMacros(text.replace(/\n/g, '{break}').replace(/<i>/g, '{italic}').replace(/<\/i>/g, '{end-italic}'));
    }