Font styles on 10.10.5

I made a small text editor for Mac OSX that has a TextArea control as the main text editing area. I have restricted the use of fonts to Avenir Next as this family has a nice appearence and a good range of styles.

The problem I am having is that I cannot get the TextArea control to display any of the style variations, it just seems to display the standard style.

On the Mac Developer site it suggests calling fonts by full name and not using the old style switches (Italic, Bold, Underline). However if I use these switches I will get some extra styles.

Is there a way of displaying all styles of text in TextArea control?

Use the exact name Font Book shows on top of the right pane.

For instance :

me.TextFont = "Gill Sans Light Italic"

In Carbon, switches try to synthesize non existing styles when the corresponding font is not present, which may explain why you find more styles. Cocoa does not do that and sticks to the fonts actually installed in the system.

look at this Post