Class TeXResources

java.lang.Object
org.scilab.forge.jlatexmath.TeXResources

public final class TeXResources extends Object
Where the library reads its resources: the TeXResourceProvider that is installed with setProvider(TeXResourceProvider), and nothing else (as BaseFont.setResourceProvider of OpenPDF). The JVM installs TeXClassLoaderResources, which reads the class path; the C build has no class loader and installs a provider that reads the files embedded in the executable. Without a provider, there is no resource.

The name of a resource is the one that Class.getResourceAsStream takes: relative to the package of the class that asks, or from the root of the class path when it starts with a slash. The provider is given the whole name, without slash.

  • Method Details

    • setProvider

      public static void setProvider(TeXResourceProvider provider)
      Null removes it: the library then finds no resource.
    • getProvider

      public static TeXResourceProvider getProvider()
    • open

      public static InputStream open(Class<?> anchor, String name)
      Parameters:
      anchor - the class that asks (its package is where a relative name starts)
      Returns:
      the content, or null if there is no such resource