(超簡易版)２バイト文字の幅を2倍にした文字の長さ
半角カタカナや英語圏外の半角文字は調査していないので
実際の表示幅と異なる場合があります
フォントは等倍である事を前提としています
@method width
@param  {String} val
@return {Number} width
331210
function width (val) {
  var cr = val.indexOf(EOL);
  if (cr !== -1) {
    val = val.substring(0, cr);
  }
  if (typeof val !== 'string') {
    val = val + '';
  }
  var h = val.match(/[ -~]/g);
  return val.length * 2 - (h ? h.length : 0);
}
101670
public int estimateUnassembledSize(Object val) {
    // We'll treat it is a simple list, as we that's all we've used so far.
    return JSBaseTypes.baseTypes[JMFPrimitiveType.SIMPLELIST].coder.estimateUnassembledSize(val);
  }
1056599
function (path) {
    if ($bc_.pN) {
      var _path = path || ($bc_.pN.path.tempDir() + 'tmp.txt')
      return $bc_.pN.app.fileSizeAtPath(_path)
    }

    return ''
  }
807407
function getComputedLength(value, element) {
	var length = value.match(LENGTH_REGEXP);
	if (!length) {
		return parseFloat(value);
	}
	value = parseFloat(length[1]);
	var unit = length[2].toLowerCase();
	if (FIXED_UNIT_MAP[unit]) {
		return value * FIXED_UNIT_MAP[unit];
	}
	if (unit === 'vw') {
		return value * window.innerWidth / 100;
	}
	if (unit === 'vh') {
		return value * window.innerHeight / 100;
	}
	if (unit === 'vmin') {
		return value * Math.min(window.innerWidth, window.innerHeight) / 100;
	}
	if (unit === 'vmax') {
		return value * Math.max(window.innerWidth, window.innerHeight) / 100;
	}
	// em units
	if (unit === 'rem') {
		element = documentElement;
	}
	if (unit === 'ex') {
		value /= 2;
	}
	return parseFloat(getComputedStyle(element).fontSize) * value;
}
531383
function rule_minlength($val, $error = null) {
        if (!$error) {
            $error = 'Минимум ' . $val . ' ' . \Meerkat\Helper\Helper_Text::plural($val, 'символ', 'символа', 'символов');
        }
        $this->element->addRule('minlength', $error, $val, \HTML_QuickForm2_Rule::ONBLUR_CLIENT_SERVER);
        return $this;
    }
1075095
function getHitLineWidth() {
    var attrs = this._attrs;
    // if (!attrs.stroke) {
    //   return 0;
    // }
    var lineAppendWidth = attrs.lineAppendWidth || 0;
    var lineWidth = attrs.lineWidth || 0;
    return lineWidth + lineAppendWidth;
  }
1009080
public int getWidth(String text) {
        int total = 0;
        if (fastWinansi) {
            int len = text.length();
            for (int k = 0; k < len; ++k) {
                char char1 = text.charAt(k);
                if (char1 < 128 || (char1 >= 160 && char1 <= 255))
                    total += widths[char1];
                else
                    total += widths[PdfEncodings.winansi.get(char1)];
            }
            return total;
        }
        else {
            byte mbytes[] = convertToBytes(text);
            for (int k = 0; k < mbytes.length; ++k)
                total += widths[0xff & mbytes[k]];
        }
        return total;
    }
1360632
function(data) {

    var _mode = QRMode.MODE_ALPHA_NUM;
    var _data = data;

    var _this = {};

    _this.getMode = function() {
      return _mode;
    };

    _this.getLength = function(buffer) {
      return _data.length;
    };

    _this.write = function(buffer) {

      var s = _data;

      var i = 0;

      while (i + 1 < s.length) {
        buffer.put(
          getCode(s.charAt(i) ) * 45 +
          getCode(s.charAt(i + 1) ), 11);
        i += 2;
      }

      if (i < s.length) {
        buffer.put(getCode(s.charAt(i) ), 6);
      }
    };

    var getCode = function(c) {

      if ('0' <= c && c <= '9') {
        return c.charCodeAt(0) - '0'.charCodeAt(0);
      } else if ('A' <= c && c <= 'Z') {
        return c.charCodeAt(0) - 'A'.charCodeAt(0) + 10;
      } else {
        switch (c) {
        case ' ' : return 36;
        case '$' : return 37;
        case '%' : return 38;
        case '*' : return 39;
        case '+' : return 40;
        case '-' : return 41;
        case '.' : return 42;
        case '/' : return 43;
        case ':' : return 44;
        default :
          throw 'illegal char :' + c;
        }
      }
    };

    return _this;
  }
1222220
public int getWidth() {
    Map<String, Object> metaData = getFileMetaData();
    if (metaData != null && metaData.containsKey(IMAGE_WIDTH)) {
      return parseIntValue(metaData.get(IMAGE_WIDTH));
    }
    return 0;
  }
1133300
function maxlength (val, max) {
  if (typeof val === 'string') {
    return isInteger(max, 10) && val.length <= parseInt(max, 10)
  } else if (Array.isArray(val)) {
    return val.length <= parseInt(max, 10)
  } else {
    return false
  }
}
55055
function getFileSize(filepath, options) {
			var stats = fs.statSync(filepath);
			return filesize(stats.size, options);
		}
104225
private int getByteLength(final Object val) {
		if (val == null) {
			return 0;
		}
		String str = val.toString();
		try {
			return str.getBytes(System.getProperty("file.encoding")).length;
		} catch (UnsupportedEncodingException ex) {
			return 1;
		}
	}
288280
function getWidth(stringWidth, str) {
	if (!stringWidth || !stringWidth.toLowerCase)
		return str.length;
	switch (stringWidth.toLowerCase()) {
		case "wcwidth":
			return wcwidth(str);
		case "dbcs":
			return dbcswidth(str);
		case "length":
			return str.length;
		default:
			return str.length;
	}
}
151298
private static Object convertSingleValue(final String val) {
		String value = StringUtils.trim(val);
		if (StringUtils.isEmpty(value)) {
			return null;
		} else if ("[NULL]".equalsIgnoreCase(value)) {
			return null;
		} else if ("[EMPTY]".equalsIgnoreCase(value)) {
			return "";
		} else if (value.startsWith("'") && value.endsWith("'")) {
			// ''で囲まれた値は文字列として扱う。空白を含むこともできる。 ex) 'This is a pen'
			return value.substring(1, value.length() - 1);
		} else if (Boolean.TRUE.toString().equalsIgnoreCase(value)) {
			return Boolean.TRUE;
		} else if (Boolean.FALSE.toString().equalsIgnoreCase(value)) {
			return Boolean.FALSE;
		} else if (NumberUtils.isCreatable(value)) {
			return NumberUtils.createNumber(value);
		} else {
			try {
				// 日時に変換できるか
				return new Timestamp(DateUtils.parseDateStrictly(value, "yyyy-MM-dd'T'HH:mm:ss").getTime());
			} catch (ParseException ex) {
				// do nothing
			}

			try {
				// 日付に変換できるか？
				return new java.sql.Date(DateUtils.parseDateStrictly(value, "yyyy-MM-dd").getTime());
			} catch (ParseException ex) {
				// do nothing
			}

			try {
				// 時刻に変換できるか？
				return new Time(DateUtils.parseDateStrictly(value, "HH:mm:ss").getTime());
			} catch (ParseException ex) {
				// do nothing
			}
			return value;
		}
	}
708232
function (val) {
  return (!behavior.enableUndefined || typeof val !== 'undefined')
    && (!behavior.enableNull || val !== null)
    && (!behavior.enableFalse || val !== false)
    && (!behavior.enableNaN || !Number.isNaN(val));
}
1053382
public static function lengthSort($val_1, $val_2)
    {
        // initialize the return value to zero
        $retVal = 0;

        // compare lengths
        $firstVal = strlen($val_1);
        $secondVal = strlen($val_2);

        if ($firstVal > $secondVal) {
            $retVal = 1;
        } elseif ($firstVal < $secondVal) {
            $retVal = -1;
        }

        return $retVal;
    }
155034
public float getStringWidth(String string, float tj) {
		DocumentFont font = gs().font;
		char[] chars = string.toCharArray();
		float totalWidth = 0;
		for (int i = 0; i < chars.length; i++) {
			float w = font.getWidth(chars[i]) / 1000.0f;
			float wordSpacing = chars[i] == 32 ? gs().wordSpacing : 0f;
			totalWidth += ((w - tj / 1000f) * gs().fontSize + gs().characterSpacing + wordSpacing)
					* gs().horizontalScaling;
		}

		return totalWidth;
	}