From db1e578cd80bdda0f89a11addf64bd748fd55057 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 15 Jan 2020 18:48:38 +0100 Subject: [PATCH] fixed cases when value of tablefield does not need to ellide or word wrap --- pype/scripts/slate/base.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pype/scripts/slate/base.py b/pype/scripts/slate/base.py index bd090b2556..cb72d9af1c 100644 --- a/pype/scripts/slate/base.py +++ b/pype/scripts/slate/base.py @@ -853,6 +853,18 @@ class TableField(BaseItem): ellide = self.style.get("ellide") max_lines = self.style.get("max-lines") + font_family = self.style["font-family"] + font_size = self.style["font-size"] + font_bold = self.style.get("font-bold", False) + font_italic = self.style.get("font-italic", False) + + font = FontFactory.get_font( + font_family, font_size, font_italic, font_bold + ) + val_width = font.getsize(value)[0] + if val_width <= max_width: + return value + if not ellide and not word_wrap: # TODO logging print((