Comments (13)
The font names are completely different and not backward compatible from my understanding. The suggestions for the FA 5 to FA 6 (using a Kit or self-hosted) don't seem to apply to your mobile implementation.
But I will dig into it a bit more.
from faswiftui.
I haven't had time to try it, honestly. As long as they didn't change the JSON format, it should theoretically still work. Would you give it a try and let me know if it throws any errors?
from faswiftui.
Ah, well that would do it. I've got a number of plans for a V2, and I will add FA V6 support to that list, but I don't have an ETA since my work has taken me away from SwiftUI in the past year and I haven't had the time. I'm open to PRs if anyone wants to contribute.
from faswiftui.
Okay, thanks for the reply. I will see what it will take and consider a PR.
from faswiftui.
There is a JavaScript file that contains the FA 5 to FA 6 mapping that looks like this:
"wand-magic": [512, 512, ["magic"], "f0d0", "M14.06 395.4L395.4 14.06C414.2-4.686 444.6-4.686 463.3 14.06L497.9 48.64C516.6 67.38 516.6 97.78 497.9 116.5L116.5 497.9C97.78 516.6 67.38 516.6 48.64 497.9L14.06 463.3C-4.686 444.6-4.686 414.2 14.06 395.4V395.4zM354.2 192.3L463.1 82.58L429.4 48L319.7 157.7L354.2 192.3zM285.7 191.7L48 429.4L82.58 463.1L320.3 226.2L285.7 191.7z"],
I can create a simple mapping file (containing only the icon name and the possible mapping) that is read upon initialization. And in the FontAwesome.swift file and the icon method change the lookup to include the mapping:
public func icon(byName name: String) -> FAIcon? {
return store[name.lowercased()]
}
Thoughts?
from faswiftui.
We are looking at a more slimed down solution to put a wrapper around something like this:
Text("address-card") .font(Font.custom("FontAwesome6Free-Regular", size: 14, relativeTo: .body))
from faswiftui.
Was able to get FA6 integration working quite quickly by adding
case thin
to the FAStyle enum and by adding a function to add leading zeros to any unicode string less than 4 chars.
(obviously also changing the FACollection enum to 6's instead of 5's and also copy in the FA 6 icons.json and .otf files)
from faswiftui.
That's great. If you open a PR with those changes I will merge it.
from faswiftui.
That's great. If you open a PR with those changes I will merge it.
Just going to try and add backwards compatibility for 5 so as not to break existing deployments and then will submit a PR. Bear with.
from faswiftui.
Thank you! And no rush, because as you can see I'm certainly taking my sweet time with any changes and additions.
from faswiftui.
from faswiftui.
Thank you for that. I appreciate some action here since it's been a little stagnant. I will take a look at the PR and likely merge it in today.
I might take you up on your offer since I've not been working much in Apple dev lately and thus haven't touched projects like this one.
from faswiftui.
Merged PR #18 to add support for FA 6.
from faswiftui.
Related Issues (19)
- Question Marks only HOT 4
- icons not displaying. getting a squared question mark HOT 3
- LICENSE HOT 1
- Disable font scaling impact by IOS HOT 2
- Some icons shows as question mark HOT 6
- About QGrid dependencies HOT 2
- in iOS 14 widgets I have crash with "Terminated due to memory error." HOT 5
- Swift Package not pulling down latest commit HOT 2
- Add support to macOS HOT 2
- Accessing Search function requires public on init
- Missing support for Sharp font style HOT 2
- Won't display in TabView HOT 15
- Add fallback and error logging for missing styles and incorrect names HOT 8
- on free plan lib fails when i try to show unsupported icon HOT 1
- Target Membership
- Xcode 12 Beta Crash HOT 1
- Fatal error in Initializer HOT 3
- Some FAText icons are question marks. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from faswiftui.