You can simply read bytes from the keyboard device file (/dev/input/keyboard or something like that - I don't have my rpi to hand to check). You need a key-map to convert the keyboard key code to a letter/symbol. As to drawing text, you need to calculate some paths for each glyph you want to render. The freetype library is useful for this. It can load a ttf font file and get outlines for each glyph (you want "decompose_glyph"). You create a VG Path for each outline and (optionally) store it in a VG Font object. Then render the paths as necessary. All in all, rendering text is a complicated task to do well.
This might be useful:
http://mindchunk.blogspot.co.uk/2012/09 ... ry-pi.html
And also:
https://github.com/ajstarks/openvg
And if you're using python:
https://bitbucket.org/bryancole/rpi_vid ... at=default