MatthewYork / MYBlurIntroductionView

A super-charged version of MYIntroductionView for building custom app introductions and tutorials.
MIT License
1.53k stars 195 forks source link

Using custom fonts doesn't work #40

Closed orenk86 closed 8 years ago

orenk86 commented 8 years ago

Here's my code:

let pane1:MYIntroductionPanel = MYIntroductionPanel.init(
            frame: CGRectMake(0, 0, self.pagerContainer.frame.size.width, self.pagerContainer.frame.size.height),
            title: "Bla bla bla",
            description: "Bli Bla Bloo")
        panel1.PanelSeparatorLine.backgroundColor = UIColor.clearColor()
        panel1.PanelTitleLabel.font = UIFont(name: "MyCustomFont", size: 21)

//init more panels....

self.panels = [panel1, panel2, panel3, panel4, panel5, panel6]
        self.introductionView = MYBlurIntroductionView.init(frame: CGRectMake(0, 0, self.pagerContainer.frame.size.width, self.pagerContainer.frame.size.height))
        self.introductionView?.delegate = self
        self.introductionView?.RightSkipButton.hidden = true
        self.introductionView?.BackgroundImageView.image = nil
        self.introductionView?.backgroundColor = UIColor.clearColor()

        self.introductionView?.buildIntroductionWithPanels(self.panels)

        pagerContainer.addSubview(introductionView!)

The font in the panels seems wrong (both font and size)... Is there any way to do this correctly? Same question for both the titles and the descriptions....

Thanks!!

orenk86 commented 8 years ago

My bad, turns out I had a typo in the font names...

I found the correct name by doing:

class func printFonts() {
    for familyName in UIFont.familyNames() {
        print("\n-- \(familyName) \n")
        for fontName in UIFont.fontNamesForFamilyName(familyName) {
            print(fontName)
        }
    }
}

Closing...