uifont

iOS Custom Fonts [duplicate]

筅森魡賤 提交于 2019-12-12 10:55:57
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: Can I embed a custom font in an iPhone application? I am creating a label and I need it to use a custom font, or Tahoma. I installed the custom font on my Mac and in IB, when I edit the UILabel and choose that custom font, the text's font changes but as soon as I hit enter or finish changes, the font goes back to its default font. On the other hand, Tahoma doesn't change at all. I came cross this article that

Why are UIFont and CGFont/CTFont separated completely?

感情迁移 提交于 2019-12-12 10:33:26
问题 I was trying to draw some text with a downloaded font. I looked at API documentation and searched the Web. I found a solution, but the problem is that it's applicable to only the CoreGraphics level framework. So I searched for a way to convert CGFont to UIFont , but there was no way to do this. I realized UIFont and CGFont/CTFont are separated completely, even though they're created from same font file. CGFont and CTFont are convertible from/to each other, but for UIFont , the only way is

Custom font not showing on device, but does on simulator

坚强是说给别人听的谎言 提交于 2019-12-12 10:33:02
问题 I've been playing around with custom fonts in iOS and have got most of it figured out apart from the custom font won't show on any of my devices. I have added the font to the root of the project file. Added it to the info.plist file under the array or "Fonts provided by application" Checked that the case sensitivity of both the original file and what I added to the info.plist file are the same. Used [playMenuBtn.titleLabel setFont:[UIFont fontWithName:@"fontname" size:40]]; to make the font

UIFont possible sizes

China☆狼群 提交于 2019-12-12 05:31:30
问题 I am trying in an iPhone app to set the possibility for the user to choose the fonts. I have already made progress using the UIFont class. Here is my question : When the choice of a Font within a Font Family is made how to I know the possibilities the user has for the size? Is there a way to list them? I did not see anything like that in the UIFont documentation or anywhere I looked on the net. Thanks for any piece of information. 回答1: iOS uses scalable fonts, and you can specify the size in

UIFont: how to animate strikethrough and match font style?

白昼怎懂夜的黑 提交于 2019-12-11 09:43:24
问题 (a) How to animate strikethrough? I tried the following but not working. -(void)strikeThrough { NSNumber *strikeSize = [NSNumber numberWithInt:1]; NSDictionary *strikeThroughAttribute = [NSDictionary dictionaryWithObject:strikeSize forKey:NSStrikethroughStyleAttributeName]; NSAttributedString* strikeThroughText = [[NSAttributedString alloc] initWithString:_label.text attributes:strikeThroughAttribute]; _label.attributedText = nil; [UIView animateWithDuration:2.0 animations:^{ _label

custom font iphone

一笑奈何 提交于 2019-12-11 09:38:28
问题 I am trying to add a custom font in my app, searched the web, there are many posts but i am getting error InfoPlist.strings:0: error: validation failed: The data couldn’t be read because it has been corrupted. i dont get what's the issue, i added a new file of font in my project and added this code in plist, i never used plist before <key>UIAppFonts</key> <array> <string>CloisterBlack.ttf </string> </array> 回答1: I think your font file has been corrupted. Add it again and then try. This link

Bold font with bold weight in iPhone

戏子无情 提交于 2019-12-11 07:03:35
问题 I have a design that uses Helvetica-Bold font with a weight of bold: i'm trying to explain myself: a bold font, which can be set also to bold. But in iOS, trying to make a font bold, over and over again i found as answer to just use the bold font from a given family. And i want to put that font to bold again, to be... "bolder"? Is this possible? 回答1: Perhaps the simplest solution for you, if you're using -drawAtPoint:withFont: is to just call the method twice with the x-position offset by 1

uilabel custom font?

笑着哭i 提交于 2019-12-10 17:04:42
问题 I searched for a way to add my custom font to iphone app and I was successful in some cases. but in my case I want to import "Helvetica Condensed Black" which in the Helvetica family but it is neither mac's native nor iPhone's. when I open the font in the finder I find a file named : "Helv Condensed" with no extension. I went through and added this file to my resources and also to plist. the same way that I did with the other font which had .tff extension and it was a successful attempt. so

Adjoining “f” and “l” characters

二次信任 提交于 2019-12-08 13:14:54
问题 For some reason, when I display the word "Butterfly" (or anything else with an "fl"), the "f" and the "l" connect at the top (see image below). The font is Century Gothic Bold. This is the code I use to setup the UILabel. The string for the label is retrieved from a plist: UILabel *label = [[UILabel alloc] init]; label.text = [self.flashcardDelegate.alphabetArr objectAtIndex:index]; label.textColor = [UIColor colorWithRed:.733 green:0 blue:.03137 alpha:1]; label.backgroundColor = [UIColor

only change font size (and not font name)

旧城冷巷雨未停 提交于 2019-12-08 13:05:45
问题 What I want to do is change the font size. I know below statement will change the font size, but it changes the font name because we are using systemFontOfSize [UIFont systemFontOfSize: 13.0]; I know alternate option is as mentioned below. [myLabel setFont:[UIFont fontWithName:@"Helvetica-Bold" size:13.0]]; but I don't want to use fontWithName as I am setting that in IB. I don't want to play with font name as my app is multi-language and hence I don't want to play with font name. Any idea how