bugfix: set toc/bookmark window dimension smaller than screen size
Otherwise if text widgets in toc window expands out of screen, memory
free on these widgets will mess up the heap. It sounds ridiculous but
after we restrict toc window well inside the screen the bug in #815
is fixed.
add standalone glyph cache
I found it will be especially helpful to cache glyph separately
so that glyph caches won't be washed out by a single page cache.
Merge pull request #9 from chrox/catch_up_legacy

cherry picks from the new_ui_code branch of legacy repo