void setFont(Font font) {

			Component component = componentReference.get();
			if (component == null) {
				return; // garbage collected
			}

			Font existingFont = component.getFont();
			Font styledFont = font;
			int style = fontStyle;
			if (style != Font.PLAIN) {
				// Only style the font when it is not plain.  Doing this means that clients cannot
				// override a non-plain font to be plain.  If clients need that behavior, they must
				// create their own custom font id and register their component with Gui.
				styledFont = font.deriveFont(style);
			}

			if (Objects.equals(existingFont, styledFont)) {
				return;
			}

			if (component instanceof FontChangeListener fontListener) {
				fontListener.fontChanged(fontId, styledFont);
			}
			else {
				component.setFont(styledFont);
			}
		}
A simple container that holds a font style and the component that uses that style.  The
component is managed using a weak reference to help prevent memory leaks.
Ghidra/Framework/Gui/src/main/java/generic/theme/laf/ComponentFontRegistry.java