Measures the height of a single line of text, does not account for \n
@ignore
324845
function measureTextHeight(font) {
       return font.fontData.capHeight * font.lineHeight * font.fontScale.y;
     }
958522
function _measureText(canvas, ctx, params, lines) {
	var originalSize, curWidth, l,
		propCache = caches.propCache;

	// Used cached width/height if possible
	if (propCache.text === params.text && propCache.fontStyle === params.fontStyle && propCache.fontSize === params.fontSize && propCache.fontFamily === params.fontFamily && propCache.maxWidth === params.maxWidth && propCache.lineHeight === params.lineHeight) {

		params.width = propCache.width;
		params.height = propCache.height;

	} else {
		// Calculate text dimensions only once

		// Calculate width of first line (for comparison)
		params.width = ctx.measureText(lines[0]).width;

		// Get width of longest line
		for (l = 1; l < lines.length; l += 1) {

			curWidth = ctx.measureText(lines[l]).width;
			// Ensure text's width is the width of its longest line
			if (curWidth > params.width) {
				params.width = curWidth;
			}

		}

		// Save original font size
		originalSize = canvas.style.fontSize;
		// Temporarily set canvas font size to retrieve size in pixels
		canvas.style.fontSize = params.fontSize;
		// Save text width and height in parameters object
		params.height = parseFloat($.css(canvas, 'fontSize')) * lines.length * params.lineHeight;
		// Reset font size to original size
		canvas.style.fontSize = originalSize;
	}
}
1161373
function () {
    var anchor;
    var baseline;
    var el = this.el;
    var data = this.data;
    var geometry = this.geometry;
    var geometryComponent;
    var height;
    var layout;
    var mesh = this.mesh;
    var textRenderWidth;
    var textScale;
    var width;
    var x;
    var y;

    if (!geometry.layout) { return; }

    // Determine width to use (defined width, geometry's width, or default width).
    geometryComponent = el.getAttribute('geometry');
    width = data.width || (geometryComponent && geometryComponent.width) || DEFAULT_WIDTH;

    // Determine wrap pixel count. Either specified or by experimental fudge factor.
    // Note that experimental factor will never be correct for variable width fonts.
    textRenderWidth = computeWidth(data.wrapPixels, data.wrapCount,
                                   this.currentFont.widthFactor);
    textScale = width / textRenderWidth;

    // Determine height to use.
    layout = geometry.layout;
    height = textScale * (layout.height + layout.descender);

    // Update geometry dimensions to match text layout if width and height are set to 0.
    // For example, scales a plane to fit text.
    if (geometryComponent && geometryComponent.primitive === 'plane') {
      if (!geometryComponent.width) { el.setAttribute('geometry', 'width', width); }
      if (!geometryComponent.height) { el.setAttribute('geometry', 'height', height); }
    }

    // Calculate X position to anchor text left, center, or right.
    anchor = data.anchor === 'align' ? data.align : data.anchor;
    if (anchor === 'left') {
      x = 0;
    } else if (anchor === 'right') {
      x = -1 * layout.width;
    } else if (anchor === 'center') {
      x = -1 * layout.width / 2;
    } else {
      throw new TypeError('Invalid text.anchor property value', anchor);
    }

    // Calculate Y position to anchor text top, center, or bottom.
    baseline = data.baseline;
    if (baseline === 'bottom') {
      y = 0;
    } else if (baseline === 'top') {
      y = -1 * layout.height + layout.ascender;
    } else if (baseline === 'center') {
      y = -1 * layout.height / 2;
    } else {
      throw new TypeError('Invalid text.baseline property value', baseline);
    }

    // Position and scale mesh to apply layout.
    mesh.position.x = x * textScale + data.xOffset;
    mesh.position.y = y * textScale;
    // Place text slightly in front to avoid Z-fighting.
    mesh.position.z = data.zOffset;
    mesh.scale.set(textScale, -1 * textScale, textScale);
  }
424851
function getLineHeight(elem) {
        var lh = computeStyle(elem, 'line-height');
        if (lh == 'normal') {
          // Normal line heights vary from browser to browser. The spec recommends
          // a value between 1.0 and 1.2 of the font size. Using 1.1 to split the diff.
          lh = parseInt(computeStyle(elem, 'font-size')) * 1.2;
        }
        return parseInt(lh);
      }
371427
function() {
        var firstLine = cleanText(self.history.textAfter(self.line).slice(self.offset));
        var match = (self.caseFold ? firstLine.toLowerCase() : firstLine).lastIndexOf(target[0]);
        if (match == -1 || match != firstLine.length - target[0].length)
          return false;
        var startOffset = self.offset + match;

        var line = self.history.nodeAfter(self.line);
        for (var i = 1; i < target.length - 1; i++) {
          var line = cleanText(self.history.textAfter(line));
          if ((self.caseFold ? line.toLowerCase() : line) != target[i])
            return false;
          line = self.history.nodeAfter(line);
        }

        var lastLine = cleanText(self.history.textAfter(line));
        if ((self.caseFold ? lastLine.toLowerCase() : lastLine).indexOf(target[target.length - 1]) != 0)
          return false;

        return {from: {node: self.line, offset: startOffset},
                to: {node: line, offset: target[target.length - 1].length}};
      }
19969
function height(node) {
  return node ? (1 + Math.max(height(node.left), height(node.right))) : 0;
}
348824
function measureTextWidth(font, text) {
       var characters = text.split("");
       var width = 0;
       var lastGlyph = null;

       for (var i = 0; i < characters.length; i++) {
         var ch = characters[i].charCodeAt(0);
         var glyph = font.fontData.glyphs[ch];
         var kerning = lastGlyph && lastGlyph.kerning ? lastGlyph.getKerning(ch) : 0;
         width += (glyph.xadvance + kerning) * font.fontScale.x;
         lastGlyph = glyph;
       }

       return width;
     }
635994
def readline(self, length=None):
        
        if length == 0:
            return b''

        self._fillbuff()

        if self.empty():
            return b''

        linebuff = self.buff.readline(length)

        # we may be at a boundary
        while not linebuff.endswith(b'\n'):
            if length:
                length -= len(linebuff)
                if length <= 0:
                    break

            self._fillbuff()

            if self.empty():
                break

            linebuff += self.buff.readline(length)

        return linebuff
435126
function unit(value, property) {
	let ignored = ['font-weight', 'opacity', 'content', 'columns', 'column-count'];

	if (ignored.includes(property) || property === false || value === 0 || /\s/.test(value)) {
		return value.toString();
	}

	if (! isUnit(value) && isNumber(value)) {
		if (property === 'line-height') {
			value += units.lineHeight;
		} else {
			value += units.default;
		}
	}

	return value;
}
1162634
function (point) {
            var textRangeInfo = function (container, offset) {
                var node, isCollapseToStart;

                if (dom.isText(container)) {
                    var prevTextNodes = dom.listPrev(container, func.not(dom.isText));
                    var prevContainer = list.last(prevTextNodes).previousSibling;
                    node =  prevContainer || container.parentNode;
                    offset += list.sum(list.tail(prevTextNodes), dom.nodeLength);
                    isCollapseToStart = !prevContainer;
                } else {
                    node = container.childNodes[offset] || container;
                    if (dom.isText(node)) {
                        return textRangeInfo(node, 0);
                    }

                    offset = 0;
                    isCollapseToStart = false;
                }

                return {
                    node: node,
                    collapseToStart: isCollapseToStart,
                    offset: offset
                };
            };

            var textRange = document.body.createTextRange();
            var info = textRangeInfo(point.node, point.offset);

            textRange.moveToElementText(info.node);
            textRange.collapse(info.collapseToStart);
            textRange.moveStart('character', info.offset);
            return textRange;
        }
1311586
function isCollapsedLineBreak(br) {
        if (!isHtmlElement(br, "br")) {
            return false;
        }

        // Add a zwsp after it and see if that changes the height of the nearest
        // non-inline parent.  Note: this is not actually reliable, because the
        // parent might have a fixed height or something.
        var ref = br.parentNode;
        while (getComputedStyleProperty(ref, "display") == "inline") {
            ref = ref.parentNode;
        }
        var refStyle = ref.hasAttribute("style") ? ref.getAttribute("style") : null;
        ref.style.height = "auto";
        ref.style.maxHeight = "none";
        ref.style.minHeight = "0";
        var space = document.createTextNode("\u200b");
        var origHeight = ref.offsetHeight;
        if (origHeight == 0) {
            throw "isCollapsedLineBreak: original height is zero, bug?";
        }
        br.parentNode.insertBefore(space, br.nextSibling);
        var finalHeight = ref.offsetHeight;
        space.parentNode.removeChild(space);
        if (refStyle === null) {
            // Without the setAttribute() line, removeAttribute() doesn't work in
            // Chrome 14 dev.  I have no idea why.
            ref.setAttribute("style", "");
            ref.removeAttribute("style");
        } else {
            ref.setAttribute("style", refStyle);
        }

        // Allow some leeway in case the zwsp didn't create a whole new line, but
        // only made an existing line slightly higher.  Firefox 6.0a2 shows this
        // behavior when the first line is bold.
        return origHeight < finalHeight - 5;
    }
300856
private int measureSize(int specType, int contentSize, int measureSpec) {
        int result;
        int specMode = MeasureSpec.getMode(measureSpec);
        int specSize = MeasureSpec.getSize(measureSpec);

        if (specMode == MeasureSpec.EXACTLY) {
            result = Math.max(contentSize, specSize);
        } else {
            result = contentSize;

            if (specType == 1) {
                // width
                result += (getPaddingLeft() + getPaddingRight());
            } else {
                // height
                result += (getPaddingTop() + getPaddingBottom());
            }
        }

        return result;
    }
930692
function (line) {
		line = line || "";
		line = line.trim();

		if (line.length === 0) {
			return true;
		}

		return false;
	}
1164420
function windowBottomScrollbarHeight(): number {
  let out = 0;
  // May be SSR, hence try
  try {
    const { body } = document;
    if (body && body.scrollWidth > window.innerWidth) {
      out = getScrollbarWidth();
    }
  } catch (err) {
    /* ignore */
  }
  return out;
}
732546
function getExpectedIndent(line) {
            const offset = offsets.get(line)
            if (!offset) {
                return 0
            }
            if (offset.expectedIndent !== undefined) {
                return offset.expectedIndent
            }
            const baseIndent = getExpectedIndent(offset.baseline)

            const expectedIndent =
                baseIndent + offset.offset * options.indentSize

            offset.expectedIndent = expectedIndent
            return expectedIndent
        }
109290
function getHeight(el, defaultValue) {
    var height = this.getStyle(el, 'height', defaultValue);
    if (height === 'auto') {
      height = el.offsetHeight;
    }
    return parseFloat(height);
  }
1313997
private int readCustomLine(Text str, int maxLineLength, int maxBytesToConsume)
    throws IOException {
    str.clear();
    int txtLength = 0; // tracks str.getLength(), as an optimization
    long bytesConsumed = 0;
    int delPosn = 0;
    do {
      int startPosn = bufferPosn; // starting from where we left off the last
      // time
      if (bufferPosn >= bufferLength) {
        startPosn = bufferPosn = 0;
        bufferLength = in.read(buffer);
        if (bufferLength <= 0)
          break; // EOF
      }
      for (; bufferPosn < bufferLength; ++bufferPosn) {
        if (buffer[bufferPosn] == recordDelimiterBytes[delPosn]) {
          delPosn++;
          if (delPosn >= recordDelimiterBytes.length) {
            bufferPosn++;
            break;
          }
        } else {
          delPosn = 0;
        }
      }
      int readLength = bufferPosn - startPosn;
      bytesConsumed += readLength;
      int appendLength = readLength - delPosn;
      if (appendLength > maxLineLength - txtLength) {
        appendLength = maxLineLength - txtLength;
      }
      if (appendLength > 0) {
        str.append(buffer, startPosn, appendLength);
        txtLength += appendLength;
      }
    } while (delPosn < recordDelimiterBytes.length
      && bytesConsumed < maxBytesToConsume);
    if (bytesConsumed > (long) Integer.MAX_VALUE)
      throw new IOException("Too many bytes before delimiter: " + bytesConsumed);
    return (int) bytesConsumed;
  }