From f7e0c6719afa734af57ff3fae6bcf176833ce436 Mon Sep 17 00:00:00 2001 From: Behnam Esfahbod Date: Tue, 3 Sep 2013 21:56:30 -0700 Subject: [PATCH] Show the length of tables in bytes, like `ttx -l' But not formatting the numbers, as we don't have any locale set --- Lib/fontTools/fontView.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Lib/fontTools/fontView.py b/Lib/fontTools/fontView.py index ffe69ce28..9d0a9bc08 100644 --- a/Lib/fontTools/fontView.py +++ b/Lib/fontTools/fontView.py @@ -21,6 +21,7 @@ import pygtk pygtk.require('2.0') import gtk import sys +import array from . import misc, ttLib, cffLib @@ -113,6 +114,8 @@ class Row(object): del value.offsets self._value_str = value.__class__.__name__ + if isinstance(value, ttLib.tables.DefaultTable.DefaultTable): + self._value_str += ' (%d Bytes)' % self._font.reader.tables[key].length self._items = sorted(value.__dict__.items()) self._filter_items()