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
externalIconinstead.
-
-
Field Summary
Fields Modifier and Type Field Description private final StringlibraryIdprivate final SymbolWeightweightprivate final SymbolVariantvariantprivate final SymbolFillfillprivate final Integergradeprivate final IntegeropticalSize
-
Constructor Summary
Constructors Constructor Description MaterialSymbolsConfig(SymbolWeight weight, SymbolVariant variant, SymbolFill fill, Integer grade, Integer opticalSize)
-
Method Summary
Modifier and Type Method Description StringgetLibraryId()Unique identifier for the icon library. final SymbolWeightgetWeight()Stroke weight (100-700) final SymbolVariantgetVariant()Visual variant (outlined, rounded, sharp) final SymbolFillgetFill()Fill mode (filled or unfilled) final IntegergetGrade()Fine-tuning parameter for weight adjustment final IntegergetOpticalSize()Optical size optimization parameter StringbuildUrl(String iconName)Build the CDN URL for downloading the icon SVG file. StringgetCacheKey(String iconName)Generate a unique cache key for this icon and configuration combination. StringgetSignature()Generate a signature string used for file naming. -
-
Constructor Detail
-
MaterialSymbolsConfig
MaterialSymbolsConfig(SymbolWeight weight, SymbolVariant variant, SymbolFill fill, Integer grade, Integer opticalSize)
-
-
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")
-
getWeight
final SymbolWeight getWeight()
Stroke weight (100-700)
-
getVariant
final SymbolVariant getVariant()
Visual variant (outlined, rounded, sharp)
-
getFill
final SymbolFill getFill()
Fill mode (filled or unfilled)
-
getOpticalSize
final Integer getOpticalSize()
Optical size optimization parameter
-
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
-
-
-
-