TUFLOW Viewer Matplotlib Font Error

Revision as of 18:57, 5 March 2025 by Ellis Symons (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This page describes how to fix TUFLOW Viewer if you get the following error (or similar). Unfortunately this is a bug with the plotting library TUFLOW Viewer uses (matplotlib) and is due to an issue with its cached data.

ValueError: Failed to find font DejaVu Sans:style=normal:variant=normal:weight=normal:stretch=normal:size=10.0, and fallback to the default font was disabled

To fix this issue, the matplotlib cache data will need to be deleted. The steps below describe how to do this:

  1. Open QGIS
  2. Open the Python interpreter
  3. In the python interpreter type the following commands:
    import matplotlib
    print(matplotlib.get_cachedir())
    
  4. This will print the matplotlib cache directory
  5. In this directory, delete the fontlist-v330.json file
  6. Try opening TUFLOW Viewer (you should not need to restart QGIS, however if it still doesn't work then restarting QGIS will be worth trying)
  7. If the problem persists, try deleting all the fontlist files in the folder.