final FontUse fontUse = this.getPrimaryFont(context);
if (fontUse == null) {
throw new IllegalStateException("Unable to obtain a font for baseline computation.");
}
final Font font = fontUse.getFont();
final Script script = this.traitScript(context);
final String opentypeScript = FontUtil.getOpenTypeScript(script);
final Font.Baseline fontBaseline = font.baseline(opentypeScript);
switch (fontBaseline) {
case ALPHABETIC: return Baseline.ALPHABETIC;
case MATH: return Baseline.MATHEMATICAL;