uifont

Get path to trace out a character in an iOS UIFont

只愿长相守 提交于 2019-12-17 08:59:10
问题 Suppose I have a custom font "Foo" that I'm using in my iOS App. I've added it to my project, plist, etc. and I'm able to render UILabel s and such with it just fine. Now, if I want to find out a sequence of points that would "trace out" the letter 'P' in that font, how would I get that sequence of points? For example, suppose I wanted to use a CGPath to draw the letter 'P' slowly like a plotter would ... I just need a sequence of CGPoints in an array that if drawn as a path would draw a 'P'.

How do I set bold and italic on UILabel of iPhone/iPad?

自闭症网瘾萝莉.ら 提交于 2019-12-17 04:16:30
问题 How do I set bold and italic on UILabel of iPhone/iPad? I searched the forum but nothing helped me. Could anyone help me? 回答1: sectionLabel.font = [UIFont fontWithName:@"TrebuchetMS-Bold" size:18]; There is a list of font names that you can set in place of 'fontWithName' attribute.The link is here 回答2: Don't try to play with the font names. Using the font descriptor you need no names: UILabel * label = [[UILabel alloc] init]; // use your label object instead of this UIFontDescriptor * fontD =

Can I free use tahoma font in iPhone app development?

孤街醉人 提交于 2019-12-14 02:24:54
问题 Can I free use tahoma font in app development? 回答1: Tahoma is not one of the fonts included on the iPhone or iPad (see here for a list). There are ways to bundle a font with your app, but you'd have to have an appropriate license to do so. As a workaround, it may be allowed to include pre-rendered graphic files with your app that use Tahoma. (per your previous question: Tahoma may show up in the font picker in Interface Builder, but that's just the standard system-wide font picker, and all it

uifont 'Impact' not working for iOS

爱⌒轻易说出口 提交于 2019-12-14 02:02:12
问题 I'm trying to use Impact.ttf. It is in built in OSX, but can't see it in custom fonts on xcode. So I included it in my project as shown in screens and used UIFont *font1 = [UIFont fontWithName:@"Impact.ttf" size:50]; NSLog(@"%@",font1); self.labelTop.font = font1; The Log is showing null value in font1. Plz help. How to include the font. 回答1: Check Target membership of the font(.ttf) files. 回答2: First of all Add font .ttf file to Project then follow step Step 1 : Click on ProjectName in

iOS 7 custom fonts alignment

烂漫一生 提交于 2019-12-13 14:47:03
问题 I've used a custom TTF font (Gotham) when implementing the layout of an app on iOS 6. I've noticed its baseline was always a bit higher than regular fonts, but just nudged things around to fit. Now that I've updated to the iOS 7 SDK, the font placement is closer to that of regular fonts when running on iOS 7 devices, but still looks nudged on iOS 6 devices. So it looks like Apple fixed what caused that vertical shifting on the baseline when interpreting the font metrics for iOS 7, but left

Set own custom colors and fonts in UIColor

╄→гoц情女王★ 提交于 2019-12-13 08:59:00
问题 I am new to ios, Just need to clear two doubts: 1.I am aware that to set custom colors we use following method: [UIColor colorWithRed: 127 green:127 blue:127 alpha:1] How do I find out from an Image what parameters for RGB are?(Its not an xcode question but I need to know). 2.How to add my own custom fonts in my project. I have added the file name in "fonts provided by application". But I am still not able to get the result in desired font. The file name is ExpertSans-ExtraBold.ttf .following

stringbyappendingstring different size and font types

泄露秘密 提交于 2019-12-13 03:43:19
问题 I have a NSString that is a letter and another that is their signature. I need to combine both into a single string for display but the signature needs to display in a different font and size. Yes, both fonts and sizes are working on their own. Right now I have it as follows: NSString *letter; NSString *signOff; _paragraph.font = [UIFont fontWithName:@"BeinetCondensed" size:14]; _signature.font = [UIFont fontWithName:@"AnnoyingKettle" size:18]; letter = [_paragraph text]; signOff = [

Different UIFont sizes for different iOS devices in Swift

主宰稳场 提交于 2019-12-12 18:57:43
问题 I'm developing swift based iOS application for iPhone family. My application supports all devices start from iPhone 4s to iPhone X. Labels appears bigger in smaller devices like iPhone 4s as I added bigger font size for high end devices. Can someone help me on how to scale the font according to device. I tried size classes with compact/regular width and compact/regular height but none of them helped me. Your help is very much appreciated 回答1: You can try label hight according to view in

iOS CoreText get list of registered fonts via CTFontManagerRegisterGraphicsFont

£可爱£侵袭症+ 提交于 2019-12-12 15:37:15
问题 I am registering fonts dynamically via the following: - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation{ if ([url isFileURL]) { // Handle file being passed in NSLog(@"handleOpenURL: %@",url.absoluteString); NSData *inData = [NSData dataWithContentsOfURL:url]; CFErrorRef error; CGDataProviderRef provider = CGDataProviderCreateWithCFData((CFDataRef)inData); CGFontRef fontRef =

Change just Font of AttributedText in Swift

两盒软妹~` 提交于 2019-12-12 15:18:20
问题 I have a number of UILabels created in IB which all have attributed text. Each label's text contains multiple lines of different font sizes and colors. At run-time, I want to be able to change just the font name of these labels without changing the existing font sizes or colors. I have researched and could not find a straight forward method to achieve this. Any ideas? 回答1: You first need to understand the lingo Apple uses to describe a typeface: Helvetica is a family Helvetica Bold ,