字體隨機(jī),顏色隨機(jī)

字體顏色—隨機(jī)

其中的字體家族名和字體名可以通過以下方法獲取:

NSLog(@"familyNames:%@",[UIFont familyNames]);

/*

UIFontDescriptorFamilyAttribute:設(shè)置字體家族名

UIFontDescriptorNameAttribute ?:設(shè)置字體的字體名

UIFontDescriptorSizeAttribute ?:設(shè)置字體尺寸

UIFontDescriptorMatrixAttribute:設(shè)置字體形變

*/

UIFontDescriptor *attributeFontDescriptor = [UIFontDescriptor fontDescriptorWithFontAttributes:

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? @{UIFontDescriptorFamilyAttribute: @"Marion",

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? UIFontDescriptorNameAttribute:@"Marion-Regular",

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? UIFontDescriptorSizeAttribute: @40.0,

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? UIFontDescriptorMatrixAttribute:[NSValue valueWithCGAffineTransform:CGAffineTransformMakeRotation(M_1_PI*1.5)

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?]}];

fnotLabel.font = [UIFont fontWithDescriptor:attributeFontDescriptor size:0.0];

隨機(jī)顏色:

[UIColor colorWithRed:(random()%255)/255.0 green:(random()%255)/255.0 blue:(random()%255)/255.0 alpha:1.0];

好看的字體推薦:

fontWithName:@"Arial-BoldItalicMT"

fontWithName:@"HelveticaNeue-Bold"

fontWithName:@"Courier-BoldOblique"

familyNames:(

? ?Copperplate,

? ?"Heiti SC",

? ?"Iowan Old Style",

? ?"Kohinoor Telugu",

? ?Thonburi,

? ?"Heiti TC",

? ?"Courier New",

? ?"Gill Sans",

? ?"Apple SD Gothic Neo",

? ?"Marker Felt",

? ?"Avenir Next Condensed",

? ?"Tamil Sangam MN",

? ?"Helvetica Neue",

? ?"Gurmukhi MN",

? ?"Times New Roman",

? ?Georgia,

? ?"Apple Color Emoji",

? ?"Arial Rounded MT Bold",

? ?Kailasa,

? ?"Kohinoor Devanagari",

? ?"Kohinoor Bangla",

? ?"Chalkboard SE",

? ?"Sinhala Sangam MN",

? ?"PingFang TC",

? ?"Gujarati Sangam MN",

? ?Damascus,

? ?Noteworthy,

? ?"Geeza Pro",

? ?Avenir,

? ?"Academy Engraved LET",

? ?Mishafi,

? ?Futura,

? ?Farah,

? ?"Kannada Sangam MN",

? ?"Arial Hebrew",

? ?Arial,

? ?"Party LET",

? ?Chalkduster,

? ?"Hoefler Text",

? ?Optima,

? ?Palatino,

? ?"Lao Sangam MN",

? ?"Malayalam Sangam MN",

? ?"Al Nile",

? ?"Bradley Hand",

? ?"PingFang HK",

? ?"Trebuchet MS",

? ?Helvetica,

? ?Courier,

? ?Cochin,

? ?"Hiragino Mincho ProN",

? ?"Devanagari Sangam MN",

? ?"Oriya Sangam MN",

? ?"Snell Roundhand",

? ?"Zapf Dingbats",

? ?"Bodoni 72",

? ?Verdana,

? ?"American Typewriter",

? ?"Avenir Next",

? ?Baskerville,

? ?"Khmer Sangam MN",

? ?Didot,

? ?"Savoye LET",

? ?"Bodoni Ornaments",

? ?Symbol,

? ?Menlo,

? ?"Bodoni 72 Smallcaps",

? ?Papyrus,

? ?"Hiragino Sans",

? ?"PingFang SC",

? ?"Euphemia UCAS",

? ?"Telugu Sangam MN",

? ?"Bangla Sangam MN",

? ?Zapfino,

? ?"Bodoni 72 Oldstyle"

)

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • 大家都知道,在不同操作系統(tǒng)、不同游覽器里面默認(rèn)顯示的字體是不一樣的,并且相同字體在不同操作系統(tǒng)里面渲染的效果也不盡...
    陳_宣閱讀 2,070評論 0 7
  • ios開發(fā)中字體的方法有:[label setFont:[UIFont fontWithName:<#(nonnu...
    petter102閱讀 1,069評論 0 0
  • Q: 今天遇到一個需求,需要個特殊的字體,然后就考慮,輸出看看系統(tǒng)所有font的樣式,看有沒有符合的。 A: 我自...
    我叫沒名字啊閱讀 2,036評論 0 0
  • 在家跳操減肥,大汗淋漓很舒服,唯一缺點就是環(huán)境,不敢大踏步,不敢蹦地板。
    高嘉1314閱讀 172評論 0 0
  • 經(jīng)常喊餓的姑娘,大多數(shù)是心地善良單純可愛直率天真。 學(xué)會承受痛苦,有些話,適合爛在心里;學(xué)會選擇忘記,有些傷,適合...
    有趣哥閱讀 2,373評論 0 2

友情鏈接更多精彩內(nèi)容