added open()/close() for each fonts to avoid any errors during tests.
fixed indentation errors.
simplified the code and fixed tests with erroneous results.