Giter Site home page Giter Site logo

Comments (13)

bdnextiva avatar bdnextiva commented on July 18, 2024 1

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.

mattmaddux avatar mattmaddux commented on July 18, 2024

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.

mattmaddux avatar mattmaddux commented on July 18, 2024

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.

bdnextiva avatar bdnextiva commented on July 18, 2024

Okay, thanks for the reply. I will see what it will take and consider a PR.

from faswiftui.

bdnextiva avatar bdnextiva commented on July 18, 2024

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.

bdnextiva avatar bdnextiva commented on July 18, 2024

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.

martyuiop avatar martyuiop commented on July 18, 2024

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.

mattmaddux avatar mattmaddux commented on July 18, 2024

That's great. If you open a PR with those changes I will merge it.

from faswiftui.

martyuiop avatar martyuiop commented on July 18, 2024

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.

mattmaddux avatar mattmaddux commented on July 18, 2024

Thank you! And no rush, because as you can see I'm certainly taking my sweet time with any changes and additions.

from faswiftui.

martyuiop avatar martyuiop commented on July 18, 2024

from faswiftui.

mattmaddux avatar mattmaddux commented on July 18, 2024

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.

mattmaddux avatar mattmaddux commented on July 18, 2024

Merged PR #18 to add support for FA 6.

from faswiftui.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.