Example code for creating & using Custom Typeface?

I guess I was looking at a dated thread. The info on the Modern custom font guide? thread was able to point me in the right direction. Or at lest, a simpler solution.