Closed enzosv closed 7 years ago
Also, I got it to work by editing the FontawesomeIcon.swift generated for fontawesome. I replaced the enum, iconmap and NSStringFromIcon function to accomodate my custom font. So maybe the problem is with SwiftGen?
The "No Icon Found" label is generated from the SwitGen custom stencil when the font parsing fails
Could you please share your custom fontastic font? I can then debug your use case and find the root cause for you. Thanks!
I'm having exactly the same issue. Created a font from fontastic.me, followed the steps exactly as suggested on http://rafaltomal.com/how-to-create-and-use-your-own-icon-fonts/
I've attached the font file in a zip, the first character was created by me, others are just taken from some collection on Fontastic. fontalok.ttf.zip
one of the possible causes of "icon not found" is when you pass in a "relative path" in FONT_PATH when doing pod update/install, as i learned earlier, since SwiftGen working path is not the same as the git root path. If that is what happened, just use the absolute path for the FONT_PATH.
@connectdotz: that's what I first though too, but after running the special pod install command with an absolute path to this sample font, no glyph are parsed...
Iconic uses a custom version of Swift right now. Will run a few tests in there and see why the parsing is breaking. Most likely, these fonts are not adding the icon glyphs in the PUA range.
@dzenbot +1 // No icon found http://demo.amitjakhu.com/dripicons/
Cool. Will try with those one too. Thanks.
@dzenbot , after running "fontalok.ttf", I believe the problem is the same as #27. I tested this font with the updated IconsFileParser.swift
and it generated 5 enum as expected. I will submit a PR later today.
@dzenbot I submitted the PR 13 days ago, but since it is in a submodule, the PR is in DZNLabs/SwiftGen, in case you haven't seen it...
Hey @connectdotz, sorry about that, but I haven't had the time yet. I will review it all very soon!
Hey, just tried 1.0.0b3 with our custom font and still getting 'No Icon Found'.
My Podfile:
target 'iconictest' do
use_frameworks!
# Pods for iconictest
pod 'Iconic', :git => 'https://github.com/dzenbot/Iconic.git', :submodules => true
end
Installation:
// I am sure that font at this path exists
FONT_PATH="$PWD/iconictest/Resources/Fonts/test.ttf" pod update Iconic
Including also my .ttf file generated by http://fontastic.me FontTest.ttf.zip
@josefdolezal: Will try and give it a look soon!
@dzenbot: I was debugging the problem today and found out I have to install font on the system (which I haven't). Don't know why but I thought it is no longer required.
Oh really? That solved it? That should not be the case, as I've ran Iconic without installing and worked.
Haven't had time to look at this yet, but I really want to solve this. Maybe add more logs from SwiftGen to diagnose better what's going on.
Yep, definetely. Getting No Icon Found
again when removing font from Font Book.
Looks like this early return is fired
guard let cgFont = CGFontCreateWithFontName(fontName) else { return }
in IconsFontFileParser
.
That looks like the old code, please make sure you have the latest SwiftGen master branch that should have fixed it ...
You are right, I was few commits behind master.. Now all enums are generated as expected. But I am still unable to get get same result with cocoa pods. Looks like Iconizer cocoa pods chekouts ffcdf4e
revision as I did. Any tips?
the submodule needs to be updated explicitly in the Iconic master branch.... Maybe @dzenbot can do this? Mean while, you can try git submodule update --init
in your own fork, although I haven't verified if that solved the problem... If it worked, maybe you can submit a PR that will make everybody's life easier...
This should now be fixed thanks to https://github.com/dzenbot/Iconic/pull/50 I will soon provide a new beta release.
Using 1.3 version,
I have done everything but still getting No fonts found error.
Pod file
target 'event-swift' do
use_frameworks! pod 'LGSideMenuController' pod 'Iconic', :git => 'https://github.com/dzenbot/Iconic.git', :submodules => true
Pod Command FONT_PATH='/Users/ravimodha/Downloads/cds-scout/fonts/cds-scout.ttf' pod install --verbose
Please help to resolve this.
@ravipxm can you attach the cds-scout.ttf
file?
@dzenbot thanks for replying. Following is the url from where you can download the font file.
https://drive.google.com/file/d/0By3bDr-TnOBMbFplYmVRSE5DX1U/view?usp=sharing
@dzenbot
Any updates on this issue.
Thank You
@ravipxm is this font custom designed? Seems like the unicodes being used are Basic Latin's. Instead, the unicodes to be mapped need to be under the PUA range (Private Use Areas). Iconic needs that specific range to be used on the fonts, to scan and retrieve that data accordantly.
@dzenbot
Thanks for replying. I am using fontastic font file only.
@dzenbot
I got it what you said and i have tried that solution and it's working
Thanks alot
That's good to know! 💪
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?