Textrenderingfix

This pull request fixes text regressions, also included two sample files to test the text rendering. 
this line is moved inside the if block, thats why is the additional indentation