509 |
509 |
510 colour = lex.color(istyle) |
510 colour = lex.color(istyle) |
511 style.fore = self.__getPDFRGB(colour) |
511 style.fore = self.__getPDFRGB(colour) |
512 self.pr.style[istyle] = style |
512 self.pr.style[istyle] = style |
513 |
513 |
|
514 # get substyles |
|
515 subs_start, subs_count = self.editor.getSubStyleRange( |
|
516 istyle) |
|
517 for subs_idx in range(subs_count): |
|
518 style = PDFStyle() |
|
519 font = lex.font(subs_start + subs_idx) |
|
520 if font.italic(): |
|
521 style.font |= 2 |
|
522 if font.bold(): |
|
523 style.font |= 1 |
|
524 |
|
525 colour = lex.color(subs_start + subs_idx) |
|
526 style.fore = self.__getPDFRGB(colour) |
|
527 # styleAt returns negative numbers for substyles |
|
528 self.pr.style[subs_idx - subs_start] = style |
|
529 |
514 # grab font size from default style |
530 # grab font size from default style |
515 if istyle == QsciScintilla.STYLE_DEFAULT: |
531 if istyle == QsciScintilla.STYLE_DEFAULT: |
516 fontSize = QFontInfo(font).pointSize() |
532 fontSize = QFontInfo(font).pointSize() |
517 if fontSize > 0: |
533 if fontSize > 0: |
518 self.pr.fontSize += fontSize |
534 self.pr.fontSize += fontSize |
519 else: |
535 else: |
520 self.pr.fontSize = PDF_FONTSIZE_DEFAULT |
536 self.pr.fontSize = PDF_FONTSIZE_DEFAULT |
521 |
537 |
522 istyle += 1 |
538 istyle += 1 |
523 else: |
539 else: |
524 style = PDFStyle() |
540 style = PDFStyle() |
525 |
541 |
526 font = Preferences.getEditorOtherFonts("DefaultFont") |
542 font = Preferences.getEditorOtherFonts("DefaultFont") |