public void registerFont(String name, String path) {
    try {
      _fonts.put(name, ((JavaAssets) assets()).requireResource(path).createFont());
    } catch (Exception e) {
      platform.reportError("Failed to load font [name=" + name + ", path=" + path + "]", e);
    }
  }
public void registerFont ( String name , String path ) { try { _fonts . put ( name , ( ( JavaAssets ) assets ( ) ) . requireResource ( path ) . createFont ( ) ) ; } catch ( Exception e ) { platform . reportError ( "Failed to load font [name=" + name + ", path=" + path + "]" , e ) ; } }
Registers a font with the graphics system.

@param name the name under which to register the font.
@param path the path to the font resource (relative to the asset manager's path prefix).
Currently only TrueType ({@code .ttf}) fonts are supported.