adding a USE_CLANG option to cmake

Now cmake -DUSE_CLANG=ON . will generate Makefile with CC=clang
fix warning at compilation
adding functions to manipulate device context stack
fixing device context segfault if font_name not set