Skip to content

Commit

Permalink
Version 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tclement0922 committed Jan 28, 2025
1 parent 0a58fcb commit 21e4197
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 62 deletions.
25 changes: 12 additions & 13 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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<FontVariation.Setting>`
- 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
48 changes: 7 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -97,20 +63,20 @@ ProvideIconParameters(
You can then use the `FontIcon` composable to display an icon:
```kotlin
FontIcon(
icon = MaterialSymbols.Star,
icon = MyIconFont.MyIcon,
contentDescription = null
)
```

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

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 11 additions & 7 deletions website/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand All @@ -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

```
Expand Down

0 comments on commit 21e4197

Please sign in to comment.