Is there any existing tool or library in the Java ecosystem that can handle variable fonts and allow me to read and modify their variable axes programmatically (with the aim of rendering the font)?
I have come across the TrueTypeFont class from the Apache PDFBox library, but it does not seem to provide direct methods for accessing and modifying the variable axes. Similarly, java.awt.Font offers a getAvailableAttributes() method but does not return any variable font axes.
The TrueTypeFont class from the Apache PDFBox library and
java.awt.Fontdo not seem to provide direct methods for accessing and modifying the variable axes.You might be able to use a
TextAttributewith the deriveFont method as a workaround. For example, you can create a semi-bold font like this:Font semiBoldfont = font.deriveFont (Map.of (TextAttribute.WEIGHT, TextAttribute.WEIGHT_SEMIBOLD));.However, this might not give you the full control over the variable axes that you’re looking for.