summaryrefslogtreecommitdiffstats
path: root/src/sp-flowtext.cpp
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2016-06-11 15:34:03 +0000
committerjabiertxof <info@marker.es>2016-06-11 15:34:03 +0000
commitd6b2e2cdeb563026cc9f4633e687a607b095da87 (patch)
treeb25e3e95e5e96782232e65d0d9889fcb12c2f285 /src/sp-flowtext.cpp
parentFixing satellites bug on erase (diff)
parentA little cleaning up of attributes. (diff)
downloadinkscape-d6b2e2cdeb563026cc9f4633e687a607b095da87.tar.gz
inkscape-d6b2e2cdeb563026cc9f4633e687a607b095da87.zip
update to trunk
(bzr r13645.1.147)
Diffstat (limited to 'src/sp-flowtext.cpp')
-rw-r--r--src/sp-flowtext.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/sp-flowtext.cpp b/src/sp-flowtext.cpp
index b87507e18..51fb3ae89 100644
--- a/src/sp-flowtext.cpp
+++ b/src/sp-flowtext.cpp
@@ -30,6 +30,8 @@
#include "text-editing.h"
#include "sp-text.h"
+#include "libnrtype/font-instance.h"
+
#include "livarot/Shape.h"
#include "display/drawing-text.h"
@@ -339,6 +341,26 @@ void SPFlowtext::_buildLayoutInput(SPObject *root, Shape const *exclusion_shape,
bool with_indent = false;
if (dynamic_cast<SPFlowpara *>(root)) {
+
+ layout.strut.reset();
+ if (style) {
+ font_instance *font = font_factory::Default()->FaceFromStyle( style );
+ if (font) {
+ font->FontMetrics(layout.strut.ascent, layout.strut.descent, layout.strut.xheight);
+ font->Unref();
+ }
+ layout.strut *= style->font_size.computed;
+ if (style->line_height.normal ) {
+ layout.strut.computeEffective( Inkscape::Text::Layout::LINE_HEIGHT_NORMAL );
+ } else if (style->line_height.unit == SP_CSS_UNIT_NONE) {
+ layout.strut.computeEffective( style->line_height.computed );
+ } else {
+ if( style->font_size.computed > 0.0 ) {
+ layout.strut.computeEffective( style->line_height.computed/style->font_size.computed );
+ }
+ }
+ }
+
// emulate par-indent with the first char's kern
SPObject *t = root;
SPFlowtext *ft = NULL;