Fix memory leak by doing different initialization of fontengine