Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/109.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在ios的UITEXTVEW中显示Telugu字体?_Ios_Iphone_Objective C_Xcode - Fatal编程技术网

如何在ios的UITEXTVEW中显示Telugu字体?

如何在ios的UITEXTVEW中显示Telugu字体?,ios,iphone,objective-c,xcode,Ios,Iphone,Objective C,Xcode,在UITextView中是否可以设置字体名称。我想在UITextView中显示Telugu字体。这是Telugu字体系列名称“TeluguSangamMN Bold”。我在UITextView中声明Telugu字体系列。但它不适用于我。请帮助我任何人 这是我的密码 -(void)connectionDidFinishLoading:(NSURLConnection *)connection { [UIApplication sharedApplication].networkActivity

UITextView
中是否可以设置字体名称。我想在
UITextView
中显示Telugu字体。这是Telugu字体系列名称“TeluguSangamMN Bold”。我在
UITextView
中声明Telugu字体系列。但它不适用于我。请帮助我任何人

这是我的密码

-(void)connectionDidFinishLoading:(NSURLConnection *)connection

{

[UIApplication sharedApplication].networkActivityIndicatorVisible=NO;

if(connection==urlConnection)

{

NSString *strResponse=[[NSString alloc]initWithData:responseData encoding:NSUTF8StringEncoding];

NSLog(@"String Response is : %@",strResponse);

NSRange r;

NSString * cleanString = [NSMutableString stringWithString:strResponse];

while ((r = [cleanString rangeOfString:@"<[^>]+>" options:NSRegularExpressionSearch]).location != NSNotFound)

cleanString = [cleanString stringByReplacingCharactersInRange:r withString:@"\n"];

text1.text=cleanString;

}

}

-(void)viewDidLoad

{

text1=[[UITextView alloc]initWithFrame:CGRectMake(10, 300, 300, 80)];

text1.font=[UIFont fontWithName:@"TeluguSangamMN-Bold" size:12];

text1.font=[UIFont boldSystemFontOfSize:12];

text1.backgroundColor=[UIColor whiteColor];

text1.editable=NO;

[self.view addSubview:text1];

}
-(void)连接dFinishLoading:(NSURLConnection*)连接
{
[UIApplication sharedApplication].networkActivityIndicatorVisible=否;
如果(连接==urlConnection)
{
NSString*strResponse=[[NSString alloc]initWithData:responseData编码:NSUTF8StringEncoding];
NSLog(@“字符串响应为:%@”,strResponse);
NSRange;
NSString*cleanString=[NSMutableString stringWithString:strResponse];
while((r=[cleanString rangeOfString:@“]+>”选项:NSRegularExpressionSearch])。位置!=NSNotFound)
cleanString=[cleanString StringByReplacingCharactersRange:r with string:@“\n”];
text1.text=cleanString;
}
}
-(无效)viewDidLoad
{
text1=[[UITextView alloc]initWithFrame:CGRectMake(10303000,80)];
text1.font=[UIFont fontWithName:@“Telugusangamn粗体”大小:12];
text1.font=[UIFont boldSystemFontOfSize:12];
text1.backgroundColor=[UIColor-whiteColor];
text1.可编辑=否;
[self.view addSubview:text1];
}

检查是否在plist中添加了扩展名为.dfont ot.ttf的字体文件

  • 您是否将自定义字体文件添加到INFO.PLIST
  • 此外,文件名与字体系列名称不同,请尝试循环到
    [UIFont familyNames]
    并检查是否列出了您的字体系列名称
  • 尝试在
    text1中使用相同的姓氏。font=[UIFont fontWithName:@“telugusangamn Bold”大小:12]

  • 首先下载你的相关字体

    将自定义字体添加到项目中,即将字体文件(Berlin Sans FB.TTF)拖动到XCode项目中

    使用“应用程序提供的字体”键添加新条目

    现在在文本视图中使用此字体

    txtview.font = [UIFont fontWithName:@"Berlin Sans FB" size:15];
    
    我用的是柏林字体,你用的是teleugu字体


    有关详细信息,请检查您尝试使用的字体是否包含在iOS 7.0中

    您可以查看已安装的字体列表 在nib文件的
    字体下也会显示它


    请告诉我我对此一无所知检查此链接-->您可以使用新字体文件添加新项目删除行text1.font=[UIFont boldSystemFontOfSize:12];它不是必需的。请检查此链接--->可能重复的