diff --git a/CHANGELOG.md b/CHANGELOG.md index b0af1e3c..2483d852 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,18 +1,17 @@ -Changes from 1.4.0: -- Implement non-composable functions for Compose Resources fonts (f92aa9c30ad3c998b21441d40fb2bfd354c0f13a) -- Fix Glance static font support when using multiplatform resources (eb276568e225885f215b6b05a2ca9a1c4185de5d) - -Packaged fonts: -- Material Symbols (revision [67a2d69](https://github.com/google/material-design-icons/tree/67a2d692ac9918d65025ee8a2378818e3d7a8f72)) -- FontAwesome Free (version [6.6.0](https://github.com/FortAwesome/Font-Awesome/tree/6.6.0)) +Changes from 1.4.1: +- Dropped support for packaged fonts, the accessors should now be manually generated from [the tool available on the new + website](https://tclement0922.github.io/compose-font-icons/generator) +- Removed every deprecated functions +- Slightly changed the variable fonts APIs: the `fontVariationSettings` parameters are now a `FontVariation.Settings` + object instead of an `Array` +- The Desktop (JVM) target now targets Java 11 instead of Java 8 since Compose Multiplatform requires Java 11 for the + JVM +- Renamed the `core-glance` module to `glance` Built with: -- Compose Multiplatform 1.7.0 -> [!CAUTION] -> Due to changes in the dependencies of Compose Multiplatform, adjustments have been made to this library's internal -> code. Those changes make this library incompatible with versions of Compose Multiplatform prior to 1.7.0. -- Kotlin 2.0.21 +- Compose Multiplatform 1.7.3 +- Kotlin 2.1.0 - AndroidX Glance 1.1.1 -- Android Gradle plugin 8.5.2 +- Android Gradle plugin 8.7.3 **Full Changelog**: https://github.com/tclement0922/compose-font-icons/compare/v1.4.0...v1.4.1 \ No newline at end of file diff --git a/README.md b/README.md index 6da793b2..816b7c22 100644 --- a/README.md +++ b/README.md @@ -39,51 +39,17 @@ dependencies { The main module, providing the core functionality of the library. -### `core-glance` +### `glance` -An additional module providing support for AndroidX Glance (Android App Widgets / WearOS Tiles). This is the only module -that is only compatible with Android. - -### `font-fa` - -This module provides support for the Font Awesome Free font. An icon can be referenced by its name, for example -`FontAwesome.Regular.Star`. The fonts are not provided in this module, they must either be provided by the user or by -using the packaged font modules. - -### `font-fa-brands`, `font-fa-regular` and `font-fa-solid` - -Packaged variants of the Font Awesome Free font[^1]. These modules provide their corresponding font as a resource and a -function to create this font (`rememberBrandsFontAwesomeFont`, `rememberRegularFontAwesomeFont` or -`rememberSolidFontAwesomeFont`). - -[^1]: The Font Awesome Free fonts are licensed under the - [SIL OFL 1.1 license](https://github.com/FortAwesome/Font-Awesome/blob/6.x/LICENSE.txt) - -### `font-symbols` - -This module provides support for the Material Symbols variable font. An icon can be referenced by its name, for example -`MaterialSymbols.Star`. The fonts are not provided in this module, they must either be provided by the user or by using -one of the packaged font modules. - -> [!CAUTION] -> Android API 25 and lower don't support variable fonts, this means that variations won't be applied. This font will -> default to its default settings on those versions. - -### `font-symbols-outlined`, `font-symbols-rounded` and `font-symbols-sharp` - -Packaged variants of the Material Symbols variable font[^2]. These modules provide their corresponding font as a -resource and a function to create this font (`rememberOutlinedSymbolsFont`, `rememberRoundedSymbolsFont` or -`rememberMaterialSymbolsFont`). - -[^2]: The Material Symbols fonts are licensed under the - [Apache 2.0 license](https://github.com/google/material-design-icons/blob/master/LICENSE) +A module providing support for AndroidX Glance (Android App Widgets / WearOS Tiles). This module is only compatible with +Android. # Usage (Optional) Set the default icon parameters: ```kotlin ProvideIconParameters( - iconFont = your_font, // ex: for outlined Material Symbols: rememberOutlinedMaterialSymbolsFont() + iconFont = yourFont, tintProvider = LocalContentColor ) { // icons here will have by default the params declared above @@ -97,7 +63,7 @@ ProvideIconParameters( You can then use the `FontIcon` composable to display an icon: ```kotlin FontIcon( - icon = MaterialSymbols.Star, + icon = MyIconFont.MyIcon, contentDescription = null ) ``` @@ -105,12 +71,12 @@ FontIcon( An alternative function that takes a `String` instead of a `Char` is also available, for fonts that supports ligatures: ```kotlin FontIcon( - iconName = "star", + iconName = "my_icon", contentDescription = null ) ``` -Read the full API reference [here](https://tclement0922.github.io/compose-font-icons) for advanced usage and additional information. +Go on the [website](https://tclement0922.github.io/compose-font-icons) for advanced usage and additional information. # License diff --git a/gradle.properties b/gradle.properties index 5333a38b..0f92e5a4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -55,7 +55,7 @@ FONT_SYMBOLS_REVISION=67a2d692ac9918d65025ee8a2378818e3d7a8f72 FONT_FA_REVISION=6.6.0 GROUP=dev.tclement.fonticons -VERSION_NAME=1.4.1 +VERSION_NAME=2.0.0 POM_CORE_NAME=Compose Font Icon POM_CORE_DESCRIPTION=Font icons composables for Compose Multiplatform diff --git a/website/guide.md b/website/guide.md index e742b2ea..bb3ea748 100644 --- a/website/guide.md +++ b/website/guide.md @@ -11,7 +11,8 @@ Variable fonts are supported, the optical size (`opsz`) and weight (`wgth`) axes icon size and provided parameters. > [!IMPORTANT] -> Due to a limitation in the Android API, Android versions older that Oreo (API 26) don't support variable fonts. +> Due to a limitation in the Android API, Android versions older than Oreo (API 26) don't support variable fonts. +> The fonts will render with their default variation values in that case. # Setup @@ -31,17 +32,17 @@ dependencies { The main module, providing the core functionality of the library. -### `core-glance` +### `glance` -An additional module providing support for AndroidX Glance (Android App Widgets / WearOS Tiles). This is the only module -that is only compatible with Android. +A module providing support for AndroidX Glance (Android App Widgets / WearOS Tiles). This module is only compatible with +Android. # Usage (Optional) Set the default icon parameters: ```kotlin ProvideIconParameters( - iconFont = your_font, // ex: for outlined Material Symbols: rememberOutlinedMaterialSymbolsFont() + iconFont = yourFont, tintProvider = LocalContentColor ) { // icons here will have by default the params declared above @@ -55,19 +56,22 @@ ProvideIconParameters( You can then use the `FontIcon` composable to display an icon: ```kotlin FontIcon( - icon = MaterialSymbols.Star, + icon = MyIconFont.MyIcon, // Here, MyIconFont.MyIcon is a Char equal to the unicode of the icon contentDescription = null ) ``` +This kind of accessors (*FontName*.*IconName*) can be generated from the [Accessors Generator](/generator) tool. An alternative function that takes a `String` instead of a `Char` is also available, for fonts that supports ligatures: ```kotlin FontIcon( - iconName = "star", + iconName = "my_icon", contentDescription = null ) ``` +Read the [API documentation](/api) for more information. + # License ```