gpt4 book ai didi

ios - UI系统字体之间的区别

转载 作者:行者123 更新时间:2023-11-28 22:37:10 26 4
gpt4 key购买 nike

我是学习 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 的描述方法中定义,因为它们只被使用在打印字符串数组时。感谢 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 - UI系统字体之间的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15603985/

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