public double computeWhitespacePrefixWidth(int paragraph) {
		List<Text> textNodes = getTextNodes(paragraph);
		double width = 0;

		for (Text textNode : textNodes) {
			String text = textNode.getText();
			double boundWidth = textNode.getBoundsInLocal().getWidth();
			if (text.isBlank()) {
				// Texts that are blank are all whitespace, add it up.
				width += boundWidth;
			} else {
				// Some texts have leading whitespace that we want to consider.
				int whitespacePrefix = StringUtil.getWhitespacePrefixLength(text);
				if (whitespacePrefix > 0) {
					double charWidth = boundWidth / StringUtil.getTabAdjustedLength(text);
					width += charWidth * whitespacePrefix;
				}
				break;
			}
		}

		return width;
	}
Compute the width of blank text before non-blank text.

@param paragraph
		Paragraph index to compute empty space (in pixels) to the first non-whitespace character.

@return Pixels to first non-whitespace character.

@see #getTextNodes(int)
recaf-ui/src/main/java/software/coley/recaf/ui/control/richtext/Editor.java