hi i am using custom font xcode 5. its font family name is "Alegre Sans" i follow many tutorials online of using custom font in xcode.
I have include custom font file name "alegre.ttf" in xcode resources folder. also i include this file in project .plist under "Fonts provided by applications". and i am using this fond in viewdidload method of viewcontroller like this
CustomLabel* lblObj = [[CustomLabel alloc]initWithFrame:CGRectMake(121, 30, 0, 0)]; [lblObj setText:@"FREE TRAIL"]; [lblObj sizeToFit]; [lblObj setFont:[UIFont fontWithName:@"Alegre Sans" size:10.0]]; // [headerLabel setFont:[UIFont boldSystemFontOfSize:30.0]]; [lblObj setTextColor:[UIColor whiteColor]]; [lblObj setTextAlignment:NSTextAlignmentCenter]; [self.headerBgVw addSubview:lblObj]; but unable to change font.
I have wasted my whole day on it but not able to change font . is i am doing mistake in programing or including font file
[UIFont fontWithName:@"Alegre-Sans" size:10.0]]fontWithName:size:should be the fully-specified name of the font. This can help enumerate the fonts available to the application by their usable name: stackoverflow.com/questions/8963299/cant-find-custom-font-ios