def decode_font_metrics(self, font_metrics): from nion.ui import UserInterface return UserInterface.FontMetrics(width=font_metrics[0], height=font_metrics[1], ascent=font_metrics[2], descent=font_metrics[3], leading=font_metrics[4])
def test_get_font_metrics_sanity_check(self) -> None: # Test that TestUI.UserInterface.get_font_metrics returns a reasonable size # This test will need to be updated if 'make_font_metrics_for_tests' is modified self.assertEqual( self.ui.get_font_metrics("ignored", "This is a string"), UserInterfaceModule.FontMetrics(77, 13, 11, 2, 0))