icongen 0.6.0
icongen: ^0.6.0 copied to clipboard
Subsets icon fonts and generates Flutter bindings for them.
0.6.0 #
-
Bumped minimum SDK version to Dart 3.13.
- Refactored classes and extension types to use Dart 3.13 primary constructors and concise constructor syntax.
- Reformatted the library with Dart 3.13 formatter changes.
-
Bumped dependency constraints.
dart_styleto^3.1.12.freezed_annotationto^3.1.0.harfbuzz_ffito^0.5.0.metato^1.19.0.woff2_ffito^0.2.0.dev:freezedto^4.0.0-dev.3.
0.5.2 #
- Fixed mistakenly calculating WOFF2 uncompressed size for some non-WOFF2 fonts.
- The issue was causing absurdly large allocations before the decompression would fail.
- Adds a check for the WOFF2 Header signature.
- Now, non-WOFF2 fonts fill never get passed to the WOFF2 native library.
0.5.1 #
-
Reduced unnecessary memory copies by utilizing Dart native finalizers.
- Currently, this experimental change only applies to two use cases: decompressing a WOFF2 font before any processing, and compressing subset results to WOFF2.
-
Migrated from
package:ffiallocators topackage:ffi_leak_trackeradaptive allocators.- This integration will help track potential native memory leaks.
-
Added
fromJson()andtoJson()toVariableAxisConstraint.- Preparing for future file config support.
-
Renamed type parameter from
ValueTypetoIdTypeinwriteSubsets()andwriteBindings().- This does not affect dependents in any way, but improves API clarity.
-
Minor internal changes.
-
Bumped the
harfbuzz_ffidependency to0.4.2.- Minimum version which supporst HarfBuzz experimental APIs for future use.
-
Changed package path in monorepo (from
packages/icongentopackages/icons/icongen).
0.5.0 #
-
Renamed
bytesparameter toinputBytesinSubsetBuilderandbuildSubsets(). -
Replaced positional
subsetResultparameter with namedinputBytesparameter inBindingsBuilderandBindingsEntry.- They now accept raw font bytes directly instead of requiring a
SubsetResultinstance.
- They now accept raw font bytes directly instead of requiring a
-
Removed
fontFamilyandiconGlyphsproperties fromSubsetResult.SubsetResultandSubsetResultWithIdnow only store the generated font subsetbytes.- Removed
fontFamilyandiconGlyphsparameters fromSubsetBuilderResultFactory.
-
Migrated entry models (
SubsetEntry,BindingsEntryandWriteEntry) away from Freezed data classes to standard immutable Dart classes. -
Added library-level documentation comment to
package:icongen. -
Refactored internal low-level HarfBuzz and WOFF2 font parsing and extraction utilities into a shared internal library.
-
Updated usage examples.
0.4.1 #
-
Added WOFF2 support via the
woff2_ffipackage.- WOFF2 fonts are automatically decompressed before subsetting.
- Font format (TTF / WOFF2) is preserved after subsetting.
- You can use the
SubsetBuilder.forceSubsetproperty to override the output format.
-
Added
SubsetBuilder.forceSubsetflag.- Defaults to
false. Setting totruewill enforce a subset even if it would be unnecessary.
- Defaults to
-
Updated
SubsetEntryto support newSubsetBuilderparameters:forceSubsetandsubsetFormat. -
Added extension methods
SubsetBuilder.buildWithId()andBindingsBuilder.buildWithId().- They simplify creating
SubsetResultWithIdorBindingsResultWithIddirectly, without unnecessary intermediateSubsetResultorBindingsResult.
- They simplify creating
-
Added utility
SubsetIdToResultMap<IdType>andBindingsIdToResultMap<IdType>type aliases.- They can help when building from multiple font sources with different ID classes.
-
Improved internal source file structure.
-
Updated
.gitignoreto use the standard template. -
Clarified
uniXXXXicon names filtration in the0.4.0changelog.
0.4.0+1 #
- Fixed grammar mistakes in the
0.4.0changelog.
0.4.0 #
-
Moved the main APIs away from being ID-aware.
- Removed
generateFontSubsetsandgenerateIconBindingsutility functions. - Removed automatic font loading functionality for maximum flexibility.
- The low-level APIs are now fully synchronous, because they don't perform I/O operations anymore.
- Renamed
FontSubsetBuildertoSubsetBuilder,IconBindingsBuildertoBindingsBuilderand marked them as@immutable. - Renamed
SubsetAxisConstrainttoVariableAxisConstraint. - Removed type parameters from all low-level classes (
SubsetBuilderandSubsetResultno longer accept an ID type parameter).
- Removed
-
Added mid-level utility functions to serve as replacements for the removed ID-based generator APIs.
buildSubsetsandbuildIconsbuild ID-mapped subsets and icons respectively, fully synchronously.SubsetEntry(replacement forSubsetOutput) andBindingsEntryprovide configuration for the build methods.SubsetResultWithId<IdType>andBindingsResultWithId<IdType>represent the results of the build methods.writeSubsetsandwriteBindingsare small utility functions that help write the generated font subset bytes and icon bindings code to the file system.WriteEntry<T>serves as the main primitive for these functions.
-
Added a new type to store predefined tags:
VariableAxisTag.- This extension type is erased at runtime, meaning casts from
Stringare safe for custom axis tags. - This class contains extensive metadata about each axis tag defined in the Google Fonts Axis Registry.
- Added a Python script to generate the data automatically from the latest Google Fonts Axis Registry data.
- This extension type is erased at runtime, meaning casts from
-
Removed the
tagproperty fromVariableAxisConstraint.- Constraints are now defined by a new type:
VariableAxisConstraints, which is aMap<VariableAxisTag, VariableAxisConstraint>- prevents duplicate constraint issues.
- Constraints are now defined by a new type:
-
Migrated result models (i.e.
SubsetResult,BindingsResult, etc.) away from Freezed data classes because they may store large amounts of data now (Uint8List, etc.). -
Icon names matching the following regular expression are now filtered out:
^u(ni)?[0-9a-fA-F]{4,}$. -
Reviewed and fixed icon identifier sanitization logic.
- Aligned the reserved keyword list with the Dart language specification.
- The surrounding class name is now considered a reserved identifier.
-
Enabled JSON serialization functionality for
VariableAxisConstraint(deserialized based on thetypefield) andIconGlyph. -
Fixed
build_runnerbuilds failing if theexampledirectory had generated icon bindings files which didn't belong to the package. -
Heavily improved internal file structure.
-
Updated examples and README.
0.3.0 #
- Migrated away from discontinued
harfbuzzdependency toharfbuzz_ffi, which has fully replaced the former package.- Removed discontinued
harfbuzzdependency. - Bumped
harfbuzz_ffidependency to^0.4.0.
- Removed discontinued
0.2.0 #
-
The generator will now add
fontFamilyandfontPackagestatic constants to generated classes.- This information can be used when creating dynamic
IconDatainstances at runtime.
- This information can be used when creating dynamic
-
The generator will now add documentation comments to most of the generated declarations.
-
The generator will now sanitize generated icon identifiers which match identifiers of other generated declarations (e.g.
fontFamily,fontPackage,forceCompileTimeTreeShaking).- This should not affect most icon fonts.
-
Disabled formatting in generated source code files.
- This should reduce line count and improve clarity.
-
Updated usage examples.
-
Updated package README.
-
Removed
code_builderdependency due to unnecessary complexity.- Icon bindings generator now uses raw strings.
-
Bumped
metadependency to^0.18.0.- Aligned with latest stable SDK pinned dependency constraint.
0.1.0 #
-
Initial version.
-
Added basic usage example.
-
Cleaned up dependencies.