UIsystemfonts之间的区别

UIsystemfonts之间的区别

我是新手,学习obj-c。当我输入以下行时

NSLog(@"System fonts are %@", [UIFont familyNames])


我得到以下输出。

Thonburi,
"Snell Roundhand",
"Academy Engraved LET",
Avenir,
"Marker Felt",
"Geeza Pro",
"Arial Rounded MT Bold",
"Trebuchet MS",
Arial,
Marion,
"Gurmukhi MN",
"Malayalam Sangam MN",
"Bradley Hand",
"Kannada Sangam MN",
"Bodoni 72 Oldstyle",
Cochin,
"Sinhala Sangam MN",
"Hiragino Kaku Gothic ProN",
Papyrus,
Verdana,
"Zapf Dingbats",
"Avenir Next Condensed",
Courier,
"Hoefler Text",
Helvetica,
"Euphemia UCAS",
"Hiragino Mincho ProN",
"Bodoni Ornaments",
"Apple Color Emoji",
Optima,
"Gujarati Sangam MN",
"Devanagari Sangam MN",
"Times New Roman",
Kailasa,
"Telugu Sangam MN",
"Heiti SC",
"Apple SD Gothic Neo",
Futura,
"Bodoni 72",
Baskerville,
"Chalkboard SE",
"Heiti TC",
Copperplate,
"Party LET",
"American Typewriter",
Symbol,
"Avenir Next",
Noteworthy,
"Bangla Sangam MN",
Zapfino,
"Tamil Sangam MN",
Chalkduster,
"Arial Hebrew",
Georgia,
"Helvetica Neue",
"Gill Sans",
Palatino,
"Courier New",
"Oriya Sangam MN",
Didot,
"Bodoni 72 Smallcaps"


我只是想知道为什么字体名称周围有多个单词的引号?

Thonburi vs "Snell Roundhand"

最佳答案

NSLog打印"-引号(如果它是多个单词),只是为了弄清楚字符串的开始和结束位置。应该在NSArray的description方法中定义它,因为它们仅在打印字符串数组时使用。感谢omz指出这一点。

它与字体无关:

NSArray *strings = @[@"Lorem ipsum dolor sit amet", @"gubergren"];
NSLog(@"%@", strings);
NSLog(@"%@", strings[0]);


版画

2013-03-24 22:18:42.922 stringprinting[22876:303] (
    "Lorem ipsum dolor sit amet",
    gubergren
)
2013-03-24 22:18:42.923 stringprinting[22876:303] Lorem ipsum dolor sit amet


如果要打印不带引号的所有名称,则可以分别打印每个名称

[[UIFont familyNames] enumerateObjectsUsingBlock:^(NSString *obj, NSUInteger idx, BOOL *stop) {
    NSLog(@"%@", obj);
}];


结果

Thonburi
Snell Roundhand
Academy Engraved LET
Avenir
Marker Felt
Geeza Pro
Arial Rounded MT Bold
…

关于ios - UIsystemfonts之间的区别,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/15603985/

10-13 04:56