From 6947ff531840b67cafd4c7931e6b7bb9ceaf7d70 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Sun, 5 Feb 2017 20:24:08 +0100 Subject: forward-port from 0.92.x the line height conversion from <.92 to >=.92 Code written by su_v in python as an extension, ported to c++ by Mc, some fixes added by bryce. http://bazaar.launchpad.net/~inkscape.dev/inkscape/0.92.x/revision/15338 http://bazaar.launchpad.net/~inkscape.dev/inkscape/0.92.x/revision/15339 http://bazaar.launchpad.net/~inkscape.dev/inkscape/0.92.x/revision/15350 http://bazaar.launchpad.net/~inkscape.dev/inkscape/0.92.x/revision/15351 Option to disable it is called --no-convert-text-baseline-spacing The terminology "convert" is chosen as a jargon word to be used for all such legacy file conversions. The "--no-XXX" naming style is adopted from the convention used by other software such as GIMP. (bzr r15481) --- src/document.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/document.cpp') diff --git a/src/document.cpp b/src/document.cpp index 57208582a..b69508751 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -49,6 +49,7 @@ #include "display/drawing.h" #include "document-private.h" #include "document-undo.h" +#include "file.h" #include "id-clash.h" #include "inkscape.h" #include "inkscape-version.h" @@ -71,7 +72,7 @@ using Inkscape::Util::unit_table; // since we want it to happen when there are no more updates. #define SP_DOCUMENT_REROUTING_PRIORITY (G_PRIORITY_HIGH_IDLE - 1) - +bool sp_no_convert_text_baseline_spacing = false; static gint sp_document_idle_handler(gpointer data); static gint sp_document_rerouting_handler(gpointer data); @@ -452,6 +453,17 @@ SPDocument *SPDocument::createDoc(Inkscape::XML::Document *rdoc, )); document->oldSignalsConnected = true; + /** Fix baseline spacing (pre-92 files) **/ + if ( (!sp_no_convert_text_baseline_spacing) + && sp_version_inside_range( document->root->version.inkscape, 0, 1, 0, 92 ) ) { + sp_file_convert_text_baseline_spacing(document); + } + + /** Fix font names in legacy documents (pre-92 files) **/ + if ( sp_version_inside_range( document->root->version.inkscape, 0, 1, 0, 92 ) ) { + sp_file_convert_font_name(document); + } + return document; } -- cgit v1.2.3