(self)
| 693 | return pdfname |
| 694 | |
| 695 | def writeFonts(self): |
| 696 | fonts = {} |
| 697 | for dviname, info in sorted(self.dviFontInfo.items()): |
| 698 | Fx = info.pdfname |
| 699 | _log.debug('Embedding Type-1 font %s from dvi.', dviname) |
| 700 | fonts[Fx] = self._embedTeXFont(info) |
| 701 | for filename in sorted(self.fontNames): |
| 702 | Fx = self.fontNames[filename] |
| 703 | _log.debug('Embedding font %s.', filename) |
| 704 | if filename.endswith('.afm'): |
| 705 | # from pdf.use14corefonts |
| 706 | _log.debug('Writing AFM font.') |
| 707 | fonts[Fx] = self._write_afm_font(filename) |
| 708 | else: |
| 709 | # a normal TrueType font |
| 710 | _log.debug('Writing TrueType font.') |
| 711 | realpath, stat_key = get_realpath_and_stat(filename) |
| 712 | chars = self.used_characters.get(stat_key) |
| 713 | if chars is not None and len(chars[1]): |
| 714 | fonts[Fx] = self.embedTTF(realpath, chars[1]) |
| 715 | self.writeObject(self.fontObject, fonts) |
| 716 | |
| 717 | def _write_afm_font(self, filename): |
| 718 | with open(filename, 'rb') as fh: |
no test coverage detected