summaryrefslogtreecommitdiffstats
path: root/src/display
diff options
context:
space:
mode:
Diffstat (limited to 'src/display')
-rw-r--r--src/display/drawing-text.cpp29
1 files changed, 28 insertions, 1 deletions
diff --git a/src/display/drawing-text.cpp b/src/display/drawing-text.cpp
index 9d81d736d..b92886691 100644
--- a/src/display/drawing-text.cpp
+++ b/src/display/drawing-text.cpp
@@ -584,7 +584,34 @@ unsigned DrawingText::_renderItem(DrawingContext &dc, Geom::IntRect const &/*are
if (g->_ctm.isSingular()) continue;
dc.transform(g->_ctm);
if (g->_drawable) {
- dc.path(*g->_font->PathVector(g->_glyph));
+ if (g->_font->FontHasSVG()) {
+ Inkscape::Pixbuf* pixbuf = g->_font->PixBuf(g->_glyph);
+ if (pixbuf) {
+ // Geom::OptRect box = bounds_exact(*g->_font->PathVector(g->_glyph));
+ // if (box) {
+ // Inkscape::DrawingContext::Save save(dc);
+ // dc.newPath();
+ // dc.rectangle(*box);
+ // dc.setLineWidth(0.01);
+ // dc.setSource(0x8080ffff);
+ // dc.stroke();
+ // }
+ {
+ // pixbuf is in font design units, scale to embox.
+ double scale = g->_font->GetDesignUnits();
+ if (scale <= 0) scale = 1000;
+ Inkscape::DrawingContext::Save save(dc);
+ dc.translate(0, 1);
+ dc.scale(1.0/scale, -1.0/scale);
+ dc.setSource(pixbuf->getSurfaceRaw(), 0, 0);
+ dc.paint(1);
+ }
+ } else {
+ dc.path(*g->_font->PathVector(g->_glyph));
+ }
+ } else {
+ dc.path(*g->_font->PathVector(g->_glyph));
+ }
}
}