swift - Systemfont (San Francisco) and UltraLight -


uifont.systemfontofsize(20, weight: uifontweightultralight) 

when i'm using font uifontweightultralight, becomes ultra light when size 20 or bigger. what's reason , there workaround ultra light smaller size?

in fact “system font” missing 3 weights below size 20: ultra light, thin, , black:

font weights @ size 19 , 20

antonio cavedoni discussed in wwdc 2015 session 804: introducing new system fonts:

both families have 2 cuts called optical sizes, , text , display, , talk these in second. , of fonts have 6 weights text families , 9 display ones.

and later:

so there 2 distinct font families in sf , sf compact. called display , text, , used @ different point sizes. system automatically switches between 2 don't have adopt them.

and later still:

the system switches between 2 @ 20 points,

there's lots more in talk differences between display , text sizes. you should watch whole thing before decide forcing ultra light @ small sizes idea.

anyway, @ size 20 , above, uses display optical size, has 9 weights. below size 20, uses text optical size, has 6 weights light through heavy.

you can force use of display optical size asking explicitly name. however, name isn't documented , apple didn't intend use it, change name in future, or make font entirely unavailable name in future release. using in real app bad idea , should not it.

let font = uifont(name: ".sfuidisplay-ultralight", size: size) 

result:

display font weights


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -