protected void measure() {

		FontMetrics fm = this.getFontMetrics(this.getFont());

		// if no font metrics yet, just return

		if (fm == null) {
			return;
		}

		line_height = fm.getHeight();
		line_ascent = fm.getAscent();
		max_width = 0;
		for (int i = 0; i < num_lines; i++) {
			line_widths[i] = fm.stringWidth(lines[i]);
			if (line_widths[i] > max_width) {
				max_width = line_widths[i];
			}
		}

	}
This method figures out how large the font is, and how wide
each line of the label is, and how wide the widest line is.
Ghidra/Framework/Docking/src/main/java/docking/widgets/MultiLineLabel.java