InkscapeLite, bug fix, another needs fixing

Under development: PCMCIA, wireless, etc.
Message
Author
jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#16 Post by jamesbond »

@SFR - The crash happens in libfontconfig, while making XftListsFont call. Apparently you can make this call successful (???) by doing View -> Advanced Text Tool and the set default font to anything other than helvetica. And then the standard text tool will work. But it does not make sense. I'm going to check what's wrong with libXft and libfontconfig - this seems to be generic and not tied to inkscapelite at all, but I may be wrong.

On the other hand, the report from gjuhash above is disheartening. zigbert's SVG icons are quite simple (if I recall correctly. he actually hand-tuned the SVG paths). If inkscapelite can't even process a simple SVG correctly, I'm having a hard time to justify the effort in trying to make it work.
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#17 Post by don570 »

I'm having a hard time to justify the effort in trying to make it work.
Barry K knows about the problem of Inkscapelite recognising the more recent Inkscape SVG images.

...but he likes it because you can make a SVG image and the image will be compatible
with the current programs.

_________________________________________________

User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#18 Post by SFR »

jamesbond wrote:@SFR - The crash happens in libfontconfig, while making XftListsFont call. Apparently you can make this call successful (???) by doing View -> Advanced Text Tool and the set default font to anything other than helvetica. And then the standard text tool will work. But it does not make sense. I'm going to check what's wrong with libXft and libfontconfig - this seems to be generic and not tied to inkscapelite at all, but I may be wrong.
Yes, that's exactly where I got stuck.
jamesbond wrote:On the other hand, the report from gjuhash above is disheartening. zigbert's SVG icons are quite simple (if I recall correctly. he actually hand-tuned the SVG paths). If inkscapelite can't even process a simple SVG correctly, I'm having a hard time to justify the effort in trying to make it work.
Yeah, if you check the sources, there's a lot of "Unimplemented" stuff.
Well, that's _almost_ a show-stopper to me, but if I consider it as just a tiny, lightweight app for creating (not editing existing ones) simple vector images, it becomes quite handy.

Anyway, I have a working build, whoever is interested can get it from my previous post, so no biggie.
And thank you again for checking it out!

Greetings!
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#19 Post by jamesbond »

My contribution:

text-tool-crash.patch (64-bit only - not needed for 32-bit build):

Code: Select all

Force all arguments to be 64-bit (required by FcPatternVapBuild - which
is what XftListFonts eventually calls).

James 2016

diff -ur inkscapelite-old/src/libnrtype/nr-type-xft.c inkscapelite-0.36.3/src/libnrtype/nr-type-xft.c
--- inkscapelite-old/src/libnrtype/nr-type-xft.c	2016-04-25 12:52:42.023359902 +0700
+++ inkscapelite-0.36.3/src/libnrtype/nr-type-xft.c	2016-04-25 13:05:54.136712770 +0700
@@ -127,9 +127,9 @@
 	}
 
 	/* Get family list */
-	fs = XftListFonts (GDK_DISPLAY (), 0,
-			   XFT_SCALABLE, XftTypeBool, 1, XFT_OUTLINE, XftTypeBool, 1, 0,
-			   XFT_FAMILY, 0);
+	fs = XftListFonts (GDK_DISPLAY (), 0L,
+			   XFT_SCALABLE, XftTypeBool, 1L, XFT_OUTLINE, XftTypeBool, 1L, 0L,
+			   XFT_FAMILY, 0L);
 	NRXftFamilies.length = fs->nfont;
 	NRXftFamilies.names = nr_new (gchar *, NRXftFamilies.length);
 	NRXftFamilies.destructor = NULL;
@@ -140,9 +140,9 @@
 	}
 
 	/* Get typeface list */
-	NRXftPatterns = XftListFonts (GDK_DISPLAY (), 0,
-				      XFT_SCALABLE, XftTypeBool, 1, XFT_OUTLINE, XftTypeBool, 1, 0,
-				      XFT_FAMILY, XFT_WEIGHT, XFT_SLANT, XFT_FILE, XFT_INDEX, 0);
+	NRXftPatterns = XftListFonts (GDK_DISPLAY (), 0L,
+				      XFT_SCALABLE, XftTypeBool, 1L, XFT_OUTLINE, XftTypeBool, 1L, 0L,
+				      XFT_FAMILY, XFT_WEIGHT, XFT_SLANT, XFT_FILE, XFT_INDEX, 0L);
 	NRXftTypefaces.length = NRXftPatterns->nfont;
 	NRXftTypefaces.names = nr_new (gchar *, NRXftTypefaces.length);
 	NRXftTypefaces.destructor = NULL;
Missing number labels in ruler patch:

Code: Select all

Hard code the ruler font to use dejavu sans mono. Depending on gtkstyle font
does not always work anymore.

James 2016

diff -ur inkscapelite-old/src/widgets/ruler.c inkscapelite-0.36.3/src/widgets/ruler.c
--- inkscapelite-old/src/widgets/ruler.c	2016-04-25 12:52:13.373359193 +0700
+++ inkscapelite-0.36.3/src/widgets/ruler.c	2016-04-25 15:47:53.433619191 +0700
@@ -17,7 +17,7 @@
 #include <string.h>
 #include "ruler.h"
 
-
+#define RULER_FONT            "-misc-dejavu sans mono-medium-r-normal--12-*-*-*-m-*-*-*"
 #define RULER_WIDTH           14
 #define RULER_HEIGHT          14
 #define MINIMUM_INCR          5
@@ -150,8 +150,9 @@
 
   gc = widget->style->fg_gc[GTK_STATE_NORMAL];
   bg_gc = widget->style->bg_gc[GTK_STATE_NORMAL];
-  font = gtk_style_get_font(widget->style);
+  //font = gtk_style_get_font(widget->style);
 
+  font = gdk_font_load (RULER_FONT);
   xthickness = widget->style->xthickness;
   ythickness = widget->style->ythickness;
   digit_height = font->ascent; /* assume descent == 0 ? */
@@ -441,7 +442,8 @@
 
   gc = widget->style->fg_gc[GTK_STATE_NORMAL];
   bg_gc = widget->style->bg_gc[GTK_STATE_NORMAL];
-  font = gtk_style_get_font(widget->style);
+  //font = gtk_style_get_font(widget->style);
+  font = gdk_font_load (RULER_FONT);
   xthickness = widget->style->xthickness;
   ythickness = widget->style->ythickness;
   digit_height = font->ascent; /* assume descent == 0 ? */

Apply this patch after applying inklite.patch from SFR (earlier in this thread).
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#20 Post by BarryK »

jamesbond wrote:My contribution:

text-tool-crash.patch (64-bit only - not needed for 32-bit build):

Code: Select all

Force all arguments to be 64-bit (required by FcPatternVapBuild - which
is what XftListFonts eventually calls).

James 2016

diff -ur inkscapelite-old/src/libnrtype/nr-type-xft.c inkscapelite-0.36.3/src/libnrtype/nr-type-xft.c
--- inkscapelite-old/src/libnrtype/nr-type-xft.c	2016-04-25 12:52:42.023359902 +0700
+++ inkscapelite-0.36.3/src/libnrtype/nr-type-xft.c	2016-04-25 13:05:54.136712770 +0700
@@ -127,9 +127,9 @@
 	}
 
 	/* Get family list */
-	fs = XftListFonts (GDK_DISPLAY (), 0,
-			   XFT_SCALABLE, XftTypeBool, 1, XFT_OUTLINE, XftTypeBool, 1, 0,
-			   XFT_FAMILY, 0);
+	fs = XftListFonts (GDK_DISPLAY (), 0L,
+			   XFT_SCALABLE, XftTypeBool, 1L, XFT_OUTLINE, XftTypeBool, 1L, 0L,
+			   XFT_FAMILY, 0L);
 	NRXftFamilies.length = fs->nfont;
 	NRXftFamilies.names = nr_new (gchar *, NRXftFamilies.length);
 	NRXftFamilies.destructor = NULL;
@@ -140,9 +140,9 @@
 	}
 
 	/* Get typeface list */
-	NRXftPatterns = XftListFonts (GDK_DISPLAY (), 0,
-				      XFT_SCALABLE, XftTypeBool, 1, XFT_OUTLINE, XftTypeBool, 1, 0,
-				      XFT_FAMILY, XFT_WEIGHT, XFT_SLANT, XFT_FILE, XFT_INDEX, 0);
+	NRXftPatterns = XftListFonts (GDK_DISPLAY (), 0L,
+				      XFT_SCALABLE, XftTypeBool, 1L, XFT_OUTLINE, XftTypeBool, 1L, 0L,
+				      XFT_FAMILY, XFT_WEIGHT, XFT_SLANT, XFT_FILE, XFT_INDEX, 0L);
 	NRXftTypefaces.length = NRXftPatterns->nfont;
 	NRXftTypefaces.names = nr_new (gchar *, NRXftTypefaces.length);
 	NRXftTypefaces.destructor = NULL;
Missing number labels in ruler patch:

Code: Select all

Hard code the ruler font to use dejavu sans mono. Depending on gtkstyle font
does not always work anymore.

James 2016

diff -ur inkscapelite-old/src/widgets/ruler.c inkscapelite-0.36.3/src/widgets/ruler.c
--- inkscapelite-old/src/widgets/ruler.c	2016-04-25 12:52:13.373359193 +0700
+++ inkscapelite-0.36.3/src/widgets/ruler.c	2016-04-25 15:47:53.433619191 +0700
@@ -17,7 +17,7 @@
 #include <string.h>
 #include "ruler.h"
 
-
+#define RULER_FONT            "-misc-dejavu sans mono-medium-r-normal--12-*-*-*-m-*-*-*"
 #define RULER_WIDTH           14
 #define RULER_HEIGHT          14
 #define MINIMUM_INCR          5
@@ -150,8 +150,9 @@
 
   gc = widget->style->fg_gc[GTK_STATE_NORMAL];
   bg_gc = widget->style->bg_gc[GTK_STATE_NORMAL];
-  font = gtk_style_get_font(widget->style);
+  //font = gtk_style_get_font(widget->style);
 
+  font = gdk_font_load (RULER_FONT);
   xthickness = widget->style->xthickness;
   ythickness = widget->style->ythickness;
   digit_height = font->ascent; /* assume descent == 0 ? */
@@ -441,7 +442,8 @@
 
   gc = widget->style->fg_gc[GTK_STATE_NORMAL];
   bg_gc = widget->style->bg_gc[GTK_STATE_NORMAL];
-  font = gtk_style_get_font(widget->style);
+  //font = gtk_style_get_font(widget->style);
+  font = gdk_font_load (RULER_FONT);
   xthickness = widget->style->xthickness;
   ythickness = widget->style->ythickness;
   digit_height = font->ascent; /* assume descent == 0 ? */

Apply this patch after applying inklite.patch from SFR (earlier in this thread).
james,
Thanks, I have put these into T2. Haven't tried them yet.
[url]https://bkhome.org/news/[/url]

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#21 Post by 01micko »

Working ok(ish) in slacko64.

Any text certainly would crash the thing. This image (below) isn't rendered correctly though as it is 360x200. Still.. it will do. It is 'home grown' in the zigbert style.
Attachments
inkscape.png
(48.83 KiB) Downloaded 330 times
Puppy Linux Blog - contact me for access

User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#22 Post by SFR »

jamesbond wrote:My contribution:

text-tool-crash.patch (64-bit only - not needed for 32-bit build):
[...]
Missing number labels in ruler patch:
[...]
Thanks a lot! Just tried it and builds/works fine.

Greetings!
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]

Pelo

Nice tool,

#23 Post by Pelo »

Nice tool, to include in a trilogy Inskscapelite first, then MTpaint, and last Lazpaint.
I never got bug with inkscapelite. A chance, i use it a lot. Some versions of Lazpaint crash, only from time to time.
manipulate
Attachments
akim.jpg
You can do better. For fun.
(104.15 KiB) Downloaded 100 times

Post Reply