mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Debug output for which fonts are used by the PDF engine
This commit is contained in:
parent
0398ecd9d3
commit
194bda9f3b
@ -245,13 +245,19 @@ class PdfEngine(QPaintEngine):
|
|||||||
gi = GlyphInfo(*self.qt_hack.get_glyphs(point, text_item))
|
gi = GlyphInfo(*self.qt_hack.get_glyphs(point, text_item))
|
||||||
if not gi.indices:
|
if not gi.indices:
|
||||||
return
|
return
|
||||||
name = hash(gi.name)
|
metrics = self.fonts.get(gi.name)
|
||||||
if name not in self.fonts:
|
if metrics is None:
|
||||||
|
from calibre.utils.fonts.utils import get_all_font_names
|
||||||
try:
|
try:
|
||||||
self.fonts[name] = self.create_sfnt(text_item)
|
names = get_all_font_names(gi.name, True)
|
||||||
|
names = ' '.join('%s=%s'%(k, names[k]) for k in sorted(names))
|
||||||
|
except Exception:
|
||||||
|
names = 'Unknown'
|
||||||
|
self.debug('Loading font: %s' % names)
|
||||||
|
try:
|
||||||
|
self.fonts[gi.name] = metrics = self.create_sfnt(text_item)
|
||||||
except UnsupportedFont:
|
except UnsupportedFont:
|
||||||
return super(PdfEngine, self).drawTextItem(point, text_item)
|
return super(PdfEngine, self).drawTextItem(point, text_item)
|
||||||
metrics = self.fonts[name]
|
|
||||||
for glyph_id in gi.indices:
|
for glyph_id in gi.indices:
|
||||||
try:
|
try:
|
||||||
metrics.glyph_map[glyph_id] = metrics.full_glyph_map[glyph_id]
|
metrics.glyph_map[glyph_id] = metrics.full_glyph_map[glyph_id]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user