scerio / icon_font_generator Goto Github PK
View Code? Open in Web Editor NEW☣️ Flutter Icon Font Generator
Home Page: https://pub.dev/packages/icon_font_generator
License: Other
☣️ Flutter Icon Font Generator
Home Page: https://pub.dev/packages/icon_font_generator
License: Other
Invalid argument(s): Register has invalid characters 500px
I maintain a very large icon pack: https://github.com/ubuntu/yaru_icons.dart
Sometimes need to duplicate some icon source files for similar icons with different names.
Ofc, I can use real symlink, but this mean to increase the font size, while I could just reuse an existent font code.
A PR which add this feature will follow in a moment :)
$ dpm add --dev icon_font_generator
bash: dpm: command not found
[] flutter pub upgrade
Resolving dependencies...
Because icon_font_generator >=4.0.0 depends on logger ^1.3.0 and yourapp depends on logger ^2.0.1, icon_font_generator >=4.0.0 is forbidden.
So, because yourapp depends on icon_font_generator ^4.0.0, version solving failed.
You can try the following suggestion to make the pubspec resolve:
* Consider downgrading your constraint on icon_font_generator: flutter pub add dev:icon_font_generator:^3.2.0
exit code 1
Hi, I'm glad about this package.
I think this lib could add only one icon in the current font file.
I tried to create simple icons from svg but this error was given:
[email protected] install C:\Users\Vipin Malik\AppData\Roaming\Pub\Cache\global_packages\icon_font_generator\node_modules\ttf2woff2
(node-gyp rebuild > builderror.log) || (exit 0)
Is this issue related to the package side or my side?
I cannot generate icons on macOS.
❯ icon_font_generator --from=icons --class-name=StreamlineIcons --out-font=assets/fonts/streamline_icons.ttf --out-flutter=lib/app/services/streamline_icons.dart
Unhandled exception:
FileSystemException: Deletion failed, path = '/Users/rebar/.pub-cache/global_packages/icon_font_generator/temp_icons' (OS Error: Permission denied, errno = 13)
#0 _Directory._delete.<anonymous closure> (dart:io/directory_impl.dart:192:9)
<asynchronous suspension>
#1 GenerateCommand.run (file:///Users/rebar/.pub-cache/hosted/pub.dartlang.org/icon_font_generator-3.2.0/bin/icon_font_generator.dart:115:7)
<asynchronous suspension>
#2 CommandRunner.runCommand (package:args/command_runner.dart:209:13)
<asynchronous suspension>
#3 main (file:///Users/rebar/.pub-cache/hosted/pub.dartlang.org/icon_font_generator-3.2.0/bin/icon_font_generator.dart:13:5)
<asynchronous suspension>
Hi, that's the question. For what is user the generated .ttf?
lib/widgets/icons.dart(1099,16): error GBE42D792: 'IconData' isn't a type. [[C:\Users\len5due\Music\baustellentool\build\windows\flutter\flutter_assemble.vcxproj]
Problem in Windows with the IconData Datatype
Hi there!
Here my test command
icon_font_generator --from=assets/icons --class-name=UiIcons --out-font=assets/fonts/ui_icons.ttf --out-flutter=lib/ui_icons.dart --normalize
Here icon from font created using fluttericon.com and beside using this package
https://i.imgur.com/UQ2Pdx9.png
Here the icon
https://disk.yandex.ru/i/c3_MyGWjkCBMFg
When running dart run icon_font_generator:generate
I get this error:
Could not find `bin/generate.dart` in package `icon_font_generator`.
The file bin/generate.dart
exists in ~/.pub-cache/hosted/pub.dev/icon_font_generator-4.0.0/
How can I fix this? (I'm on a Mac)
I'm facing this issue when I'm trying to generate the icons.
C:\Users\theza\AndroidStudioProjects\reactions_test>icon_font_generator --from=assets/ic
ons --class-name=UiIcons --out-font=assets/fonts/io_icons.ttf --out-flutter=lib/widgets/
icons.dart
Unhandled exception:
Unsupported operation: Cannot extract a file path from a c URI
#0 _Uri.toFilePath (dart:core/uri.dart:2636:7)
#1 new File.fromUri (dart:io/file.dart:248:49)
#2 GenerateCommand.run (file:///C:/Users/theza/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/icon_font_generator-3.1.0/bin/icon_font_generator.dart:111:27)
<asynchronous suspension>
#3 CommandRunner.runCommand (package:args/command_runner.dart:209:13)
<asynchronous suspension>
#4 main (file:///C:/Users/theza/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/icon_font_generator-3.1.0/bin/icon_font_generator.dart:13:5)
<asynchronous suspension>
It looks like some svgs are not working properly if they have shapes or multiple paths.
https://lean-svg.netlify.app/ seems to help fixing those svgs, but it would be nice to have a solution built-in.
NPM module icon-font-generator is deprecated.
https://github.com/tancredi/fantasticon is the better replacement.
It could be imo nice to not make the icon data class private to allow stuff like this:
Icon(UiIconsData(0xf101))
This allow for example to create a list of all icons by looping between a range of code point.
I can make a PR if you want :)
Prefer declaring const for immutable like.
can u generate like const UiIcons._();
By the way amazing package using in the company..
It would be nice to support different naming strategy, like snake (yaru_icon) or camel (yaruIcon).
dart class generation not working
stack
Unhandled exception:
Invalid argument(s): Register has invalid characters clock-wait
#0 new Register (package:register/register.dart:15:7)
#1 generateFlutterClass. (package:icon_font_generator/generate_flutter_class.dart:25:40)
#2 MappedIterator.moveNext (dart:_internal/iterable.dart:395:18)
#3 Iterable.join (dart:core/iterable.dart:372:23)
#4 generateFlutterClass (package:icon_font_generator/generate_flutter_class.dart:46:57)
#5 GenerateCommand.run (file:///Users/karaken/.pub-cache/hosted/pub.dartlang.org/icon_font_generator-1.0.0/bin/icon_font_generator.dart:200:39)
#6 CommandRunner.runCommand (package:args/command_runner.dart:197:27)
#7 CommandRunner.run. (package:args/command_runner.dart:112:25)
#8 new Future.sync (dart:async/future.dart:224:31)
#9 CommandRunner.run (package:args/command_runner.dart:112:14)
#10 main (file:///Users/karaken/.pub-cache/hosted/pub.dartlang.org/icon_font_generator-1.0.0/bin/icon_font_generator.dart:13:18)
#11 _startIsolate. (dart:isolate-patch/isolate_patch.dart:305:32)
#12 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:174:12)
Hello, I'm using icon_font_generator to add custom svg icon to my application. After completing each configuration step I noticed that my icons are some random emoji with an iphone-like style.
When trying to run this command flutter pub run icon_font_generator
I have this error: Could not find bin/icon_font_generator.dart in package icon_font_generator.
Here are the steps I did:
flutter pub global activate icon_font_generator
flutter pub run icon_font_generator
Also, from the documentations, I saw there is a command called "generator" that actually builds up something but I still see my svg icons as emojes. Please if anyone encountered help me solve it
Also providing my configuration in the .yaml
file:
icon_font:
input_svg_dir: "assets/svg/"
output_font_file: "fonts/app_icons_font.otf"
output_class_file: "lib/src/core/theme/app_icons.dart"
class_name: "AppIcons"
format: true
font_name: "App Icons"
normalize: true
ignore_shapes: false
recursive: false
verbose: false
Could not find a set of Noto fonts to display all missing characters. Please add a font asset for the missing characters. See: https://flutter.dev/docs/cookbook/design/fonts
I had an .svg
file with a dash in it and ran the generator. The generator failed with the following output:
Generated /home/geertjohan/.pub-cache/global_packages/icon_font_generator/temp_font/IrmaIcons.ttf
Generated /home/geertjohan/.pub-cache/global_packages/icon_font_generator/map.json
Done
Unhandled exception:
Invalid argument(s): Register has invalid characters arrow-down
#0 new Register (package:register/register.dart:15:7)
#1 generateFlutterClass.<anonymous closure> (package:icon_font_generator/generate_flutter_class.dart:25:40)
#2 MappedIterator.moveNext (dart:_internal/iterable.dart:393:18)
#3 Iterable.join (dart:core/iterable.dart:370:23)
#4 generateFlutterClass (package:icon_font_generator/generate_flutter_class.dart:46:57)
<asynchronous suspension>
#5 GenerateCommand.run (file:///home/geertjohan/.pub-cache/hosted/pub.dartlang.org/icon_font_generator-0.0.7/bin/icon_font_generator.dart:186:39)
<asynchronous suspension>
#6 CommandRunner.runCommand (package:args/command_runner.dart:197:27)
<asynchronous suspension>
#7 CommandRunner.run.<anonymous closure> (package:args/command_runner.dart:112:25)
#8 new Future.sync (dart:async/future.dart:224:31)
#9 CommandRunner.run (package:args/command_runner.dart:112:14)
#10 main (file:///home/geertjohan/.pub-cache/hosted/pub.dartlang.org/icon_font_generator-0.0.7/bin/icon_font_generator.dart:13:18)
<asynchronous suspension>
#11 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:303:32)
#12 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:12)
After renaming the arrow-down.svg
to arrow_down.svg
, the tool keeps complaining with the same error. I found that the issue is fixed after removing map.json
, temp_fonts
and temp_icons
from /home/geertjohan/.pub-cache/global_packages/icon_font_generator
. arrow-down.svg
was being cached in the temp dir, but the temp dir is not removed when the tool exits with an error.
I think the solution is to always cleanup the temp dirs, even if the tool exits with an error.
Hi @SergeShkurko,
I noticed that you have done a big update of this package, and it looks like there are a lot less problems than with fantasticon
.
I really wanted to use it to build the yaru_icons package, but it's missing a lot of features compared to the previous version.
So I've patched it in my fork to add them:
I'd like to know if you'd be open to some PRs to add these features?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.