InkscapeLite, bug fix, another needs fixing

Under development: PCMCIA, wireless, etc.
Message
Author
User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

InkscapeLite, bug fix, another needs fixing

#1 Post by BarryK »

InkscapeLite has been in most pups for years, and I still have it in Quirky.

Why? It is so small, the last version of Inkscape written in C, before they rewrote it in C++.
Very handy for knocking up vector diagrams, or constructing composite bitmap images (it will import png images). Can also export to png.

Handy little app, but has some issues. One of those was the cursor in the horizontal ruler not erasing as it moved. Finally it is fixed, thanks to SFR:
http://murga-linux.com/puppy/viewtopic. ... 736#897736

But there is another bug. The vertical ruler is hidden. I noticed this recently, don't know when it appeared. Obviously some change in GTK2 has caused it.
This snapshot shows the bug: see attached.

SFR was working with 0.36.2, which seems to be older source. I have 0.36.3, and his patch did not work, so I had to create a new one.

If anyone with a smattering of C coding ability would like to have a go at fixing this, please do!

Here is the source:
http://distro.ibiblio.org/quirky/quirky ... .3.tar.bz2

I have the patches and configure info from T2. File inkscapelite.conf is easy to read.
On a 64-bit build, this is the full configure line:

Code: Select all

# ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --build=x86_64-pc-linux-gnu --with-popt --with-xft --without-gnome-print --disable-mmx
SFR commented that the text tool does not work with the 64-bit compile. Yes it does, with my source.

His comment about not being able to open many SVG files, is correct. SVG files that it creates are OK, as are others using fairly generic SVG code. Perhaps that could be another project.

This is a great little app, it will be great if we can keep it alive.
Attachments
inkscapelite.tar.gz
Patches and config info from T2
(3.17 KiB) Downloaded 408 times
inkscapelite.png
(10.28 KiB) Downloaded 1366 times
[url]https://bkhome.org/news/[/url]

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#2 Post by amigo »

Interesting. Thanks for posting. I have a version of the original 0.36 sources which I massaged a bit. I find the old version-controlled sources for the few days when the 'big switch' was made to C++. There was some useful stuff that went in just after the 0.36 release, but before the re-write started.

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

#3 Post by BarryK »

I can't recall the exact history of how my 0.36.3 source came about.
I think it might have some of my own modifications in it.

amigo,
Yes, it would be great if you can take a look at it.

SFR sent me a PM, he found the patch on the Internet, I think he actually got the fix for the horizontal ruler from the full inkscape project.
I know that they had that bug for a very long time.
[url]https://bkhome.org/news/[/url]

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

#4 Post by BarryK »

Ah ha! The hidden vertical ruler was fixed in Inkscape 0.47:

https://bugs.launchpad.net/inkscape/+bug/354274

...so where is the patch?
[url]https://bkhome.org/news/[/url]

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

#5 Post by SFR »

BarryK wrote:I think he actually got the fix for the horizontal ruler from the full inkscape project.
No. IIRC I tried that at first, but the code in ruler.cpp is way too different.
But I found it - it was GIMP (Toolkit). :lol:
http://www.cs.cmu.edu/afs/cs.cmu.edu/pr ... gtkruler.c
(scroll down to the very bottom)

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]

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

#6 Post by BarryK »

Got it!

I hunted around on the Inkscape Bazaar repository, couldn't find the fix, so I thought, why not ask one of the developers?

So I did. I asked Diederik, and he responded straight away, with this URL:

http://bazaar.launchpad.net/~inkscape.d ... ision/7543

I managed to adapt the changes to src/widgets/ruler.c, and the patch is enclosed. And a snapshot for proof.

The numbers on the vertical ruler look a bit off, but good enough for now.

I have added this patch to T2.
Attachments
04-inkscapelite-fix-vruler.patch.gz
Fixes squashed vertical ruler
(496 Bytes) Downloaded 367 times
inkscapelite-vruler-fixed.png
(9.86 KiB) Downloaded 1208 times
[url]https://bkhome.org/news/[/url]

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

#7 Post by SFR »

Thanks for the patch, works fine.

Btw, an observation regarding the 'Text' tool on FD - selecting 'Text and Font' menu option also causes a segfault, but on a rare occasion it somehow works and after closing the dialog, Text tool also gets immune to segfault.
N.B.: building with CFLAGS='-g -O0' makes the 'Text and Font' option segfault-resistant every time.
___________

Here's (attached) unified patch for FD64-710, if anyone would like to build InkLite there.
Two issues, though:
1. Segfaults on attempt to use 'Text' tool.
2. Lacks numbers on both rules.

Greetings!
Attachments
inklite.patch.tar.gz
(1.34 KiB) Downloaded 406 times
Last edited by SFR on Sun 17 Apr 2016, 14:49, edited 1 time in total.
[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

#8 Post by jamesbond »

@SFR - interested. Can you send me 710 pkgbuild tarball? (with all the other patches too?).

PS: the fact that you need -O0, perhaps you can instead use '-fno-strict-aliasing'.

Thank you.
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
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#9 Post by SFR »

@James:
I don't have a pkgbuild, the above is complete patch for this sources:
http://distro.ibiblio.org/quirky/quirky ... .3.tar.bz2

Hmm, I'm checking right now and it doesn't really seem to matter what CFLAGS are there - 'Text and Font' crashes in ~1 on 5 cases.
The mentioned observation comes from my previous struggles with InkLite, yet in FD64-700. I didn't fully check that on 710, until now. :oops:

EDIT: I just checked and for some reason the patch posted in my previous post fails, probably due to some issues with whitespaces.
I packed it into .tar.gz (attached in my previous post).

EDIT2: this package (for April64, yet without the patches for rulers) does not segfault in FD.

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

#10 Post by jamesbond »

Thanks SFR. I'll to build it and see how it goes.
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
OscarTalks
Posts: 2196
Joined: Mon 06 Feb 2012, 00:58
Location: London, England

#11 Post by OscarTalks »

Did a test build in Dpup Wheezy.
Wasn't sure if I was supposed to apply the glib.h patch so tried without.
I applied the 2 ruler patches.
Then ran ./configure with options
Then ran the sed command from the .conf file to fix the "--export-dynamic" gcc error.
Then ran make and it completed and seems to run OK.
Thanks for this.
Attachments
inkscape.jpg
Ruler fixes applied in Dpup Wheezy
(64.52 KiB) Downloaded 1017 times
Oscar in England
Image

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

#12 Post by BarryK »

OscarTalks wrote:Did a test build in Dpup Wheezy.
Wasn't sure if I was supposed to apply the glib.h patch so tried without.
I applied the 2 ruler patches.
Then ran ./configure with options
Then ran the sed command from the .conf file to fix the "--export-dynamic" gcc error.
Then ran make and it completed and seems to run OK.
Thanks for this.
Yeah, removing "--export-dynamic", replacing it with "-lm" in the Makefile, is clumsy.

It would have been better if I had created a patch to fix it before running "configure ..."

Note, InkscapeLite on T2 was created by me, so I am the cause of the clumsiness.
[url]https://bkhome.org/news/[/url]

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

#13 Post by SFR »

jamesbond wrote:Thanks SFR. I'll to build it and see how it goes.
Thank you for your interest.

A tiny progress on the issue...
I built InkLite in PCLinuxOS and it does not segfault in Fatdog.
As for the missing numbers on rulers (in FD710) it can be fixed by reverting 'iso10646' to 'iso8859' in 'fixed' alias (/usr/share/fonts/X11/misc/fonts.alias):

Code: Select all

fixed        -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-1
(xlock and xmessage still work fine despite that change, btw)

Of course it still would be best to make it build-able in Fatdog (with its default settings).

Can't attach the package here (509K), so I used TinyUpload:
http://s000.tinyupload.com/?file_id=078 ... 2804514113

MD5: 8298dda1006ee62402621dceece63722 inkscapelite-0.36.3-x86_64-1.txz

Greetings!
Attachments
InkLite_FD64.jpg
(33.72 KiB) Downloaded 955 times
[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]

User avatar
gjuhasz
Posts: 422
Joined: Mon 29 Sep 2008, 14:28

vector graphics reproduction bug

#14 Post by gjuhasz »

The ruler is OK but the problems with svg file reproduction remained.

For example, Inklite fails to display some simple icons in /usr/share/pixmaps/puppy folder. See the screenshot attached for clock_interval.svg. Moreover, it displays a blank picture for others, e.g., for sound_eq.svg. The icons look well in ROX and also in in Viewnior.
It is strange that Inklite can correctly transform (e.g., rotate) them despite of the bad visualization.

Any idea? Thanks in advance.

Have fun!

Regards,

gjuhasz.
Attachments
Inklite_bad_svg.jpg
Inkscapelite 0.36 - svg reproduction in Tahr 6.0.5
(53.89 KiB) Downloaded 838 times

User avatar
peebee
Posts: 4370
Joined: Sun 21 Sep 2008, 12:31
Location: Worcestershire, UK
Contact:

#15 Post by peebee »

Patched source now at:
http://distro.ibiblio.org/puppylinux/so ... ers.tar.xz

Change request for an amended slacko pet-build has been sent.
https://github.com/puppylinux-woof-CE/petbuilds/pulls
ImageLxPup = Puppy + LXDE
Main version used daily: LxPupSc; Assembler of UPups, ScPup & ScPup64, LxPup, LxPupSc & LxPupSc64

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]

Post Reply