home-assistant / iconic Goto Github PK
View Code? Open in Web Editor NEW:art: Auto-generated icon font library for iOS, watchOS and tvOS
License: Apache License 2.0
:art: Auto-generated icon font library for iOS, watchOS and tvOS
License: Apache License 2.0
I get this error when trying to compile my app to my device.
"/Users/johnrehbein/Library/Developer/Xcode/DerivedData/FlipBook-dvfxorfebyxoypbxslfercvccsye/Build/Products/Debug-iphoneos/Iconic/Iconic.framework/Iconic' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture arm64"
I'm not really sure how to rebuild this framework, so an update would be nice. For now I've just disabled bitcode in my app.
Since this library is all about rendering, to make sure things don't break after v1, we should add as many useful snapshot tests as possible.
Things to cover:
I created a font using fontastic.me, installed with the .ttf file and all the SwiftGen generated Icon file has is import UIKit and a comment that says 'No Icon found'. I've tried it using FontAwesome's .ttf file and it works properly. Is there something I'm missing when creating the font or installing the pod?
Hey!
I am receiving a vague linker error when building. I followed the steps as mentioned in the README:
pod 'Iconic', :git => 'https://github.com/dzenbot/Iconic.git', :tag => '1.3'
to podfileAny suggestions for why this might be happening? I've done the whole clean, delete derived data etc etc. I also deleted and re-installed. I also installed the font on my computer (not sure if that is necessary).
Thanks!
Even though CoreText is available in WatchOS 2.2, I wasn't able to add support when trying. I should revisit this.
per the documentation, I've included Iconic in my pod file pod 'Iconic', :git => 'https://github.com/dzenbot/Iconic.git', :tag => '1.3'
I perform the follow steps to update my pods.
FONT_PATH='/path/to/font/ionicons.ttf' pod install
FONT_PATH='/path/to/font/ionicons.ttf' pod update Iconic
the expected behavior is to see Ionicons.swift
in my Pods/Pods/Iconic
directory along with IconDrawable.swift
and IconImageView.swift
, but instead the generated file is FontAwesomeIcon.swift
Side Node
The following is presented as a result of running the command.
Pre-downloading: `Iconic` from `https://github.com/dzenbot/Iconic.git`, tag `1.3`
Downloading dependencies
...
Installing Iconic 1.2 (was 1.2)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There are 6 dependencies from the Podfile and 6 total pods installed.
I would think that having the 1.3
tag would result in installing Iconic 1.3
generated an icon file from icoMoon, the fontBook opened it fine but iconFileParser failed to parse it. Took a while to find the problem because it failed silently....
Looks like the culprit is in IconsFileParser.parseFile() where it tried to get CGFont from CTFont with CGFontCreateWithFontName(fontName)
, which returns nil so it returns without any warning...
I find the generated icon name is different with the website.
For example the check icon in this framework change to FontAwesomeIcon.okIcon
is the bug of FontAwesome itself or something else?
When I run:
FONT_PATH='path_to_your_icon_font.ttf' pod install Iconic
I get an error:
[!] Unknown command: Iconic
Could you tell me why?
now i try to update a new fonts file new.ttf, and when update finish always old.ttf..
plase help me!!
looks like we can only generate one font at a time because the source directory is override everytime. Wondering if the iconizer.sh can take a font directory (FONT_DIR) environment variable, in addition to the FONT_PATH, to generate for all the *.ttf files found in the directory?
Hey. Cool project.
Everything was working great for about 2 weeks, then I started getting this error:
Error Domain=com.apple.CoreText.CTFontManagerErrorDomain Code=105 "Could not register the font file(s)"
So, I checked out error code 105 -> kCTFontManagerErrorAlreadyRegistered
I looked through Iconic's source and it doesn't look like the "already registered" case was handled, so I thought I'd just handle it myself in the app delegate by unregistering the font first:
let bundle = NSBundle(forClass: Iconic.self)
if let url = bundle.URLForResource("Linearicons", withExtension: "ttf"){
var error: Unmanaged<CFErrorRef>? = nil
CTFontManagerUnregisterFontsForURL(url, .None, &error)
Iconic.registerIconFont()
}
However, the call to CTFontManagerUnregisterFontsForURL also returns an error:
Error Domain=com.apple.CoreText.CTFontManagerErrorDomain Code=201 "Could not unregister the font file(s)"
So, I checkout out error code 201 -> kCTFontManagerErrorNotRegistered
Not registered... o.O
Have you run into this before - not being able to register nor unregister a font? Tried cleaning, deleting my derived data, deleting the simulator's data, and double checked the font urls, but no luck.
Could Iconic try to continue its initialization in the case when the error is 105 - already registered?
Any suggestions appreciated.
Thanks!
Hey,
I know this library is in beta but I still want to use it.
It seems that every time I need to update my pod file I have to point out the location for my font file, which then takes some time until it regenerate the Icon class, more than that if I'm doing plain
pod update it installs Iconic with the default Icon class and removes mine..
Is there a better workflow for this?
is any branch available with swift 4.0 syntax .
Please release the new version for swift4 and also bitcode should be enabled for Xcode 9.
Thanks
I was thinking of adding a cache layer to keep a reference of generated image instances. This could be helpful specially when the same icon with color and scale are requested multiple times.
Just putting this out there to see what users think. This is low priority for now.
At first, I was thinking of a NSCache wrapper but then discovered the power of LRU caches and seems more appropriate. I would hate having to add yet another dependency to this library, so maybe creating our own LRU cache implementation makes sense? Wouldn't know where to start tho, so any help is greatly appreciated!
the stencil template hard coded the icon enum name as "Icon" instead of {{enumName}}. Therefore the generated swift file (Pods/Iconic/Source/FontAwesomeIcon.swift) has :
@objc public enum Icon: Int {...}
where it should be:
@objc public enum FontAwesomeIcon: Int {...}
Hey dzenbot! I am currently working on second project where I want to use Iconic, but we have a small issue. As Pods (in our experience) increase build time, we decided to move to Carthage instead. Here comes the problem, Iconic is only available through Pods and it does not seems right to use Pods together with Carthage. We also use SwiftGen on this project and it has this nice command line interface so it can be used in build phase run script.
Is there any plan to implement CLI and then distribute Iconic with brew? Would be killer feature for us :-)
When working with an attributed string, appending an icon with some other text may require some spacing between both elements. Using an optional edge insets could help avoiding to hardcode a whitespace with a string manually.
It seems you've forgot to set access control in Iconic class.
When testing on device/emulator it works allright, but when trying to build the .ipa I get this error: error: no such module 'Iconic', any advice?
Awesome Lib. Is support for rectangular non-square icons on the roadmap?
Given that Iconic is based on SwiftGen, it's easy to provide more than one template for the user to choose from.
// Swift-only template
// Create IconicFont Mixin. Because Mixins are awesome.
public protocol IconicFont {
public static func register()
public static func font(fontSize: CGFloat) -> UIFont!
public func attributedString(size: CGFloat, color: UIColor?) -> NSAttributedString!
public func image(size: CGFloat, color: UIColor?) -> UIImage!
public func unicodeString() -> String!
}
public extension IconicFont {
… implementation goes here …
}
public enum FontAwesomeIcon: IconicFont {
case Adjust
case Adn
case AlignCenter
…
// and it will get the IconicFont default implementations for free!
}
FontAwesomeIcon.register()
let font: UIFont = FontAwesomeIcon.font(size: 14)
let img: UIImage = FontAwesomeIcon.AlignCenter.image(size: 100, color: nil)
let icon = FontAwesomeIcon.AlignCenter
imageView.image = icon.image(size: imageView.bounds.size)
label.attributedText = icon.attributedString(size: 14)
Hello guys,
If I want to use UIImageView properties with UIImage coming from iconic font, for example how can I set UIImageView mode to Aspect Fit and get the size of the font adjust with the size of the imageView ?
Thanks
best regards
Because of changes in CoreSimulatorService
with Xcode 8, SwiftGen fails (reported in SwiftGen/SwiftGen#116).
Will need to update https://github.com/DZNLabs/SwiftGen with the latest of the original repo. Won't be easy/quick.
If anyone tries to install Iconic while having a newer version of Xcode 8 (specially GM), it will fail.
The plan is to allow easy icon font integration with Interface Builder, by having a simple-to-use UIImageView subclass allowing to build icon font images internally.
@dzenbot mind adding me as a co-owner of the CocoaPod so I can push new versions? Should just need to run pod trunk add-owner Iconic [email protected]
to get it done. You will remain an owner. Thanks
$ FONT_PATH='/Users/Plutonist/Downloads/130406-thin-line-ui/font/Flaticon.ttf' pod install
Analyzing dependencies
Downloading dependencies
Using Alamofire (3.4.2)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There are 14 dependencies from the Podfile and 14
total pods installed.
$ FONT_PATH='/Users/Plutonist/Downloads/130406-thin-line-ui/font/Flaticon.ttf' pod update Iconic
[!] The `Iconic` Pod is not installed and cannot be updated
The error output:
[!] The 'Iconic' Pod is not installed and cannot be updated
So I add pod 'Iconic', '~> 1.0.0-beta3'
to Podfile.
But the install progress is stuck at Installing Iconic (1.0.0-beta3)
line and no longer continue.
Will there be a swift3 branch?
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.