Giter Club home page Giter Club logo

Comments (15)

d-theo avatar d-theo commented on September 27, 2024

We have to use corporate fonts for the LiveTagging/SmartTracker SDK. We don't use them for the standard Tracker. In fact we used to have this bug in early development stage and it disappeared until today :/
Do you have an idea of why this bug happens ?

from atinternet-apple-sdk.

mackoj avatar mackoj commented on September 27, 2024

Why are you using corporate font ? They should be lazy loaded as needed.

from atinternet-apple-sdk.

mackoj avatar mackoj commented on September 27, 2024

I'm investigating it today I will keep you up to date.

from atinternet-apple-sdk.

mackoj avatar mackoj commented on September 27, 2024

@d-theo I think it's might be due to race condition on init.

from atinternet-apple-sdk.

d-theo avatar d-theo commented on September 27, 2024

@mackoj I saw a lot of strange hacks related to CGFontCreate like this : http://www.openradar.me/18778790 with ppl end up by calling
_ = UIFont() or other UIFont methods before calling CGFontCreate()

Unfortunately I am having trouble reproducing the bug

from atinternet-apple-sdk.

mackoj avatar mackoj commented on September 27, 2024

Il will try this fix thanks

from atinternet-apple-sdk.

mackoj avatar mackoj commented on September 27, 2024

I have modified ATInternet-Apple-SDK/ATInternetTracker/Sources/Tracker.swift in registerFont with _ = UIFont() at the beginning.

from atinternet-apple-sdk.

d-theo avatar d-theo commented on September 27, 2024

I hope this hack can solve this bug. In addition we will release a fix to load the fonts only if the liveTagging feature is enabled

from atinternet-apple-sdk.

mackoj avatar mackoj commented on September 27, 2024

I think if it continue to crash to just remove this function until you provide a fix.

from atinternet-apple-sdk.

d-theo avatar d-theo commented on September 27, 2024

any update about the issue ?

from atinternet-apple-sdk.

mackoj avatar mackoj commented on September 27, 2024

Please stop using ! everywhere this is why it crash because fontRef was bad and force unwrapped...

    func registerFont(_ font: String) {
      _ = UIFont()
      guard
        let fontPath = Bundle(for: Tracker.self).path(forResource: font, ofType: ".ttf"),
        let dataFont = NSData(contentsOfFile: fontPath),
        let provider = CGDataProvider(data: dataFont)
        else { return }

      let fontRef = CGFont(provider)
      CTFontManagerRegisterGraphicsFont(fontRef, nil)
    }

from atinternet-apple-sdk.

d-theo avatar d-theo commented on September 27, 2024

We will make it right for the next release around next week, and with better lazy-loading ;)

from atinternet-apple-sdk.

mackoj avatar mackoj commented on September 27, 2024

I have to admit that I complain a lot and about a lot of things but it's really great that your SDK is open source because it allow me to made a fix when I need it and it priceless...

from atinternet-apple-sdk.

d-theo avatar d-theo commented on September 27, 2024

no problem, it allows us to improve too ;)
In fact we are always happy to take PR (even if our workflow does not allow to merge them into github)

from atinternet-apple-sdk.

d-theo avatar d-theo commented on September 27, 2024

Closed: patched with your code

from atinternet-apple-sdk.

Related Issues (20)

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.