diff -r da7e4df94076 -r bd743eacfbca eric6/HexEdit/HexEditWidget.py --- a/eric6/HexEdit/HexEditWidget.py Wed Jan 08 18:57:10 2020 +0100 +++ b/eric6/HexEdit/HexEditWidget.py Wed Jan 08 18:58:31 2020 +0100 @@ -612,7 +612,10 @@ @type QFont """ super(HexEditWidget, self).setFont(font) - self.__pxCharWidth = self.fontMetrics().width("2") + try: + self.__pxCharWidth = self.fontMetrics().horizontalAdvance("2") + except AttributeError: + self.__pxCharWidth = self.fontMetrics().width("2") self.__pxCharHeight = self.fontMetrics().height() self.__pxGapAdr = self.__pxCharWidth // 2 self.__pxGapAdrHex = self.__pxCharWidth