--- a/eric6/QScintilla/Exporters/ExporterPDF.py Sun Jan 03 18:02:19 2021 +0100 +++ b/eric6/QScintilla/Exporters/ExporterPDF.py Sun Jan 03 22:24:05 2021 +0100 @@ -511,6 +511,22 @@ style.fore = self.__getPDFRGB(colour) self.pr.style[istyle] = style + # get substyles + subs_start, subs_count = self.editor.getSubStyleRange( + istyle) + for subs_idx in range(subs_count): + style = PDFStyle() + font = lex.font(subs_start + subs_idx) + if font.italic(): + style.font |= 2 + if font.bold(): + style.font |= 1 + + colour = lex.color(subs_start + subs_idx) + style.fore = self.__getPDFRGB(colour) + # styleAt returns negative numbers for substyles + self.pr.style[subs_idx - subs_start] = style + # grab font size from default style if istyle == QsciScintilla.STYLE_DEFAULT: fontSize = QFontInfo(font).pointSize() @@ -518,7 +534,7 @@ self.pr.fontSize += fontSize else: self.pr.fontSize = PDF_FONTSIZE_DEFAULT - + istyle += 1 else: style = PDFStyle()