Class FontManagerImpl

    • Constructor Detail

      • FontManagerImpl

        public FontManagerImpl​(@Nonnull
                               PerspectiveContext perspectiveContext)
    • Method Detail

      • getFonts

        @Nonnull
        public java.util.List<PerspectiveFont> getFonts()
        Description copied from interface: FontManager
        Returns a copy of the list of all of the managed fonts
        Specified by:
        getFonts in interface FontManager
        Returns:
        A List of all managed fonts
      • getFont

        @Nonnull
        public java.util.Optional<java.io.InputStream> getFont​(java.lang.String fontName,
                                                               java.lang.String fontStyle,
                                                               PerspectiveFontType fontType)
        Description copied from interface: FontManager
        Returns a stream of the raw font's bytes identified by the given name, style, and type
        Specified by:
        getFont in interface FontManager
        Parameters:
        fontName - The name of the font to fetch
        fontStyle - The style of the font to fetch
        fontType - The type of the font to fetch
        Returns:
        An Optional containing the InputStream of raw bytes for the font with the given name, style, and type or an empty Optional of no such font is managed with the given name, style, and type
      • generateKey

        @Nonnull
        public java.util.Optional<PerspectiveFont> generateKey​(@Nonnull
                                                               java.nio.file.Path path)
        Description copied from class: AbstractAssetManager
        Generate a cache key for the given Path
        Specified by:
        generateKey in class AbstractAssetManager<PerspectiveFont,​byte[]>
        Parameters:
        path - The Path for which we want to generate a cache key
        Returns:
        An Optional containing the cache key or an empty Optional if the cache key could not be generated
      • parseValue

        @Nonnull
        protected java.util.Optional<byte[]> parseValue​(@Nonnull
                                                        java.nio.file.Path path)
        Description copied from class: AbstractAssetManager
        Parse the cache value for the given Path
        Specified by:
        parseValue in class AbstractAssetManager<PerspectiveFont,​byte[]>
        Parameters:
        path - The Path for which we want to generate a cache value
        Returns:
        An Optional containing the cache value or an empty Optional if the cache value could not be generated