gpt4 book ai didi

iphone - 为 UILabel 设置一些不同字体的问题

转载 作者:技术小花猫 更新时间:2023-10-29 10:40:36 28 4
gpt4 key购买 nike

我想将字体大小和姓氏设置为 titleLabel。//Helvetica Neue UltraLight

 [titleLabel setFont:[UIFont fontWithName:@"Helvetica Neue UltraLight" size:25.0f]];

这是行不通的。

请告诉我哪里出了问题?

任何帮助将不胜感激?

最佳答案

正确的字体名称是@"HelveticaNeue-UltraLight"

使用类似这样的东西来获得格式良好的可用字体名称列表:

NSMutableString *str = [NSMutableString stringWithCapacity:1000];
for (NSString *familyName in [UIFont familyNames]) {
[str appendFormat:@"%@\n", familyName];
for (NSString *fontName in [UIFont fontNamesForFamilyName:familyName]) {
[str appendFormat:@" %@\n", fontName];
}
[str appendString:@"\n"];
}
NSLog(@"%@", str);

这是 iOS5.1 的当前列表:

Thonburi
Thonburi-Bold
Thonburi

Snell Roundhand
SnellRoundhand-Bold
SnellRoundhand-Black
SnellRoundhand

Academy Engraved LET
AcademyEngravedLetPlain

Marker Felt
MarkerFelt-Wide
MarkerFelt-Thin

Geeza Pro
GeezaPro-Bold
GeezaPro

Arial Rounded MT Bold
ArialRoundedMTBold

Trebuchet MS
TrebuchetMS
TrebuchetMS-Bold
TrebuchetMS-Italic
Trebuchet-BoldItalic

Arial
Arial-BoldMT
ArialMT
Arial-ItalicMT
Arial-BoldItalicMT

Marion
Marion-Regular
Marion-Bold
Marion-Italic

Gurmukhi MN
GurmukhiMN
GurmukhiMN-Bold

Malayalam Sangam MN
MalayalamSangamMN-Bold
MalayalamSangamMN

Bradley Hand
BradleyHandITCTT-Bold

Kannada Sangam MN
KannadaSangamMN
KannadaSangamMN-Bold

Bodoni 72 Oldstyle
BodoniSvtyTwoOSITCTT-Book
BodoniSvtyTwoOSITCTT-Bold
BodoniSvtyTwoOSITCTT-BookIt

Cochin
Cochin
Cochin-BoldItalic
Cochin-Italic
Cochin-Bold

Sinhala Sangam MN
SinhalaSangamMN
SinhalaSangamMN-Bold

Hiragino Kaku Gothic ProN
HiraKakuProN-W6
HiraKakuProN-W3

Papyrus
Papyrus-Condensed
Papyrus

Verdana
Verdana
Verdana-Bold
Verdana-BoldItalic
Verdana-Italic

Zapf Dingbats
ZapfDingbatsITC

Courier
Courier-Bold
Courier
Courier-BoldOblique
Courier-Oblique

Hoefler Text
HoeflerText-Black
HoeflerText-Italic
HoeflerText-Regular
HoeflerText-BlackItalic

Euphemia UCAS
EuphemiaUCAS-Bold
EuphemiaUCAS
EuphemiaUCAS-Italic

Helvetica
Helvetica-LightOblique
Helvetica
Helvetica-Oblique
Helvetica-BoldOblique
Helvetica-Bold
Helvetica-Light

Hiragino Mincho ProN
HiraMinProN-W3
HiraMinProN-W6

Bodoni Ornaments
BodoniOrnamentsITCTT

Apple Color Emoji
AppleColorEmoji

Optima
Optima-ExtraBlack
Optima-Italic
Optima-Regular
Optima-BoldItalic
Optima-Bold

Gujarati Sangam MN
GujaratiSangamMN
GujaratiSangamMN-Bold

Devanagari Sangam MN
DevanagariSangamMN
DevanagariSangamMN-Bold

Times New Roman
TimesNewRomanPS-ItalicMT
TimesNewRomanPS-BoldMT
TimesNewRomanPSMT
TimesNewRomanPS-BoldItalicMT

Kailasa
Kailasa
Kailasa-Bold

Telugu Sangam MN
TeluguSangamMN-Bold
TeluguSangamMN

Heiti SC
STHeitiSC-Medium
STHeitiSC-Light

Apple SD Gothic Neo
AppleSDGothicNeo-Bold
AppleSDGothicNeo-Medium

Futura
Futura-Medium
Futura-CondensedExtraBold
Futura-CondensedMedium
Futura-MediumItalic

Bodoni 72
BodoniSvtyTwoITCTT-BookIta
BodoniSvtyTwoITCTT-Book
BodoniSvtyTwoITCTT-Bold

Baskerville
Baskerville-SemiBoldItalic
Baskerville-Bold
Baskerville-Italic
Baskerville-BoldItalic
Baskerville-SemiBold
Baskerville

Chalkboard SE
ChalkboardSE-Regular
ChalkboardSE-Bold
ChalkboardSE-Light

Heiti TC
STHeitiTC-Medium
STHeitiTC-Light

Copperplate
Copperplate
Copperplate-Light
Copperplate-Bold

Party LET
PartyLetPlain

American Typewriter
AmericanTypewriter-CondensedLight
AmericanTypewriter-Light
AmericanTypewriter-Bold
AmericanTypewriter
AmericanTypewriter-CondensedBold
AmericanTypewriter-Condensed

Bangla Sangam MN
BanglaSangamMN-Bold
BanglaSangamMN

Noteworthy
Noteworthy-Light
Noteworthy-Bold

Zapfino
Zapfino

Tamil Sangam MN
TamilSangamMN
TamilSangamMN-Bold

DB LCD Temp
DBLCDTempBlack

Arial Hebrew
ArialHebrew
ArialHebrew-Bold

Chalkduster
Chalkduster

Georgia
Georgia-Italic
Georgia-BoldItalic
Georgia-Bold
Georgia

Helvetica Neue
HelveticaNeue-Bold
HelveticaNeue-CondensedBlack
HelveticaNeue-Medium
HelveticaNeue
HelveticaNeue-Light
HelveticaNeue-CondensedBold
HelveticaNeue-LightItalic
HelveticaNeue-UltraLightItalic
HelveticaNeue-UltraLight
HelveticaNeue-BoldItalic
HelveticaNeue-Italic

Gill Sans
GillSans-LightItalic
GillSans-BoldItalic
GillSans-Italic
GillSans
GillSans-Bold
GillSans-Light

Palatino
Palatino-Roman
Palatino-Bold
Palatino-BoldItalic
Palatino-Italic

Courier New
CourierNewPSMT
CourierNewPS-BoldMT
CourierNewPS-BoldItalicMT
CourierNewPS-ItalicMT

Oriya Sangam MN
OriyaSangamMN-Bold
OriyaSangamMN

Didot
Didot-Italic
Didot
Didot-Bold

Bodoni 72 Smallcaps
BodoniSvtyTwoSCITCTT-Book

关于iphone - 为 UILabel 设置一些不同字体的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9907100/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com