def exportAsText(self): """Return synthetised brush information (Text)""" returned = [] returned.append(f'{self.__name.replace("_", " ")}') returned.append(f'- Blending mode: {self.__blendingMode}') returned.append(f'- Size: {self.__size:0.2f}px') returned.append(f'- Opacity: {100*self.__opacity:0.2f}%') returned.append(f'- Flow: {100*self.__flow:0.2f}%') if stripHtml(self.__comments) != '': returned.append(stripHtml(self.__comments)) return "\n".join(returned)
def exportAsText(self): """Return synthetised brush information (Text)""" returned = [] returned.append(f'{self.__name}') returned.append(stripHtml(self.__comments)) return "\n".join(returned)
def setComments(self, value): """Set current comment for linked layer""" if value != self.__comments: if stripHtml(value).strip() != '': self.__comments = value else: self.__comments = '' self.__updated('comments')
def __getTextInformation(self, brush): """Return text for information""" textDocument=QTextDocument() if self.__csize>0: textDocument.setHtml(brush.information()) else: text=brush.comments() if stripHtml(text)=='': textDocument.setHtml(brush.information(False)) else: textDocument.setHtml(text) cursor=QTextCursor(textDocument) cursor.movePosition(QTextCursor.End, QTextCursor.MoveAnchor) cursor.insertHtml(f"<br><span>{brush.information(False)}</span>") if self.__isCompact: text=textDocument.toHtml() text=re.sub(r"font-size\s*:\s*(\d+)pt;", self.__applyCompactFactor, text) textDocument.setHtml(text) return textDocument
def __getTextDocument(self, linkedLayer): """Return text for information""" textDocument = QTextDocument() if self.__csize > 0: textDocument.setHtml(linkedLayer.name()) else: text = linkedLayer.comments() if stripHtml(text) == '': textDocument.setHtml(linkedLayer.name()) else: textDocument.setHtml(text) cursor = QTextCursor(textDocument) cursor.insertHtml( f"<span><i>[{linkedLayer.name()}]</i></span><br>") if self.__isCompact: text = textDocument.toHtml() text = re.sub(r"font-size\s*:\s*(\d+)pt;", self.__applyCompactFactor, text) textDocument.setHtml(text) return textDocument