uifont

Getting the “Large Text” font size from Settings/Accessibility?

故事扮演 提交于 2019-12-24 00:15:44
问题 The Settings/Accessibility "Large Text" setting sets the text size in some built-in Apps. How can I get hold of this setting to be used in my own App? I can create a private setting in my App of course, but I'd rather use the global setting. I was expecting [UIFont systemFontSize] to adjust the size, but it always returns 14 regardless of the setting in Accessibility. 回答1: As far as I know this is not possible. I opened rdar://10660048 just in case, hopefully something similar will be

iOS Font loading problem

Deadly 提交于 2019-12-23 04:45:52
问题 Helle every one ! I have added din.otf font in my iOS project. Then in my plist I have : Now when I want to use it I juste have to write this line : lalel.font = [UIFont fontWithName:@"din" size:12.f]; Am I right ? It doen't work at all ... Thanks ! 回答1: Try to list all fonts that are available on your device after importing by adding this piece of code : (taken from : http://ajnaware.wordpress.com/2008/10/24/list-of-fonts-available-on-the-iphone/) Legacy Answer // List all fonts on iPhone

UILabel Dynamic Font size keep breaking

被刻印的时光 ゝ 提交于 2019-12-22 16:40:12
问题 I Have CollectionViewCell that has only UILabel(Same bounds as cell). I'm fetching array of fontNames as the CollectionView DataSource : func printFonts() { let fontFamilyNames = UIFont.familyNames() for familyName in fontFamilyNames { let names = UIFont.fontNamesForFamilyName(familyName as! String) fontNames.append(familyName as! String) } } I'm trying to display this font names in one line inside the UILabel , it works in some of the cases but in some not, and i have not idea why. this is

Adding multiple fonts to UIAppFonts overrides each other

痴心易碎 提交于 2019-12-22 05:25:15
问题 I'm trying to add some custom fonts to an iPhone app through UIAppFonts in Info.plist . I can reach both fontnames by code, i.e. MyFont-Bold and MyFont-Medium . My problem is that the last font in UIAppFonts array overrides the other one, making both MyFont-Bold and MyFont-Medium render out MyFont-Bold if this is the last entry in the plist array. By dragging MyFont-Bold as the first entry makes both font-names render MyFont-Medium. The property list excerpt: UIAppFonts item 0 MyFont-Medium

How to set font name of UILabel as HelveticaNeue Thin in iOS?

北战南征 提交于 2019-12-22 02:51:51
问题 I am creating UILabel, for the label i can set the font name as HelveticaNeue Regular, Light, UltraLight etc, But i unable to set the font name as HelveticaNeue Thin, it is not working as expected. I did like, label.font = [UIFont fontWithName:@"HelveticaNeue-Thin" size:16]; Also i have searched on Google didnt got any solution. How to fix this issue? Thanks. 回答1: This font is bundled with iOS 7, so if you're targeting iOS 7 and above your label.font = [UIFont fontWithName:@"HelveticaNeue

Change the default systemFont used by controls

浪子不回头ぞ 提交于 2019-12-21 23:29:16
问题 I have a big App and need to change the Font but I don't want to touch every Label, Textfield and so on. How can I access the "systemFont" used in IB and in [UIFont systemFontOfSize:x] ? I already tryed this one: iOS 5: Curious about UIAppearance but that's not the solution, cause I have different FontSizes and Bold/Regular all over my App and I can't set it overall. Can I set it via UIApplication or somewhere in InfoPlist? 回答1: You can create Category for UILabel, UITextField and UIButton

Can I close file descriptors for currently unused UIAppFonts?

强颜欢笑 提交于 2019-12-21 20:05:19
问题 We bundle a lot of fonts with our iOS app, and we put them all in UIAppFonts for faster loading. (We're using them inside UIWebView and it's much faster than using loading files with @font-face ). However this lead me to occasionally get this kind of warning: Mar 13 23:07:16 iPad afcd[2582] <Error>: Max open files: 78 Mar 13 23:07:17 iPad mobile_house_arrest[2584] <Error>: Max open files: 78 Mar 13 23:07:17 iPad mobile_house_arrest[2586] <Error>: Max open files: 78 Mar 13 23:07:17 iPad mobile

Auto change the font size to fit the button in swift

試著忘記壹切 提交于 2019-12-21 08:18:58
问题 I have tried this but it didn't work, the text is out of the button boundaries. button.titleLabel!.adjustsFontSizeToFitWidth = true button.titleLabel!.numberOfLines = 0 button.titleLabel!.minimumScaleFactor = 0.1 When I try the following, all the text fits, but the text remains in a small font: button.titleLabel!.font = UIFont(name: "Heiti TC", size: 9) How can I get the font to automatically fit the size of the button? func nextQuestion() { let currentQuestion = mcArray![questionIdx] answers

Displaying proportionally spaced numbers (instead of monospace / tabular) on iOS

纵然是瞬间 提交于 2019-12-21 04:32:13
问题 I am rendering numbers in iOS (targeting 7 and up) by storing them in an NSAttributedString and rendering with "drawAtPoint:". I am using Helvetica Neue. I have noticed that digits of numbers drawn like this are not proportional – the glyphs all have the same width. Even a skinny "1" takes up the same space as a "0". A test confirms this: for(NSInteger i=0; i<10; ++i) { NSString *iString = [NSString stringWithFormat: @"%d", i]; const CGSize iSize = [iString sizeWithAttributes: [self

UITextView font is nil

丶灬走出姿态 提交于 2019-12-21 03:10:53
问题 I created a UITextView with a font size of 14 in a storyboard and hooked it up to the detailDescriptionLabel property of my ViewController. This code is in viewDidLoad: self.detailDescriptionLabel.font=[UIFont systemFontOfSize:10]; NSLog(@"text is %@; font is %@", self.detailDescriptionLabel.text, self.detailDescriptionLabel.font); The console output follows: text is Lorem Ipsum; font is (null) Why is the font set to nil? The setFont: is working; the font does shrink. I want to get the font