Moved the CoreText function code to correct place