Class MaterialSymbolsConfig

  • All Implemented Interfaces:
    io.github.kingsword09.symbolcraft.model.IconConfig

    @Serializable() 
    public final class MaterialSymbolsConfig
     implements IconConfig
                        

    Configuration for Material Symbols icon library.

    Uses Google Fonts CDN as the source for Material Symbols icons. For custom CDN or backup URLs, use externalIcon instead.

    • Method Detail

      • getLibraryId

         String getLibraryId()

        Unique identifier for the icon library. Must be unique across all icon libraries to avoid cache conflicts.

        Recommended format: "library-name" (e.g., "material-symbols", "font-awesome")

      • getGrade

         final Integer getGrade()

        Fine-tuning parameter for weight adjustment

      • buildUrl

         String buildUrl(String iconName)

        Build the CDN URL for downloading the icon SVG file.

        Parameters:
        iconName - Name of the icon (e.g.
        Returns:

        Full URL to the SVG file

      • getCacheKey

         String getCacheKey(String iconName)

        Generate a unique cache key for this icon and configuration combination.

        The cache key MUST be unique across all icons and configurations to avoid cache conflicts. It's recommended to include: iconName, libraryId, and all style parameters.

        Parameters:
        iconName - Name of the icon
        Returns:

        Unique cache key string

      • getSignature

         String getSignature()

        Generate a signature string used for file naming. This appears in the generated Kotlin file names.

        Should be short and descriptive (e.g., "W400Outlined", "Fill", "24px")

        Returns:

        Signature string for file naming