Re: [patch] Prefer svg icons

2015-03-21 Thread Stephan Witt
Am 20.03.2015 um 23:45 schrieb Enrico Forestieri for...@lyx.org:

 On Fri, Mar 20, 2015 at 10:15:18AM +0100, Stephan Witt wrote:
 
 Ok, here's the patch to improve the display of icons on Mac. I made a
 snapshot of the resulting on-screen display.
 
 The GraphicsLoader.cpp change needs hard coded values. I didn't find a better
 solution, ATM. Any comments are welcome.
 
 So, the trick is rendering the svg icons at double resolution, if I
 undestand correctly. Does it mean that you actually have to use the
 larger sizes to have resonably sized icons?

Yes, the QIcon e.g. needs higher physical resolution pixmaps for HiDPI on mac.
The logical resolution is the lower one in this scenario.

 
 diff --git a/src/graphics/GraphicsLoader.cpp 
 b/src/graphics/GraphicsLoader.cpp
 index 23ebb62..6b53774 100644
 --- a/src/graphics/GraphicsLoader.cpp
 +++ b/src/graphics/GraphicsLoader.cpp
 @@ -460,6 +460,10 @@ void Loader::Impl::createPixmap()
  if (idx != string::npos  idx  3) {
  if (filename.substr(idx - 3, 3) == @2x) {
  params_.pixel_ratio = 2.0;
 +} else if (cached_item_-filename().extension() == 
 svgz) {
 +params_.pixel_ratio = 2.0;
 +} else if (cached_item_-filename().extension() == 
 svg) {
 +params_.pixel_ratio = 2.0;
 
 Here you set params_.pixel_ratio simply based on the extension. Should not
 you check whether the display is actually a HiDPI one?

In fact the pixel_ratio of an real vector based SVG image is infinite. 
A proper value would be the result of theGuiApp()-pixelRatio().
But I don't know how to get this information from inside the GraphicsLoader.
Perhaps it isn't the best solution to make this decision here.

Stephan

Re: [patch] Prefer svg icons

2015-03-21 Thread Stephan Witt
Am 20.03.2015 um 23:45 schrieb Enrico Forestieri :

> On Fri, Mar 20, 2015 at 10:15:18AM +0100, Stephan Witt wrote:
>> 
>> Ok, here's the patch to improve the display of icons on Mac. I made a
>> snapshot of the resulting on-screen display.
>> 
>> The GraphicsLoader.cpp change needs hard coded values. I didn't find a better
>> solution, ATM. Any comments are welcome.
> 
> So, the trick is rendering the svg icons at double resolution, if I
> undestand correctly. Does it mean that you actually have to use the
> larger sizes to have resonably sized icons?

Yes, the QIcon e.g. needs higher physical resolution pixmaps for HiDPI on mac.
The logical resolution is the lower one in this scenario.

> 
>> diff --git a/src/graphics/GraphicsLoader.cpp 
>> b/src/graphics/GraphicsLoader.cpp
>> index 23ebb62..6b53774 100644
>> --- a/src/graphics/GraphicsLoader.cpp
>> +++ b/src/graphics/GraphicsLoader.cpp
>> @@ -460,6 +460,10 @@ void Loader::Impl::createPixmap()
>>  if (idx != string::npos && idx > 3) {
>>  if (filename.substr(idx - 3, 3) == "@2x") {
>>  params_.pixel_ratio = 2.0;
>> +} else if (cached_item_->filename().extension() == 
>> "svgz") {
>> +params_.pixel_ratio = 2.0;
>> +} else if (cached_item_->filename().extension() == 
>> "svg") {
>> +params_.pixel_ratio = 2.0;
> 
> Here you set params_.pixel_ratio simply based on the extension. Should not
> you check whether the display is actually a HiDPI one?

In fact the pixel_ratio of an real vector based SVG image is infinite. 
A proper value would be the result of theGuiApp()->pixelRatio().
But I don't know how to get this information from inside the GraphicsLoader.
Perhaps it isn't the best solution to make this decision here.

Stephan

Re: [patch] Prefer svg icons

2015-03-20 Thread Stephan Witt
Am 16.03.2015 um 10:27 schrieb Enrico Forestieri for...@lyx.org:

 On Sun, Mar 15, 2015 at 08:54:33AM +0100, Abdelrazak Younes wrote:
 
 Hi Enrico,
 
 On 16/02/2015 15:21, Enrico Forestieri wrote:
 The attached patch let LyX use svg icons (if they exist) in preference
 to png ones. The svg icons automatically scale to the wanted dimension
 and the patch introduces 2 more resolutions (huge and giant icons) that
 should be useful to people with hires displays.
 
 Some svg icons were already added by Jürgen to the lib/images/svg subdir.
 However, they are not seen there and should be copied in the normal places.
 To this end, I also attach a shell script that symlinks them properly.
 The script works like a toggle, i.e., the first time it is launched
 the symlinks are created. When it launched a second time, the symlinks
 are removed.
 
 If no svg icons exist, LyX will use pngs, as usual. In my testing,
 it turns out that some svgs are problematic and give warnings on
 the console while they are loaded. Apart from that, everything seems
 to work for me, but you never know, so I am asking for comments before
 committing.
 
 One general comment from my old souvenirs:
 
 Qt supports SVG tiny standard and, IIRC, there were talk to
 deprecate that support in some 5.X version.
 
 But it will not be removed
 http://blog.qt.io/blog/2011/05/12/qt-modules-maturity-level-the-list/#comment-12784
 
 At some point in the past, we did mostly the same thing as your
 patch (not sure if this was André, Peter or me); we also had all
 icons embedded in resource for faster loading and easier
 distribution. IIRC there were some valid arguments that got this
 patch  rejected at the end so you might want to look at the
 archives.
 
 Sorry, neither I remember nor can find it in the archives.
 
 But I like your patch ;-)
 
 Thanks.
 
 -- 
 Enrico

Ok, here's the patch to improve the display of icons on Mac. I made a snapshot 
of the resulting on-screen display.

The GraphicsLoader.cpp change needs hard coded values. I didn't find a better 
solution, ATM. Any comments are welcome.

Stephan



0001-svg-hidpi-on-mac.patch
Description: Binary data




Re: [patch] Prefer svg icons

2015-03-20 Thread Enrico Forestieri
On Fri, Mar 20, 2015 at 10:15:18AM +0100, Stephan Witt wrote:
 
 Ok, here's the patch to improve the display of icons on Mac. I made a
 snapshot of the resulting on-screen display.
 
 The GraphicsLoader.cpp change needs hard coded values. I didn't find a better
 solution, ATM. Any comments are welcome.

So, the trick is rendering the svg icons at double resolution, if I
undestand correctly. Does it mean that you actually have to use the
larger sizes to have resonably sized icons?

 diff --git a/src/graphics/GraphicsLoader.cpp b/src/graphics/GraphicsLoader.cpp
 index 23ebb62..6b53774 100644
 --- a/src/graphics/GraphicsLoader.cpp
 +++ b/src/graphics/GraphicsLoader.cpp
 @@ -460,6 +460,10 @@ void Loader::Impl::createPixmap()
   if (idx != string::npos  idx  3) {
   if (filename.substr(idx - 3, 3) == @2x) {
   params_.pixel_ratio = 2.0;
 + } else if (cached_item_-filename().extension() == 
 svgz) {
 + params_.pixel_ratio = 2.0;
 + } else if (cached_item_-filename().extension() == 
 svg) {
 + params_.pixel_ratio = 2.0;

Here you set params_.pixel_ratio simply based on the extension. Should not
you check whether the display is actually a HiDPI one?

-- 
Enrico


Re: [patch] Prefer svg icons

2015-03-20 Thread Stephan Witt
Am 16.03.2015 um 10:27 schrieb Enrico Forestieri :

> On Sun, Mar 15, 2015 at 08:54:33AM +0100, Abdelrazak Younes wrote:
> 
>> Hi Enrico,
>> 
>> On 16/02/2015 15:21, Enrico Forestieri wrote:
>>> The attached patch let LyX use svg icons (if they exist) in preference
>>> to png ones. The svg icons automatically scale to the wanted dimension
>>> and the patch introduces 2 more resolutions (huge and giant icons) that
>>> should be useful to people with hires displays.
>>> 
>>> Some svg icons were already added by Jürgen to the lib/images/svg subdir.
>>> However, they are not seen there and should be copied in the normal places.
>>> To this end, I also attach a shell script that symlinks them properly.
>>> The script works like a toggle, i.e., the first time it is launched
>>> the symlinks are created. When it launched a second time, the symlinks
>>> are removed.
>>> 
>>> If no svg icons exist, LyX will use pngs, as usual. In my testing,
>>> it turns out that some svgs are problematic and give warnings on
>>> the console while they are loaded. Apart from that, everything seems
>>> to work for me, but you never know, so I am asking for comments before
>>> committing.
>> 
>> One general comment from my old souvenirs:
>> 
>> Qt supports SVG tiny standard and, IIRC, there were talk to
>> deprecate that support in some 5.X version.
> 
> But it will not be removed
> http://blog.qt.io/blog/2011/05/12/qt-modules-maturity-level-the-list/#comment-12784
> 
>> At some point in the past, we did mostly the same thing as your
>> patch (not sure if this was André, Peter or me); we also had all
>> icons embedded in resource for faster loading and easier
>> distribution. IIRC there were some valid arguments that got this
>> patch  rejected at the end so you might want to look at the
>> archives.
> 
> Sorry, neither I remember nor can find it in the archives.
> 
>> But I like your patch ;-)
> 
> Thanks.
> 
> -- 
> Enrico

Ok, here's the patch to improve the display of icons on Mac. I made a snapshot 
of the resulting on-screen display.

The GraphicsLoader.cpp change needs hard coded values. I didn't find a better 
solution, ATM. Any comments are welcome.

Stephan



0001-svg-hidpi-on-mac.patch
Description: Binary data




Re: [patch] Prefer svg icons

2015-03-20 Thread Enrico Forestieri
On Fri, Mar 20, 2015 at 10:15:18AM +0100, Stephan Witt wrote:
> 
> Ok, here's the patch to improve the display of icons on Mac. I made a
> snapshot of the resulting on-screen display.
> 
> The GraphicsLoader.cpp change needs hard coded values. I didn't find a better
> solution, ATM. Any comments are welcome.

So, the trick is rendering the svg icons at double resolution, if I
undestand correctly. Does it mean that you actually have to use the
larger sizes to have resonably sized icons?

> diff --git a/src/graphics/GraphicsLoader.cpp b/src/graphics/GraphicsLoader.cpp
> index 23ebb62..6b53774 100644
> --- a/src/graphics/GraphicsLoader.cpp
> +++ b/src/graphics/GraphicsLoader.cpp
> @@ -460,6 +460,10 @@ void Loader::Impl::createPixmap()
>   if (idx != string::npos && idx > 3) {
>   if (filename.substr(idx - 3, 3) == "@2x") {
>   params_.pixel_ratio = 2.0;
> + } else if (cached_item_->filename().extension() == 
> "svgz") {
> + params_.pixel_ratio = 2.0;
> + } else if (cached_item_->filename().extension() == 
> "svg") {
> + params_.pixel_ratio = 2.0;

Here you set params_.pixel_ratio simply based on the extension. Should not
you check whether the display is actually a HiDPI one?

-- 
Enrico


Re: [patch] Prefer svg icons

2015-03-16 Thread Enrico Forestieri
On Sun, Mar 15, 2015 at 08:54:33AM +0100, Abdelrazak Younes wrote:

 Hi Enrico,
 
 On 16/02/2015 15:21, Enrico Forestieri wrote:
 The attached patch let LyX use svg icons (if they exist) in preference
 to png ones. The svg icons automatically scale to the wanted dimension
 and the patch introduces 2 more resolutions (huge and giant icons) that
 should be useful to people with hires displays.
 
 Some svg icons were already added by Jürgen to the lib/images/svg subdir.
 However, they are not seen there and should be copied in the normal places.
 To this end, I also attach a shell script that symlinks them properly.
 The script works like a toggle, i.e., the first time it is launched
 the symlinks are created. When it launched a second time, the symlinks
 are removed.
 
 If no svg icons exist, LyX will use pngs, as usual. In my testing,
 it turns out that some svgs are problematic and give warnings on
 the console while they are loaded. Apart from that, everything seems
 to work for me, but you never know, so I am asking for comments before
 committing.
 
 One general comment from my old souvenirs:
 
 Qt supports SVG tiny standard and, IIRC, there were talk to
 deprecate that support in some 5.X version.

But it will not be removed
http://blog.qt.io/blog/2011/05/12/qt-modules-maturity-level-the-list/#comment-12784

 At some point in the past, we did mostly the same thing as your
 patch (not sure if this was André, Peter or me); we also had all
 icons embedded in resource for faster loading and easier
 distribution. IIRC there were some valid arguments that got this
 patch  rejected at the end so you might want to look at the
 archives.

Sorry, neither I remember nor can find it in the archives.

 But I like your patch ;-)

Thanks.

-- 
Enrico


Re: [patch] Prefer svg icons

2015-03-16 Thread Enrico Forestieri
On Sun, Mar 15, 2015 at 08:54:33AM +0100, Abdelrazak Younes wrote:

> Hi Enrico,
> 
> On 16/02/2015 15:21, Enrico Forestieri wrote:
> >The attached patch let LyX use svg icons (if they exist) in preference
> >to png ones. The svg icons automatically scale to the wanted dimension
> >and the patch introduces 2 more resolutions (huge and giant icons) that
> >should be useful to people with hires displays.
> >
> >Some svg icons were already added by Jürgen to the lib/images/svg subdir.
> >However, they are not seen there and should be copied in the normal places.
> >To this end, I also attach a shell script that symlinks them properly.
> >The script works like a toggle, i.e., the first time it is launched
> >the symlinks are created. When it launched a second time, the symlinks
> >are removed.
> >
> >If no svg icons exist, LyX will use pngs, as usual. In my testing,
> >it turns out that some svgs are problematic and give warnings on
> >the console while they are loaded. Apart from that, everything seems
> >to work for me, but you never know, so I am asking for comments before
> >committing.
> 
> One general comment from my old souvenirs:
> 
> Qt supports SVG tiny standard and, IIRC, there were talk to
> deprecate that support in some 5.X version.

But it will not be removed
http://blog.qt.io/blog/2011/05/12/qt-modules-maturity-level-the-list/#comment-12784

> At some point in the past, we did mostly the same thing as your
> patch (not sure if this was André, Peter or me); we also had all
> icons embedded in resource for faster loading and easier
> distribution. IIRC there were some valid arguments that got this
> patch  rejected at the end so you might want to look at the
> archives.

Sorry, neither I remember nor can find it in the archives.

> But I like your patch ;-)

Thanks.

-- 
Enrico


Re: [patch] Prefer svg icons

2015-03-15 Thread Kornel Benko
Am Sonntag, 15. März 2015 um 11:45:04, schrieb Jürgen Spitzmüller 
sp...@lyx.org
 2015-03-12 11:22 GMT+01:00 Kornel Benko
 
  Am Montag, 16. Februar 2015 um 21:17:32, schrieb Enrico Forestieri 
  for...@lyx.org
   On Mon, Feb 16, 2015 at 05:02:15PM +0100, Kornel Benko wrote:
   
I get messages like
frontends/qt4/GuiApplication.cpp (612): Cannot load icon
/usr/local/lyx2.2/images/oxygen/buffer-new.svgz please verify
  resource
system!
 
 
 I also get these messages (and no icons) when compiling with qt5 (with
 autotools, and without installing). How did you resolve it?
 
 Jürgen

I am not getting this message any more (with cmake).
As I got the error, I had to make /usr/local/lyx2.2/images/oxygen writable to 
get
rid of the message.

Kornel

signature.asc
Description: This is a digitally signed message part.


Re: [patch] Prefer svg icons

2015-03-15 Thread Jürgen Spitzmüller
2015-03-12 11:22 GMT+01:00 Kornel Benko

 Am Montag, 16. Februar 2015 um 21:17:32, schrieb Enrico Forestieri 
 for...@lyx.org
  On Mon, Feb 16, 2015 at 05:02:15PM +0100, Kornel Benko wrote:
  
   I get messages like
   frontends/qt4/GuiApplication.cpp (612): Cannot load icon
   /usr/local/lyx2.2/images/oxygen/buffer-new.svgz please verify
 resource
   system!


I also get these messages (and no icons) when compiling with qt5 (with
autotools, and without installing). How did you resolve it?

Jürgen


Re: [patch] Prefer svg icons

2015-03-15 Thread Abdelrazak Younes

Hi Enrico,

On 16/02/2015 15:21, Enrico Forestieri wrote:

The attached patch let LyX use svg icons (if they exist) in preference
to png ones. The svg icons automatically scale to the wanted dimension
and the patch introduces 2 more resolutions (huge and giant icons) that
should be useful to people with hires displays.

Some svg icons were already added by Jürgen to the lib/images/svg subdir.
However, they are not seen there and should be copied in the normal places.
To this end, I also attach a shell script that symlinks them properly.
The script works like a toggle, i.e., the first time it is launched
the symlinks are created. When it launched a second time, the symlinks
are removed.

If no svg icons exist, LyX will use pngs, as usual. In my testing,
it turns out that some svgs are problematic and give warnings on
the console while they are loaded. Apart from that, everything seems
to work for me, but you never know, so I am asking for comments before
committing.


One general comment from my old souvenirs:

Qt supports SVG tiny standard and, IIRC, there were talk to deprecate 
that support in some 5.X version.


At some point in the past, we did mostly the same thing as your patch 
(not sure if this was André, Peter or me); we also had all icons 
embedded in resource for faster loading and easier distribution. IIRC 
there were some valid arguments that got this patch  rejected at the end 
so you might want to look at the archives.


But I like your patch ;-)

Cheers,
Abdel



Re: [patch] Prefer svg icons

2015-03-15 Thread Jean-Marc Lasgouttes

Le 15/03/15 02:54, Enrico Forestieri a écrit :

I do not have time for automake now, but I will do it on monday if
nobdy beats me to it.


I did that at 8fbe17c4.


Thanks!

JMarc



Re: [patch] Prefer svg icons

2015-03-15 Thread Abdelrazak Younes

Hi Enrico,

On 16/02/2015 15:21, Enrico Forestieri wrote:

The attached patch let LyX use svg icons (if they exist) in preference
to png ones. The svg icons automatically scale to the wanted dimension
and the patch introduces 2 more resolutions (huge and giant icons) that
should be useful to people with hires displays.

Some svg icons were already added by Jürgen to the lib/images/svg subdir.
However, they are not seen there and should be copied in the normal places.
To this end, I also attach a shell script that symlinks them properly.
The script works like a toggle, i.e., the first time it is launched
the symlinks are created. When it launched a second time, the symlinks
are removed.

If no svg icons exist, LyX will use pngs, as usual. In my testing,
it turns out that some svgs are problematic and give warnings on
the console while they are loaded. Apart from that, everything seems
to work for me, but you never know, so I am asking for comments before
committing.


One general comment from my old souvenirs:

Qt supports SVG tiny standard and, IIRC, there were talk to deprecate 
that support in some 5.X version.


At some point in the past, we did mostly the same thing as your patch 
(not sure if this was André, Peter or me); we also had all icons 
embedded in resource for faster loading and easier distribution. IIRC 
there were some valid arguments that got this patch  rejected at the end 
so you might want to look at the archives.


But I like your patch ;-)

Cheers,
Abdel



Re: [patch] Prefer svg icons

2015-03-15 Thread Jürgen Spitzmüller
2015-03-12 11:22 GMT+01:00 Kornel Benko

> Am Montag, 16. Februar 2015 um 21:17:32, schrieb Enrico Forestieri <
> for...@lyx.org>
> > On Mon, Feb 16, 2015 at 05:02:15PM +0100, Kornel Benko wrote:
> > >
> > > I get messages like
> > > frontends/qt4/GuiApplication.cpp (612): Cannot load icon
> > > /usr/local/lyx2.2/images/oxygen/buffer-new.svgz please verify
> resource
> > > system!
>

I also get these messages (and no icons) when compiling with qt5 (with
autotools, and without installing). How did you resolve it?

Jürgen


Re: [patch] Prefer svg icons

2015-03-15 Thread Kornel Benko
Am Sonntag, 15. März 2015 um 11:45:04, schrieb Jürgen Spitzmüller 

> 2015-03-12 11:22 GMT+01:00 Kornel Benko
> 
> > Am Montag, 16. Februar 2015 um 21:17:32, schrieb Enrico Forestieri <
> > for...@lyx.org>
> > > On Mon, Feb 16, 2015 at 05:02:15PM +0100, Kornel Benko wrote:
> > > >
> > > > I get messages like
> > > > frontends/qt4/GuiApplication.cpp (612): Cannot load icon
> > > > /usr/local/lyx2.2/images/oxygen/buffer-new.svgz please verify
> > resource
> > > > system!
> >
> 
> I also get these messages (and no icons) when compiling with qt5 (with
> autotools, and without installing). How did you resolve it?
> 
> Jürgen

I am not getting this message any more (with cmake).
As I got the error, I had to make /usr/local/lyx2.2/images/oxygen writable to 
get
rid of the message.

Kornel

signature.asc
Description: This is a digitally signed message part.


Re: [patch] Prefer svg icons

2015-03-15 Thread Jean-Marc Lasgouttes

Le 15/03/15 02:54, Enrico Forestieri a écrit :

I do not have time for automake now, but I will do it on monday if
nobdy beats me to it.


I did that at 8fbe17c4.


Thanks!

JMarc



Re: [patch] Prefer svg icons

2015-03-14 Thread Enrico Forestieri
On Sat, Mar 14, 2015 at 05:58:25PM +0100, Jean-Marc Lasgouttes wrote:

 Le 14/03/15 17:43, Jürgen Spitzmüller a écrit :
 2015-03-14 17:40 GMT+01:00 Jean-Marc Lasgouttes:
 
 On my oldish MacOS 10.7 machine, I get no svg at all. What am I
 supposed to do to get it to work ? Qt version is 4.8.6.
 
 
 Do you run LyX from the build tree? (note that the SVGs are not yet
 installed with autotools).
 
 You are right of course. I read about it, but it did not stick in my
 leaky brain.
 
 It works when running from build tree.
 
 I do not have time for automake now, but I will do it on monday if
 nobdy beats me to it.

I did that at 8fbe17c4.

-- 
Enrico


Re: [patch] Prefer svg icons

2015-03-14 Thread Jean-Marc Lasgouttes

Le 13/03/15 17:35, Jürgen Spitzmüller a écrit :

2015-03-13 17:33 GMT+01:00 Enrico Forestieri:

Fine. So, it is due to the fact that the icons are compressed. This
seems
to be something similar to what I was experiencing. I discovered another
place in the sources where an uncompressed file gets a wrong extension.
I've just committed a patch correcting this. Please, revert the changes
to the sources (such that to use compressed svg icons again), update
form the repo and try whether this last change helps.


Yes, it works now.


On my oldish MacOS 10.7 machine, I get no svg at all. What am I supposed 
to do to get it to work ? Qt version is 4.8.6.


JMarc



Re: [patch] Prefer svg icons

2015-03-14 Thread Jean-Marc Lasgouttes

Le 14/03/15 17:43, Jürgen Spitzmüller a écrit :

2015-03-14 17:40 GMT+01:00 Jean-Marc Lasgouttes:

On my oldish MacOS 10.7 machine, I get no svg at all. What am I
supposed to do to get it to work ? Qt version is 4.8.6.


Do you run LyX from the build tree? (note that the SVGs are not yet
installed with autotools).


You are right of course. I read about it, but it did not stick in my 
leaky brain.


It works when running from build tree.

I do not have time for automake now, but I will do it on monday if nobdy 
beats me to it.


JMarc



Re: [patch] Prefer svg icons

2015-03-14 Thread Jürgen Spitzmüller
2015-03-14 17:40 GMT+01:00 Jean-Marc Lasgouttes:

 On my oldish MacOS 10.7 machine, I get no svg at all. What am I supposed
 to do to get it to work ? Qt version is 4.8.6.


Do you run LyX from the build tree? (note that the SVGs are not yet
installed with autotools).

Jürgen




 JMarc




Re: [patch] Prefer svg icons

2015-03-14 Thread Jean-Marc Lasgouttes

Le 13/03/15 17:35, Jürgen Spitzmüller a écrit :

2015-03-13 17:33 GMT+01:00 Enrico Forestieri:

Fine. So, it is due to the fact that the icons are compressed. This
seems
to be something similar to what I was experiencing. I discovered another
place in the sources where an uncompressed file gets a wrong extension.
I've just committed a patch correcting this. Please, revert the changes
to the sources (such that to use compressed svg icons again), update
form the repo and try whether this last change helps.


Yes, it works now.


On my oldish MacOS 10.7 machine, I get no svg at all. What am I supposed 
to do to get it to work ? Qt version is 4.8.6.


JMarc



Re: [patch] Prefer svg icons

2015-03-14 Thread Jürgen Spitzmüller
2015-03-14 17:40 GMT+01:00 Jean-Marc Lasgouttes:

> On my oldish MacOS 10.7 machine, I get no svg at all. What am I supposed
> to do to get it to work ? Qt version is 4.8.6.
>

Do you run LyX from the build tree? (note that the SVGs are not yet
installed with autotools).

Jürgen



>
> JMarc
>
>


Re: [patch] Prefer svg icons

2015-03-14 Thread Jean-Marc Lasgouttes

Le 14/03/15 17:43, Jürgen Spitzmüller a écrit :

2015-03-14 17:40 GMT+01:00 Jean-Marc Lasgouttes:

On my oldish MacOS 10.7 machine, I get no svg at all. What am I
supposed to do to get it to work ? Qt version is 4.8.6.


Do you run LyX from the build tree? (note that the SVGs are not yet
installed with autotools).


You are right of course. I read about it, but it did not stick in my 
leaky brain.


It works when running from build tree.

I do not have time for automake now, but I will do it on monday if nobdy 
beats me to it.


JMarc



Re: [patch] Prefer svg icons

2015-03-14 Thread Enrico Forestieri
On Sat, Mar 14, 2015 at 05:58:25PM +0100, Jean-Marc Lasgouttes wrote:

> Le 14/03/15 17:43, Jürgen Spitzmüller a écrit :
> >2015-03-14 17:40 GMT+01:00 Jean-Marc Lasgouttes:
> >
> >On my oldish MacOS 10.7 machine, I get no svg at all. What am I
> >supposed to do to get it to work ? Qt version is 4.8.6.
> >
> >
> >Do you run LyX from the build tree? (note that the SVGs are not yet
> >installed with autotools).
> 
> You are right of course. I read about it, but it did not stick in my
> leaky brain.
> 
> It works when running from build tree.
> 
> I do not have time for automake now, but I will do it on monday if
> nobdy beats me to it.

I did that at 8fbe17c4.

-- 
Enrico


Re: [patch] Prefer svg icons

2015-03-13 Thread Enrico Forestieri
On Fri, Mar 13, 2015 at 05:52:51PM +0100, Kornel Benko wrote:
 Am Freitag, 13. März 2015 um 17:38:22, schrieb Enrico Forestieri 
 for...@lyx.org
  Can you write to the directory where LyX gets installed?
 
 No.

Ok. This doesn't matter anymore, though, given that it is now fixed.

-- 
Enrico


Re: [patch] Prefer svg icons

2015-03-13 Thread Jürgen Spitzmüller
2015-03-13 11:24 GMT+01:00 Jürgen Spitzmüller:

 I don't know if you are aware of it: master now crashes when you load f.
 ex. splash.lyx (which contains an icon info-inset).


Here's the bt:

#0  0x082a980d in lyx::ParagraphMetrics::insetDimension(lyx::Inset const*)
const (__k=synthetic pointer, __y=0x9904370, __x=0x76, this=0x990436c)
at /usr/include/c++/4.8/bits/stl_tree.h:1157
#1  0x082a980d in lyx::ParagraphMetrics::insetDimension(lyx::Inset const*)
const (__k=synthetic pointer, this=0x990436c)
at /usr/include/c++/4.8/bits/stl_tree.h:1805
#2  0x082a980d in lyx::ParagraphMetrics::insetDimension(lyx::Inset const*)
const (__x=synthetic pointer, this=0x990436c)
at /usr/include/c++/4.8/bits/stl_map.h:837
#3  0x082a980d in lyx::ParagraphMetrics::insetDimension(lyx::Inset const*)
const (__x=synthetic pointer, this=0x990436c)
at /usr/include/c++/4.8/debug/map.h:386
#4  0x082a980d in lyx::ParagraphMetrics::insetDimension(lyx::Inset const*)
const (this=0x990433c, inset=0x98661c8) at ParagraphMetrics.cpp:124
#5  0x0831877f in lyx::TextMetrics::redoParagraph(int)
(this=this@entry=0x9904294,
pit=0) at TextMetrics.cpp:449
#6  0x0831900d in lyx::TextMetrics::metrics(lyx::MetricsInfo,
lyx::Dimension, int) (this=this@entry=0x9904294, mi=..., dim=...,
min_width=min_width@entry=0)
at TextMetrics.cpp:200
#7  0x085bf4e6 in lyx::InsetText::metrics(lyx::MetricsInfo,
lyx::Dimension) const (this=this@entry=0x9864c18, mi=..., dim=...) at
insets/InsetText.cpp:206
#8  0x084d8146 in lyx::InsetCollapsable::metrics(lyx::MetricsInfo,
lyx::Dimension) const (this=0x9864c18, mi=..., dim=...) at
insets/InsetCollapsable.cpp:199
---Type return to continue, or q return to quit---
#9  0x0831870f in lyx::TextMetrics::redoParagraph(int)
(this=this@entry=0x97ef32c,
pit=4) at TextMetrics.cpp:448
#10 0x0836439e in lyx::BufferView::updateMetrics() (this=0x97eef00)
at BufferView.cpp:2722
#11 0x08654cc3 in lyx::frontend::GuiWorkArea::redraw(bool) (this=0x8e685b8,
update_metrics=true) at GuiWorkArea.cpp:475
#12 0x08650cf4 in lyx::frontend::TabWorkArea::on_currentTabChanged(int)
(this=this@entry=0x986a128, i=0) at GuiWorkArea.cpp:1771
#13 0x0865941e in lyx::frontend::TabWorkArea::qt_static_metacall(QObject*,
QMetaObject::Call, int, void**) (_o=0x986a128,
_c=QMetaObject::InvokeMetaMethod, _id=6, _a=0xbfffca88) at
moc_GuiWorkArea.cpp:244
#14 0x in QMetaObject::activate(QObject*, QMetaObject const*, int,
void**) () at /usr/lib/libQtCore.so.4
#15 0x in QTabWidget::currentChanged(int) () at
/usr/lib/libQtGui.so.4
#16 0x in  () at /usr/lib/libQtGui.so.4
#17 0x in  () at /usr/lib/libQtGui.so.4
#18 0x in QMetaObject::activate(QObject*, QMetaObject const*, int,
void**) () at /usr/lib/libQtCore.so.4
#19 0x in QTabBar::currentChanged(int) () at /usr/lib/libQtGui.so.4
#20 0x in QTabBar::setCurrentIndex(int) () at /usr/lib/libQtGui.so.4
#21 0x in QTabBar::insertTab(int, QIcon const, QString const) ()
at /usr/lib/libQtGui.so.4
#22 0x in QTabWidget::insertTab(int, QWidget*, QIcon const,
QString con---Type return to continue, or q return to quit---
st) () at /usr/lib/libQtGui.so.4
#23 0x in QTabWidget::insertTab(int, QWidget*, QString const) ()
at /usr/lib/libQtGui.so.4
#24 0x in QTabWidget::addTab(QWidget*, QString const) ()
at /usr/lib/libQtGui.so.4
#25 0x086584ca in lyx::frontend::TabWorkArea::addWorkArea(lyx::Buffer,
lyx::frontend::GuiView) (this=this@entry=0x986a128, buffer=..., view=...)
at GuiWorkArea.cpp:1720
#26 0x0861ef8c in lyx::frontend::GuiView::addWorkArea(lyx::Buffer)
(this=this@entry=0x91037a8, buffer=...) at GuiView.cpp:1312
#27 0x086287ce in lyx::frontend::GuiView::setBuffer(lyx::Buffer*)
(this=this@entry=0x91037a8, newBuffer=newBuffer@entry=0x929b450) at
GuiView.cpp:1499
#28 0x0862897e in
lyx::frontend::GuiView::loadDocument(lyx::support::FileName const, bool)
(this=this@entry=0x91037a8,
filename=..., tolastfiles=tolastfiles@entry=true) at GuiView.cpp:2011
#29 0x0862a8a9 in lyx::frontend::GuiView::openDocument(std::string const)
(this=0x91037a8,
fname=/home/jspitz/lyx/lyx-devel/lib/examples/de/splash.lyx)
at GuiView.cpp:2086
#30 0x08600fc9 in lyx::frontend::GuiApplication::dispatch(lyx::FuncRequest
const, lyx::DispatchResult) (this=0x8cba020, cmd=..., dr=...)
at GuiApplication.cpp:1637
#31 0x085f2e52 in lyx::frontend::GuiApplication::dispatch(lyx::FuncRequest
const) (this=0x8cba020, cmd=...) at GuiApplication.cpp:1361
---Type return to continue, or q return to quit---
#32 0x08230194 in lyx::dispatch(lyx::FuncRequest const) (action=...)
at LyX.cpp:1360
#33 0x086a1b31 in lyx::frontend::Action::action() (this=this@entry
=0x9033bc8)
at Action.cpp:65
#34 0x086a1bb7 in lyx::frontend::Action::qt_static_metacall(QObject*,
QMetaObject::Call, int, void**) (_o=0x9033bc8,
_c=QMetaObject::InvokeMetaMethod, _id=1, _a=0xbfffe218) at moc_Action.cpp:53
#35 0x in QMetaObject::activate(QObject*, QMetaObject 

Re: [patch] Prefer svg icons

2015-03-13 Thread Jürgen Spitzmüller
2015-03-13 0:06 GMT+01:00 Enrico Forestieri:

 On Thu, Mar 12, 2015 at 11:22:12AM +0100, Kornel Benko wrote:
 
  Funny, I missed this message. Sorry for the delay.
  To answer:
I installed the files directly, so no need for symlink.
  But from the recent posts, it may be because the directory is not
 writeable.
  Will check ...
  Looks like it works.

 Thanks for testing.


I don't know if you are aware of it: master now crashes when you load f.
ex. splash.lyx (which contains an icon info-inset).

Jürgen



 --
 Enrico



Re: [patch] Prefer svg icons

2015-03-13 Thread Enrico Forestieri
On Fri, Mar 13, 2015 at 12:17:02PM +0100, Kornel Benko wrote:
 Am Freitag, 13. März 2015 um 11:24:10, schrieb Jürgen Spitzmüller 
 sp...@lyx.org
  
  I don't know if you are aware of it: master now crashes when you load f.
  ex. splash.lyx (which contains an icon info-inset).
  
  Jürgen
 
 I have no problems with that. The icon buffer-view in text is inverted here.

Note that LyX cashes images, so that may be the cause. To make certain,
close the document, go to Tools-Preferences-File Handling-Converters
and uncheck the Enabled checkbox in Converters File Cache. Then, reload
the document. If everything is Ok, you have to find the cached image in
~/.lyx/cache, remove the file and the corresponding entry in
~/.lyx/cache/index. Or, more simply, do rm -f .lyx/cache/*, being aware
that you will loose all cached images in this case.

-- 
Enrico


Re: [patch] Prefer svg icons

2015-03-13 Thread Enrico Forestieri
On Fri, Mar 13, 2015 at 02:54:12PM +0100, Kornel Benko wrote:
 Am Freitag, 13. März 2015 um 14:41:26, schrieb Enrico Forestieri 
 for...@lyx.org
  
  What happens if you include the exact same icon in a graphics inset?
  I mean, insert a graphic and load 
  srcdir/lib/images/oxygen/buffer-view.svgz
  
 
 Looks the same if setting the scale to 17%

Needless to say that I cannot reproduce. maybe something in your converters
machinery? Try starting with a fresh user dir, i.e., remove your ~/.lyx2.2
directory and relaunch lyx.

-- 
Enrico


Re: [patch] Prefer svg icons

2015-03-13 Thread Enrico Forestieri
On Fri, Mar 13, 2015 at 03:27:06PM +0100, Kornel Benko wrote:
 
 Also interesting is the console-output (from the build tree):
 
 1.67 amd64.kornel 15:22  ./bin/lyx2.2
 Could not resolve property : linearGradient5167
 Could not resolve property : pattern5614
 Could not resolve property : pattern5626
 couldn't create image from  
 /home/david/Oxygen/trunk/32x32/actions/edit-copy.png
 couldn't create image from  
 /home/david/Oxygen/trunk/32x32/actions/edit-paste.png
 link XMLID_34_ hasn't been detected!
 link XMLID_34_ hasn't been detected!
 link XMLID_36_ hasn't been detected!
 link XMLID_34_ hasn't been detected!
 link XMLID_34_ hasn't been detected!
 link XMLID_36_ hasn't been detected!
 link use5411 hasn't been detected!
 Could not resolve property : pattern6080
 Could not resolve property : pattern5633
 
 Where does '/home/david' came from?

From one of the icons. A bitmap can be either embedded or linked into
the svg. In this case it seems that a bitmap was linked and that is
the location where it was when the svg was generated.

-- 
Enrico


Re: [patch] Prefer svg icons

2015-03-13 Thread Kornel Benko
Am Freitag, 13. März 2015 um 14:54:12, schrieb Kornel Benko kor...@lyx.org
 Am Freitag, 13. März 2015 um 14:41:26, schrieb Enrico Forestieri 
 for...@lyx.org
  On Fri, Mar 13, 2015 at 02:20:46PM +0100, Kornel Benko wrote:
   Am Freitag, 13. März 2015 um 14:06:20, schrieb Enrico Forestieri 
   for...@lyx.org
On Fri, Mar 13, 2015 at 12:17:02PM +0100, Kornel Benko wrote:
 Am Freitag, 13. März 2015 um 11:24:10, schrieb Jürgen Spitzmüller 
 sp...@lyx.org
  
  I don't know if you are aware of it: master now crashes when you 
  load f.
  ex. splash.lyx (which contains an icon info-inset).
  
  Jürgen
 
 I have no problems with that. The icon buffer-view in text is 
 inverted here.

Note that LyX cashes images, so that may be the cause. To make certain,
close the document, go to Tools-Preferences-File Handling-Converters
and uncheck the Enabled checkbox in Converters File Cache. Then, 
reload
the document. If everything is Ok, you have to find the cached image in
~/.lyx/cache, remove the file and the corresponding entry in
~/.lyx/cache/index. Or, more simply, do rm -f .lyx/cache/*, being 
aware
that you will loose all cached images in this case.

   
   Did that. No crash. Still inverted icon in text.
  
  What happens if you include the exact same icon in a graphics inset?
  I mean, insert a graphic and load 
  srcdir/lib/images/oxygen/buffer-view.svgz
  
 
 Looks the same if setting the scale to 17%
 

Also interesting is the console-output (from the build tree):

1.67 amd64.kornel 15:22  ./bin/lyx2.2
Could not resolve property : linearGradient5167
Could not resolve property : pattern5614
Could not resolve property : pattern5626
couldn't create image from  
/home/david/Oxygen/trunk/32x32/actions/edit-copy.png
couldn't create image from  
/home/david/Oxygen/trunk/32x32/actions/edit-paste.png
link XMLID_34_ hasn't been detected!
link XMLID_34_ hasn't been detected!
link XMLID_36_ hasn't been detected!
link XMLID_34_ hasn't been detected!
link XMLID_34_ hasn't been detected!
link XMLID_36_ hasn't been detected!
link use5411 hasn't been detected!
Could not resolve property : pattern6080
Could not resolve property : pattern5633

Where does '/home/david' came from?

Kornel


signature.asc
Description: This is a digitally signed message part.


Re: [patch] Prefer svg icons

2015-03-13 Thread Enrico Forestieri
On Fri, Mar 13, 2015 at 02:37:04PM +0100, Jürgen Spitzmüller wrote:
 2015-03-13 14:33 GMT+01:00 Enrico Forestieri:
 
  I cannot reproduce. I thought that maybe that happens when using the
  oxygen set, but even after switching to that I have no problems.
 
 
 I use the standard set.
 
 
  Please, try to also move away ~/.config/LyX/lyxsuffix.conf
  and see whether that makes any difference.
 
 
 No, still crashes.

Ok. Let's see whether it works with uncompressed svg icons.
Please, launch the attached script and then recompile. The script
converts all svgz icons to svg ones and makes the necessary
modifications to the sources. Does it work now?

-- 
Enrico


svgz2svg.sh
Description: Bourne shell script


Re: [patch] Prefer svg icons

2015-03-13 Thread Jürgen Spitzmüller
2015-03-13 13:58 GMT+01:00 Enrico Forestieri:

 I have experienced a strange crash like that with the tutorial. It was
 occurring systematically each time I was opening it. I observed that
 it seems to happen if you had previously opened that file and closed
 it when the cursor was on the line containing the info inset. The cure
 is editing the ~/.lyx/session file and, only in the [cursor positions]
 stanza, deleting the line corresponding to that document. After doing
 that, reopening and closing the document (even leaving the cursor on
 the same line containing the info inset), did not trigger the crash
 anymore. Then, I did not investigate further, classifying this as one
 the mysteries I faced with this switch to svg.


This did not help in my case. I even ditched the session file completely,
but LyX still crashes.

Jürgen



 --
 Enrico



Re: [patch] Prefer svg icons

2015-03-13 Thread Kornel Benko
Am Freitag, 13. März 2015 um 14:06:20, schrieb Enrico Forestieri 
for...@lyx.org
 On Fri, Mar 13, 2015 at 12:17:02PM +0100, Kornel Benko wrote:
  Am Freitag, 13. März 2015 um 11:24:10, schrieb Jürgen Spitzmüller 
  sp...@lyx.org
  
   I don't know if you are aware of it: master now crashes when you load f.
   ex. splash.lyx (which contains an icon info-inset).
  
   Jürgen
 
  I have no problems with that. The icon buffer-view in text is inverted 
  here.

 Note that LyX cashes images, so that may be the cause. To make certain,
 close the document, go to Tools-Preferences-File Handling-Converters
 and uncheck the Enabled checkbox in Converters File Cache. Then, reload
 the document. If everything is Ok, you have to find the cached image in
 ~/.lyx/cache, remove the file and the corresponding entry in
 ~/.lyx/cache/index. Or, more simply, do rm -f .lyx/cache/*, being aware
 that you will loose all cached images in this case.


Did that. No crash. Still inverted icon in text.

Kornel

signature.asc
Description: This is a digitally signed message part.


Re: [patch] Prefer svg icons

2015-03-13 Thread Jürgen Spitzmüller
2015-03-13 14:06 GMT+01:00 Enrico Forestieri:

 Note that LyX cashes images, so that may be the cause. To make certain,
 close the document, go to Tools-Preferences-File Handling-Converters
 and uncheck the Enabled checkbox in Converters File Cache. Then, reload
 the document. If everything is Ok, you have to find the cached image in
 ~/.lyx/cache, remove the file and the corresponding entry in
 ~/.lyx/cache/index. Or, more simply, do rm -f .lyx/cache/*, being aware
 that you will loose all cached images in this case.


Did not help either.
Note that LyX master is not installed, I run from the build tree, if this
might be relevant.

Jürgen



 --
 Enrico



Re: [patch] Prefer svg icons

2015-03-13 Thread Enrico Forestieri
On Fri, Mar 13, 2015 at 11:24:10AM +0100, Jürgen Spitzmüller wrote:
 2015-03-13 0:06 GMT+01:00 Enrico Forestieri:
 
  On Thu, Mar 12, 2015 at 11:22:12AM +0100, Kornel Benko wrote:
  
   Funny, I missed this message. Sorry for the delay.
   To answer:
 I installed the files directly, so no need for symlink.
   But from the recent posts, it may be because the directory is not
  writeable.
   Will check ...
   Looks like it works.
 
  Thanks for testing.
 
 
 I don't know if you are aware of it: master now crashes when you load f.
 ex. splash.lyx (which contains an icon info-inset).

I have experienced a strange crash like that with the tutorial. It was
occurring systematically each time I was opening it. I observed that
it seems to happen if you had previously opened that file and closed
it when the cursor was on the line containing the info inset. The cure
is editing the ~/.lyx/session file and, only in the [cursor positions]
stanza, deleting the line corresponding to that document. After doing
that, reopening and closing the document (even leaving the cursor on
the same line containing the info inset), did not trigger the crash
anymore. Then, I did not investigate further, classifying this as one
the mysteries I faced with this switch to svg.

-- 
Enrico


Re: [patch] Prefer svg icons

2015-03-13 Thread Jürgen Spitzmüller
2015-03-13 15:32 GMT+01:00 Enrico Forestieri for...@lyx.org:

 Ok. Let's see whether it works with uncompressed svg icons.
 Please, launch the attached script and then recompile. The script
 converts all svgz icons to svg ones and makes the necessary
 modifications to the sources. Does it work now?


Yes, this works. The icon is also displayed as Iit should.

Jürgen



 --
 Enrico



Re: [patch] Prefer svg icons

2015-03-13 Thread Kornel Benko
Am Freitag, 13. März 2015 um 14:37:04, schrieb Jürgen Spitzmüller 
sp...@lyx.org
 2015-03-13 14:33 GMT+01:00 Enrico Forestieri:
 
  I cannot reproduce. I thought that maybe that happens when using the
  oxygen set, but even after switching to that I have no problems.
 
 
 I use the standard set.
 
 
  Please, try to also move away ~/.config/LyX/lyxsuffix.conf
  and see whether that makes any difference.
 
 
 No, still crashes.
 
 Jürgen
 
 

And now it crashes here too. But only the installed version using my own 
userdir.

Created new userdir.
Until I copied old session + session.cmake there was no crash. From then on I 
get crash always
loading splash.lyx, it does not matter, if I remove session* or not.
Also removing cache content does not help.

Kornel


signature.asc
Description: This is a digitally signed message part.


Re: [patch] Prefer svg icons

2015-03-13 Thread Jürgen Spitzmüller
2015-03-13 14:33 GMT+01:00 Enrico Forestieri:

 I cannot reproduce. I thought that maybe that happens when using the
 oxygen set, but even after switching to that I have no problems.


I use the standard set.


 Please, try to also move away ~/.config/LyX/lyxsuffix.conf
 and see whether that makes any difference.


No, still crashes.

Jürgen



 --
 Enrico



Re: [patch] Prefer svg icons

2015-03-13 Thread Enrico Forestieri
On Fri, Mar 13, 2015 at 02:20:46PM +0100, Kornel Benko wrote:
 Am Freitag, 13. März 2015 um 14:06:20, schrieb Enrico Forestieri 
 for...@lyx.org
  On Fri, Mar 13, 2015 at 12:17:02PM +0100, Kornel Benko wrote:
   Am Freitag, 13. März 2015 um 11:24:10, schrieb Jürgen Spitzmüller 
   sp...@lyx.org

I don't know if you are aware of it: master now crashes when you load f.
ex. splash.lyx (which contains an icon info-inset).

Jürgen
   
   I have no problems with that. The icon buffer-view in text is inverted 
   here.
  
  Note that LyX cashes images, so that may be the cause. To make certain,
  close the document, go to Tools-Preferences-File Handling-Converters
  and uncheck the Enabled checkbox in Converters File Cache. Then, reload
  the document. If everything is Ok, you have to find the cached image in
  ~/.lyx/cache, remove the file and the corresponding entry in
  ~/.lyx/cache/index. Or, more simply, do rm -f .lyx/cache/*, being aware
  that you will loose all cached images in this case.
  
 
 Did that. No crash. Still inverted icon in text.

What happens if you include the exact same icon in a graphics inset?
I mean, insert a graphic and load srcdir/lib/images/oxygen/buffer-view.svgz

-- 
Enrico


Re: [patch] Prefer svg icons

2015-03-13 Thread Jürgen Spitzmüller
2015-03-13 14:41 GMT+01:00 Enrico Forestieri:

 What happens if you include the exact same icon in a graphics inset?
 I mean, insert a graphic and load
 srcdir/lib/images/oxygen/buffer-view.svgz


This does not crash.

Jürgen



 --
 Enrico



Re: [patch] Prefer svg icons

2015-03-13 Thread Enrico Forestieri
On Fri, Mar 13, 2015 at 02:07:47PM +0100, Jürgen Spitzmüller wrote:
 2015-03-13 13:58 GMT+01:00 Enrico Forestieri:
 
  I have experienced a strange crash like that with the tutorial. It was
  occurring systematically each time I was opening it. I observed that
  it seems to happen if you had previously opened that file and closed
  it when the cursor was on the line containing the info inset. The cure
  is editing the ~/.lyx/session file and, only in the [cursor positions]
  stanza, deleting the line corresponding to that document. After doing
  that, reopening and closing the document (even leaving the cursor on
  the same line containing the info inset), did not trigger the crash
  anymore. Then, I did not investigate further, classifying this as one
  the mysteries I faced with this switch to svg.
 
 
 This did not help in my case. I even ditched the session file completely,
 but LyX still crashes.

I cannot reproduce. I thought that maybe that happens when using the
oxygen set, but even after switching to that I have no problems.
Please, try to also move away ~/.config/LyX/lyxsuffix.conf
and see whether that makes any difference.

-- 
Enrico


Re: [patch] Prefer svg icons

2015-03-13 Thread Jürgen Spitzmüller
2015-03-13 17:33 GMT+01:00 Enrico Forestieri:

 Fine. So, it is due to the fact that the icons are compressed. This seems
 to be something similar to what I was experiencing. I discovered another
 place in the sources where an uncompressed file gets a wrong extension.
 I've just committed a patch correcting this. Please, revert the changes
 to the sources (such that to use compressed svg icons again), update
 form the repo and try whether this last change helps.


Yes, it works now.

Thanks!
Jürgen




 --
 Enrico



Re: [patch] Prefer svg icons

2015-03-13 Thread Enrico Forestieri
On Fri, Mar 13, 2015 at 04:37:07PM +0100, Kornel Benko wrote:
 Am Freitag, 13. März 2015 um 14:37:04, schrieb Jürgen Spitzmüller 
 sp...@lyx.org
  2015-03-13 14:33 GMT+01:00 Enrico Forestieri:
  
   I cannot reproduce. I thought that maybe that happens when using the
   oxygen set, but even after switching to that I have no problems.
  
  
  I use the standard set.
  
  
   Please, try to also move away ~/.config/LyX/lyxsuffix.conf
   and see whether that makes any difference.
  
  
  No, still crashes.
  
  Jürgen
  
  
 
 And now it crashes here too. But only the installed version using my own
 userdir.

Do you mean that if you do not install, then it doesn't crash?
Can you write to the directory where LyX gets installed?
If not, then there must be some other instance in the sources
where a temporary file is created in the wrong place.

 Created new userdir.
 Until I copied old session + session.cmake there was no crash. From then on I
 get crash always

What is session.cmake?

-- 
Enrico


Re: [patch] Prefer svg icons

2015-03-13 Thread Enrico Forestieri
On Fri, Mar 13, 2015 at 04:29:19PM +0100, Jürgen Spitzmüller wrote:
 2015-03-13 15:32 GMT+01:00 Enrico Forestieri for...@lyx.org:
 
  Ok. Let's see whether it works with uncompressed svg icons.
  Please, launch the attached script and then recompile. The script
  converts all svgz icons to svg ones and makes the necessary
  modifications to the sources. Does it work now?
 
 
 Yes, this works. The icon is also displayed as Iit should.

Fine. So, it is due to the fact that the icons are compressed. This seems
to be something similar to what I was experiencing. I discovered another
place in the sources where an uncompressed file gets a wrong extension.
I've just committed a patch correcting this. Please, revert the changes
to the sources (such that to use compressed svg icons again), update
form the repo and try whether this last change helps.

-- 
Enrico


Re: [patch] Prefer svg icons

2015-03-13 Thread Enrico Forestieri
On Fri, Mar 13, 2015 at 05:35:47PM +0100, Jürgen Spitzmüller wrote:
 2015-03-13 17:33 GMT+01:00 Enrico Forestieri:
 
  Fine. So, it is due to the fact that the icons are compressed. This seems
  to be something similar to what I was experiencing. I discovered another
  place in the sources where an uncompressed file gets a wrong extension.
  I've just committed a patch correcting this. Please, revert the changes
  to the sources (such that to use compressed svg icons again), update
  form the repo and try whether this last change helps.
 
 
 Yes, it works now.

Damn'd file format recognition through extension only.
I would have expected that on Windows, not on Linux. Sigh.

-- 
Enrico


Re: [patch] Prefer svg icons

2015-03-13 Thread Kornel Benko
Am Freitag, 13. März 2015 um 17:38:22, schrieb Enrico Forestieri 
for...@lyx.org
 On Fri, Mar 13, 2015 at 04:37:07PM +0100, Kornel Benko wrote:
  Am Freitag, 13. März 2015 um 14:37:04, schrieb Jürgen Spitzmüller 
  sp...@lyx.org
   2015-03-13 14:33 GMT+01:00 Enrico Forestieri:
  
I cannot reproduce. I thought that maybe that happens when using the
oxygen set, but even after switching to that I have no problems.
   
  
   I use the standard set.
  
  
Please, try to also move away ~/.config/LyX/lyxsuffix.conf
and see whether that makes any difference.
   
  
   No, still crashes.
  
   Jürgen
  
  
 
  And now it crashes here too. But only the installed version using my own
  userdir.

 Do you mean that if you do not install, then it doesn't crash?
 Can you write to the directory where LyX gets installed?
 If not, then there must be some other instance in the sources
 where a temporary file is created in the wrong place.

It was due to the fact, that using from build tree I do not set userdir.

  Created new userdir.
  Until I copied old session + session.cmake there was no crash. From then on 
  I
  get crash always

 What is session.cmake?


Automatically created, see attached.
Anyway, it does not crash with the latest commit. Moreover, the icons are not 
reversed.

Kornel

signature.asc
Description: This is a digitally signed message part.
## Automatically generated lyx session file 
## Editing this file manually may cause lyx to crash.

[recent files]
/usr/src/lyx/lyx-git/lib/examples/splash.lyx
/usr/local/lyx2.2/examples/splash.lyx

[last opened files]
1, /usr/src/lyx/lyx-git/lib/examples/splash.lyx

[cursor positions]
0, 5, /usr/local/lyx2.2/examples/splash.lyx
0, 0, /usr/src/lyx/lyx-git/lib/examples/splash.lyx

[last commands]

[bookmarks]


Re: [patch] Prefer svg icons

2015-03-13 Thread Kornel Benko
Am Freitag, 13. März 2015 um 17:38:22, schrieb Enrico Forestieri 
for...@lyx.org
 Can you write to the directory where LyX gets installed?

No.

Kornel

signature.asc
Description: This is a digitally signed message part.


Re: [patch] Prefer svg icons

2015-03-13 Thread Jürgen Spitzmüller
2015-03-13 0:06 GMT+01:00 Enrico Forestieri:

> On Thu, Mar 12, 2015 at 11:22:12AM +0100, Kornel Benko wrote:
> >
> > Funny, I missed this message. Sorry for the delay.
> > To answer:
> >   I installed the files directly, so no need for symlink.
> > But from the recent posts, it may be because the directory is not
> writeable.
> > Will check ...
> > Looks like it works.
>
> Thanks for testing.
>

I don't know if you are aware of it: master now crashes when you load f.
ex. splash.lyx (which contains an icon info-inset).

Jürgen


>
> --
> Enrico
>


Re: [patch] Prefer svg icons

2015-03-13 Thread Jürgen Spitzmüller
2015-03-13 11:24 GMT+01:00 Jürgen Spitzmüller:

> I don't know if you are aware of it: master now crashes when you load f.
> ex. splash.lyx (which contains an icon info-inset).
>

Here's the bt:

#0  0x082a980d in lyx::ParagraphMetrics::insetDimension(lyx::Inset const*)
const (__k=, __y=0x9904370, __x=0x76, this=0x990436c)
at /usr/include/c++/4.8/bits/stl_tree.h:1157
#1  0x082a980d in lyx::ParagraphMetrics::insetDimension(lyx::Inset const*)
const (__k=, this=0x990436c)
at /usr/include/c++/4.8/bits/stl_tree.h:1805
#2  0x082a980d in lyx::ParagraphMetrics::insetDimension(lyx::Inset const*)
const (__x=, this=0x990436c)
at /usr/include/c++/4.8/bits/stl_map.h:837
#3  0x082a980d in lyx::ParagraphMetrics::insetDimension(lyx::Inset const*)
const (__x=, this=0x990436c)
at /usr/include/c++/4.8/debug/map.h:386
#4  0x082a980d in lyx::ParagraphMetrics::insetDimension(lyx::Inset const*)
const (this=0x990433c, inset=0x98661c8) at ParagraphMetrics.cpp:124
#5  0x0831877f in lyx::TextMetrics::redoParagraph(int)
(this=this@entry=0x9904294,
pit=0) at TextMetrics.cpp:449
#6  0x0831900d in lyx::TextMetrics::metrics(lyx::MetricsInfo&,
lyx::Dimension&, int) (this=this@entry=0x9904294, mi=..., dim=...,
min_width=min_width@entry=0)
at TextMetrics.cpp:200
#7  0x085bf4e6 in lyx::InsetText::metrics(lyx::MetricsInfo&,
lyx::Dimension&) const (this=this@entry=0x9864c18, mi=..., dim=...) at
insets/InsetText.cpp:206
#8  0x084d8146 in lyx::InsetCollapsable::metrics(lyx::MetricsInfo&,
lyx::Dimension&) const (this=0x9864c18, mi=..., dim=...) at
insets/InsetCollapsable.cpp:199
---Type  to continue, or q  to quit---
#9  0x0831870f in lyx::TextMetrics::redoParagraph(int)
(this=this@entry=0x97ef32c,
pit=4) at TextMetrics.cpp:448
#10 0x0836439e in lyx::BufferView::updateMetrics() (this=0x97eef00)
at BufferView.cpp:2722
#11 0x08654cc3 in lyx::frontend::GuiWorkArea::redraw(bool) (this=0x8e685b8,
update_metrics=true) at GuiWorkArea.cpp:475
#12 0x08650cf4 in lyx::frontend::TabWorkArea::on_currentTabChanged(int)
(this=this@entry=0x986a128, i=0) at GuiWorkArea.cpp:1771
#13 0x0865941e in lyx::frontend::TabWorkArea::qt_static_metacall(QObject*,
QMetaObject::Call, int, void**) (_o=0x986a128,
_c=QMetaObject::InvokeMetaMethod, _id=6, _a=0xbfffca88) at
moc_GuiWorkArea.cpp:244
#14 0x in QMetaObject::activate(QObject*, QMetaObject const*, int,
void**) () at /usr/lib/libQtCore.so.4
#15 0x in QTabWidget::currentChanged(int) () at
/usr/lib/libQtGui.so.4
#16 0x in  () at /usr/lib/libQtGui.so.4
#17 0x in  () at /usr/lib/libQtGui.so.4
#18 0x in QMetaObject::activate(QObject*, QMetaObject const*, int,
void**) () at /usr/lib/libQtCore.so.4
#19 0x in QTabBar::currentChanged(int) () at /usr/lib/libQtGui.so.4
#20 0x in QTabBar::setCurrentIndex(int) () at /usr/lib/libQtGui.so.4
#21 0x in QTabBar::insertTab(int, QIcon const&, QString const&) ()
at /usr/lib/libQtGui.so.4
#22 0x in QTabWidget::insertTab(int, QWidget*, QIcon const&,
QString con---Type  to continue, or q  to quit---
st&) () at /usr/lib/libQtGui.so.4
#23 0x in QTabWidget::insertTab(int, QWidget*, QString const&) ()
at /usr/lib/libQtGui.so.4
#24 0x in QTabWidget::addTab(QWidget*, QString const&) ()
at /usr/lib/libQtGui.so.4
#25 0x086584ca in lyx::frontend::TabWorkArea::addWorkArea(lyx::Buffer&,
lyx::frontend::GuiView&) (this=this@entry=0x986a128, buffer=..., view=...)
at GuiWorkArea.cpp:1720
#26 0x0861ef8c in lyx::frontend::GuiView::addWorkArea(lyx::Buffer&)
(this=this@entry=0x91037a8, buffer=...) at GuiView.cpp:1312
#27 0x086287ce in lyx::frontend::GuiView::setBuffer(lyx::Buffer*)
(this=this@entry=0x91037a8, newBuffer=newBuffer@entry=0x929b450) at
GuiView.cpp:1499
#28 0x0862897e in
lyx::frontend::GuiView::loadDocument(lyx::support::FileName const&, bool)
(this=this@entry=0x91037a8,
filename=..., tolastfiles=tolastfiles@entry=true) at GuiView.cpp:2011
#29 0x0862a8a9 in lyx::frontend::GuiView::openDocument(std::string const&)
(this=0x91037a8,
fname="/home/jspitz/lyx/lyx-devel/lib/examples/de/splash.lyx")
at GuiView.cpp:2086
#30 0x08600fc9 in lyx::frontend::GuiApplication::dispatch(lyx::FuncRequest
const&, lyx::DispatchResult&) (this=0x8cba020, cmd=..., dr=...)
at GuiApplication.cpp:1637
#31 0x085f2e52 in lyx::frontend::GuiApplication::dispatch(lyx::FuncRequest
const&) (this=0x8cba020, cmd=...) at GuiApplication.cpp:1361
---Type  to continue, or q  to quit---
#32 0x08230194 in lyx::dispatch(lyx::FuncRequest const&) (action=...)
at LyX.cpp:1360
#33 0x086a1b31 in lyx::frontend::Action::action() (this=this@entry
=0x9033bc8)
at Action.cpp:65
#34 0x086a1bb7 in lyx::frontend::Action::qt_static_metacall(QObject*,
QMetaObject::Call, int, void**) (_o=0x9033bc8,
_c=QMetaObject::InvokeMetaMethod, _id=1, _a=0xbfffe218) at moc_Action.cpp:53
#35 0x in QMetaObject::activate(QObject*, QMetaObject const*, int,
void**) () at /usr/lib/libQtCore.so.4
#36 0x in 

Re: [patch] Prefer svg icons

2015-03-13 Thread Enrico Forestieri
On Fri, Mar 13, 2015 at 11:24:10AM +0100, Jürgen Spitzmüller wrote:
> 2015-03-13 0:06 GMT+01:00 Enrico Forestieri:
> 
> > On Thu, Mar 12, 2015 at 11:22:12AM +0100, Kornel Benko wrote:
> > >
> > > Funny, I missed this message. Sorry for the delay.
> > > To answer:
> > >   I installed the files directly, so no need for symlink.
> > > But from the recent posts, it may be because the directory is not
> > writeable.
> > > Will check ...
> > > Looks like it works.
> >
> > Thanks for testing.
> >
> 
> I don't know if you are aware of it: master now crashes when you load f.
> ex. splash.lyx (which contains an icon info-inset).

I have experienced a strange crash like that with the tutorial. It was
occurring systematically each time I was opening it. I observed that
it seems to happen if you had previously opened that file and closed
it when the cursor was on the line containing the info inset. The cure
is editing the ~/.lyx/session file and, only in the [cursor positions]
stanza, deleting the line corresponding to that document. After doing
that, reopening and closing the document (even leaving the cursor on
the same line containing the info inset), did not trigger the crash
anymore. Then, I did not investigate further, classifying this as one
the mysteries I faced with this switch to svg.

-- 
Enrico


Re: [patch] Prefer svg icons

2015-03-13 Thread Enrico Forestieri
On Fri, Mar 13, 2015 at 12:17:02PM +0100, Kornel Benko wrote:
> Am Freitag, 13. März 2015 um 11:24:10, schrieb Jürgen Spitzmüller 
> 
> > 
> > I don't know if you are aware of it: master now crashes when you load f.
> > ex. splash.lyx (which contains an icon info-inset).
> > 
> > Jürgen
> 
> I have no problems with that. The icon "buffer-view" in text is inverted here.

Note that LyX cashes images, so that may be the cause. To make certain,
close the document, go to Tools->Preferences->File Handling->Converters
and uncheck the "Enabled" checkbox in "Converters File Cache". Then, reload
the document. If everything is Ok, you have to find the cached image in
~/.lyx/cache, remove the file and the corresponding entry in
~/.lyx/cache/index. Or, more simply, do "rm -f .lyx/cache/*", being aware
that you will loose all cached images in this case.

-- 
Enrico


Re: [patch] Prefer svg icons

2015-03-13 Thread Jürgen Spitzmüller
2015-03-13 13:58 GMT+01:00 Enrico Forestieri:

> I have experienced a strange crash like that with the tutorial. It was
> occurring systematically each time I was opening it. I observed that
> it seems to happen if you had previously opened that file and closed
> it when the cursor was on the line containing the info inset. The cure
> is editing the ~/.lyx/session file and, only in the [cursor positions]
> stanza, deleting the line corresponding to that document. After doing
> that, reopening and closing the document (even leaving the cursor on
> the same line containing the info inset), did not trigger the crash
> anymore. Then, I did not investigate further, classifying this as one
> the mysteries I faced with this switch to svg.
>

This did not help in my case. I even ditched the session file completely,
but LyX still crashes.

Jürgen


>
> --
> Enrico
>


Re: [patch] Prefer svg icons

2015-03-13 Thread Jürgen Spitzmüller
2015-03-13 14:06 GMT+01:00 Enrico Forestieri:

> Note that LyX cashes images, so that may be the cause. To make certain,
> close the document, go to Tools->Preferences->File Handling->Converters
> and uncheck the "Enabled" checkbox in "Converters File Cache". Then, reload
> the document. If everything is Ok, you have to find the cached image in
> ~/.lyx/cache, remove the file and the corresponding entry in
> ~/.lyx/cache/index. Or, more simply, do "rm -f .lyx/cache/*", being aware
> that you will loose all cached images in this case.
>

Did not help either.
Note that LyX master is not installed, I run from the build tree, if this
might be relevant.

Jürgen


>
> --
> Enrico
>


Re: [patch] Prefer svg icons

2015-03-13 Thread Kornel Benko
Am Freitag, 13. März 2015 um 14:06:20, schrieb Enrico Forestieri 

> On Fri, Mar 13, 2015 at 12:17:02PM +0100, Kornel Benko wrote:
> > Am Freitag, 13. März 2015 um 11:24:10, schrieb Jürgen Spitzmüller 
> > 
> > >
> > > I don't know if you are aware of it: master now crashes when you load f.
> > > ex. splash.lyx (which contains an icon info-inset).
> > >
> > > Jürgen
> >
> > I have no problems with that. The icon "buffer-view" in text is inverted 
> > here.
>
> Note that LyX cashes images, so that may be the cause. To make certain,
> close the document, go to Tools->Preferences->File Handling->Converters
> and uncheck the "Enabled" checkbox in "Converters File Cache". Then, reload
> the document. If everything is Ok, you have to find the cached image in
> ~/.lyx/cache, remove the file and the corresponding entry in
> ~/.lyx/cache/index. Or, more simply, do "rm -f .lyx/cache/*", being aware
> that you will loose all cached images in this case.
>

Did that. No crash. Still inverted icon in text.

Kornel

signature.asc
Description: This is a digitally signed message part.


Re: [patch] Prefer svg icons

2015-03-13 Thread Jürgen Spitzmüller
2015-03-13 14:33 GMT+01:00 Enrico Forestieri:

> I cannot reproduce. I thought that maybe that happens when using the
> oxygen set, but even after switching to that I have no problems.
>

I use the standard set.


> Please, try to also move away ~/.config/LyX/lyx.conf
> and see whether that makes any difference.
>

No, still crashes.

Jürgen


>
> --
> Enrico
>


Re: [patch] Prefer svg icons

2015-03-13 Thread Enrico Forestieri
On Fri, Mar 13, 2015 at 02:20:46PM +0100, Kornel Benko wrote:
> Am Freitag, 13. März 2015 um 14:06:20, schrieb Enrico Forestieri 
> 
> > On Fri, Mar 13, 2015 at 12:17:02PM +0100, Kornel Benko wrote:
> > > Am Freitag, 13. März 2015 um 11:24:10, schrieb Jürgen Spitzmüller 
> > > 
> > > > 
> > > > I don't know if you are aware of it: master now crashes when you load f.
> > > > ex. splash.lyx (which contains an icon info-inset).
> > > > 
> > > > Jürgen
> > > 
> > > I have no problems with that. The icon "buffer-view" in text is inverted 
> > > here.
> > 
> > Note that LyX cashes images, so that may be the cause. To make certain,
> > close the document, go to Tools->Preferences->File Handling->Converters
> > and uncheck the "Enabled" checkbox in "Converters File Cache". Then, reload
> > the document. If everything is Ok, you have to find the cached image in
> > ~/.lyx/cache, remove the file and the corresponding entry in
> > ~/.lyx/cache/index. Or, more simply, do "rm -f .lyx/cache/*", being aware
> > that you will loose all cached images in this case.
> > 
> 
> Did that. No crash. Still inverted icon in text.

What happens if you include the exact same icon in a graphics inset?
I mean, insert a graphic and load /lib/images/oxygen/buffer-view.svgz

-- 
Enrico


Re: [patch] Prefer svg icons

2015-03-13 Thread Jürgen Spitzmüller
2015-03-13 14:41 GMT+01:00 Enrico Forestieri:

> What happens if you include the exact same icon in a graphics inset?
> I mean, insert a graphic and load
> /lib/images/oxygen/buffer-view.svgz
>

This does not crash.

Jürgen


>
> --
> Enrico
>


Re: [patch] Prefer svg icons

2015-03-13 Thread Enrico Forestieri
On Fri, Mar 13, 2015 at 02:07:47PM +0100, Jürgen Spitzmüller wrote:
> 2015-03-13 13:58 GMT+01:00 Enrico Forestieri:
> 
> > I have experienced a strange crash like that with the tutorial. It was
> > occurring systematically each time I was opening it. I observed that
> > it seems to happen if you had previously opened that file and closed
> > it when the cursor was on the line containing the info inset. The cure
> > is editing the ~/.lyx/session file and, only in the [cursor positions]
> > stanza, deleting the line corresponding to that document. After doing
> > that, reopening and closing the document (even leaving the cursor on
> > the same line containing the info inset), did not trigger the crash
> > anymore. Then, I did not investigate further, classifying this as one
> > the mysteries I faced with this switch to svg.
> >
> 
> This did not help in my case. I even ditched the session file completely,
> but LyX still crashes.

I cannot reproduce. I thought that maybe that happens when using the
oxygen set, but even after switching to that I have no problems.
Please, try to also move away ~/.config/LyX/lyx.conf
and see whether that makes any difference.

-- 
Enrico


Re: [patch] Prefer svg icons

2015-03-13 Thread Kornel Benko
Am Freitag, 13. März 2015 um 14:54:12, schrieb Kornel Benko 
> Am Freitag, 13. März 2015 um 14:41:26, schrieb Enrico Forestieri 
> 
> > On Fri, Mar 13, 2015 at 02:20:46PM +0100, Kornel Benko wrote:
> > > Am Freitag, 13. März 2015 um 14:06:20, schrieb Enrico Forestieri 
> > > 
> > > > On Fri, Mar 13, 2015 at 12:17:02PM +0100, Kornel Benko wrote:
> > > > > Am Freitag, 13. März 2015 um 11:24:10, schrieb Jürgen Spitzmüller 
> > > > > 
> > > > > > 
> > > > > > I don't know if you are aware of it: master now crashes when you 
> > > > > > load f.
> > > > > > ex. splash.lyx (which contains an icon info-inset).
> > > > > > 
> > > > > > Jürgen
> > > > > 
> > > > > I have no problems with that. The icon "buffer-view" in text is 
> > > > > inverted here.
> > > > 
> > > > Note that LyX cashes images, so that may be the cause. To make certain,
> > > > close the document, go to Tools->Preferences->File Handling->Converters
> > > > and uncheck the "Enabled" checkbox in "Converters File Cache". Then, 
> > > > reload
> > > > the document. If everything is Ok, you have to find the cached image in
> > > > ~/.lyx/cache, remove the file and the corresponding entry in
> > > > ~/.lyx/cache/index. Or, more simply, do "rm -f .lyx/cache/*", being 
> > > > aware
> > > > that you will loose all cached images in this case.
> > > > 
> > > 
> > > Did that. No crash. Still inverted icon in text.
> > 
> > What happens if you include the exact same icon in a graphics inset?
> > I mean, insert a graphic and load 
> > /lib/images/oxygen/buffer-view.svgz
> > 
> 
> Looks the same if setting the scale to 17%
> 

Also interesting is the console-output (from the build tree):

1.67 amd64.kornel 15:22 > ./bin/lyx2.2
Could not resolve property : linearGradient5167
Could not resolve property : pattern5614
Could not resolve property : pattern5626
couldn't create image from  
"/home/david/Oxygen/trunk/32x32/actions/edit-copy.png"
couldn't create image from  
"/home/david/Oxygen/trunk/32x32/actions/edit-paste.png"
link XMLID_34_ hasn't been detected!
link XMLID_34_ hasn't been detected!
link XMLID_36_ hasn't been detected!
link XMLID_34_ hasn't been detected!
link XMLID_34_ hasn't been detected!
link XMLID_36_ hasn't been detected!
link use5411 hasn't been detected!
Could not resolve property : pattern6080
Could not resolve property : pattern5633

Where does '/home/david' came from?

Kornel


signature.asc
Description: This is a digitally signed message part.


Re: [patch] Prefer svg icons

2015-03-13 Thread Enrico Forestieri
On Fri, Mar 13, 2015 at 02:37:04PM +0100, Jürgen Spitzmüller wrote:
> 2015-03-13 14:33 GMT+01:00 Enrico Forestieri:
> 
> > I cannot reproduce. I thought that maybe that happens when using the
> > oxygen set, but even after switching to that I have no problems.
> >
> 
> I use the standard set.
> 
> 
> > Please, try to also move away ~/.config/LyX/lyx.conf
> > and see whether that makes any difference.
> >
> 
> No, still crashes.

Ok. Let's see whether it works with uncompressed svg icons.
Please, launch the attached script and then recompile. The script
converts all svgz icons to svg ones and makes the necessary
modifications to the sources. Does it work now?

-- 
Enrico


svgz2svg.sh
Description: Bourne shell script


Re: [patch] Prefer svg icons

2015-03-13 Thread Enrico Forestieri
On Fri, Mar 13, 2015 at 02:54:12PM +0100, Kornel Benko wrote:
> Am Freitag, 13. März 2015 um 14:41:26, schrieb Enrico Forestieri 
> 
> > 
> > What happens if you include the exact same icon in a graphics inset?
> > I mean, insert a graphic and load 
> > /lib/images/oxygen/buffer-view.svgz
> > 
> 
> Looks the same if setting the scale to 17%

Needless to say that I cannot reproduce. maybe something in your converters
machinery? Try starting with a fresh user dir, i.e., remove your ~/.lyx2.2
directory and relaunch lyx.

-- 
Enrico


Re: [patch] Prefer svg icons

2015-03-13 Thread Enrico Forestieri
On Fri, Mar 13, 2015 at 03:27:06PM +0100, Kornel Benko wrote:
> 
> Also interesting is the console-output (from the build tree):
> 
> 1.67 amd64.kornel 15:22 > ./bin/lyx2.2
> Could not resolve property : linearGradient5167
> Could not resolve property : pattern5614
> Could not resolve property : pattern5626
> couldn't create image from  
> "/home/david/Oxygen/trunk/32x32/actions/edit-copy.png"
> couldn't create image from  
> "/home/david/Oxygen/trunk/32x32/actions/edit-paste.png"
> link XMLID_34_ hasn't been detected!
> link XMLID_34_ hasn't been detected!
> link XMLID_36_ hasn't been detected!
> link XMLID_34_ hasn't been detected!
> link XMLID_34_ hasn't been detected!
> link XMLID_36_ hasn't been detected!
> link use5411 hasn't been detected!
> Could not resolve property : pattern6080
> Could not resolve property : pattern5633
> 
> Where does '/home/david' came from?

From one of the icons. A bitmap can be either embedded or linked into
the svg. In this case it seems that a bitmap was linked and that is
the location where it was when the svg was generated.

-- 
Enrico


Re: [patch] Prefer svg icons

2015-03-13 Thread Jürgen Spitzmüller
2015-03-13 15:32 GMT+01:00 Enrico Forestieri :

> Ok. Let's see whether it works with uncompressed svg icons.
> Please, launch the attached script and then recompile. The script
> converts all svgz icons to svg ones and makes the necessary
> modifications to the sources. Does it work now?
>

Yes, this works. The icon is also displayed as Iit should.

Jürgen


>
> --
> Enrico
>


Re: [patch] Prefer svg icons

2015-03-13 Thread Kornel Benko
Am Freitag, 13. März 2015 um 14:37:04, schrieb Jürgen Spitzmüller 

> 2015-03-13 14:33 GMT+01:00 Enrico Forestieri:
> 
> > I cannot reproduce. I thought that maybe that happens when using the
> > oxygen set, but even after switching to that I have no problems.
> >
> 
> I use the standard set.
> 
> 
> > Please, try to also move away ~/.config/LyX/lyx.conf
> > and see whether that makes any difference.
> >
> 
> No, still crashes.
> 
> Jürgen
> 
> 

And now it crashes here too. But only the installed version using my own 
userdir.

Created new userdir.
Until I copied old session + session.cmake there was no crash. From then on I 
get crash always
loading splash.lyx, it does not matter, if I remove session* or not.
Also removing cache content does not help.

Kornel


signature.asc
Description: This is a digitally signed message part.


Re: [patch] Prefer svg icons

2015-03-13 Thread Enrico Forestieri
On Fri, Mar 13, 2015 at 04:29:19PM +0100, Jürgen Spitzmüller wrote:
> 2015-03-13 15:32 GMT+01:00 Enrico Forestieri :
> 
> > Ok. Let's see whether it works with uncompressed svg icons.
> > Please, launch the attached script and then recompile. The script
> > converts all svgz icons to svg ones and makes the necessary
> > modifications to the sources. Does it work now?
> >
> 
> Yes, this works. The icon is also displayed as Iit should.

Fine. So, it is due to the fact that the icons are compressed. This seems
to be something similar to what I was experiencing. I discovered another
place in the sources where an uncompressed file gets a wrong extension.
I've just committed a patch correcting this. Please, revert the changes
to the sources (such that to use compressed svg icons again), update
form the repo and try whether this last change helps.

-- 
Enrico


Re: [patch] Prefer svg icons

2015-03-13 Thread Jürgen Spitzmüller
2015-03-13 17:33 GMT+01:00 Enrico Forestieri:

> Fine. So, it is due to the fact that the icons are compressed. This seems
> to be something similar to what I was experiencing. I discovered another
> place in the sources where an uncompressed file gets a wrong extension.
> I've just committed a patch correcting this. Please, revert the changes
> to the sources (such that to use compressed svg icons again), update
> form the repo and try whether this last change helps.
>

Yes, it works now.

Thanks!
Jürgen



>
> --
> Enrico
>


Re: [patch] Prefer svg icons

2015-03-13 Thread Enrico Forestieri
On Fri, Mar 13, 2015 at 04:37:07PM +0100, Kornel Benko wrote:
> Am Freitag, 13. März 2015 um 14:37:04, schrieb Jürgen Spitzmüller 
> 
> > 2015-03-13 14:33 GMT+01:00 Enrico Forestieri:
> > 
> > > I cannot reproduce. I thought that maybe that happens when using the
> > > oxygen set, but even after switching to that I have no problems.
> > >
> > 
> > I use the standard set.
> > 
> > 
> > > Please, try to also move away ~/.config/LyX/lyx.conf
> > > and see whether that makes any difference.
> > >
> > 
> > No, still crashes.
> > 
> > Jürgen
> > 
> > 
> 
> And now it crashes here too. But only the installed version using my own
> userdir.

Do you mean that if you do not install, then it doesn't crash?
Can you write to the directory where LyX gets installed?
If not, then there must be some other instance in the sources
where a temporary file is created in the wrong place.

> Created new userdir.
> Until I copied old session + session.cmake there was no crash. From then on I
> get crash always

What is session.cmake?

-- 
Enrico


Re: [patch] Prefer svg icons

2015-03-13 Thread Enrico Forestieri
On Fri, Mar 13, 2015 at 05:35:47PM +0100, Jürgen Spitzmüller wrote:
> 2015-03-13 17:33 GMT+01:00 Enrico Forestieri:
> 
> > Fine. So, it is due to the fact that the icons are compressed. This seems
> > to be something similar to what I was experiencing. I discovered another
> > place in the sources where an uncompressed file gets a wrong extension.
> > I've just committed a patch correcting this. Please, revert the changes
> > to the sources (such that to use compressed svg icons again), update
> > form the repo and try whether this last change helps.
> >
> 
> Yes, it works now.

Damn'd file format recognition through extension only.
I would have expected that on Windows, not on Linux. Sigh.

-- 
Enrico


Re: [patch] Prefer svg icons

2015-03-13 Thread Kornel Benko
Am Freitag, 13. März 2015 um 17:38:22, schrieb Enrico Forestieri 

> On Fri, Mar 13, 2015 at 04:37:07PM +0100, Kornel Benko wrote:
> > Am Freitag, 13. März 2015 um 14:37:04, schrieb Jürgen Spitzmüller 
> > 
> > > 2015-03-13 14:33 GMT+01:00 Enrico Forestieri:
> > >
> > > > I cannot reproduce. I thought that maybe that happens when using the
> > > > oxygen set, but even after switching to that I have no problems.
> > > >
> > >
> > > I use the standard set.
> > >
> > >
> > > > Please, try to also move away ~/.config/LyX/lyx.conf
> > > > and see whether that makes any difference.
> > > >
> > >
> > > No, still crashes.
> > >
> > > Jürgen
> > >
> > >
> >
> > And now it crashes here too. But only the installed version using my own
> > userdir.
>
> Do you mean that if you do not install, then it doesn't crash?
> Can you write to the directory where LyX gets installed?
> If not, then there must be some other instance in the sources
> where a temporary file is created in the wrong place.

It was due to the fact, that using from build tree I do not set userdir.

> > Created new userdir.
> > Until I copied old session + session.cmake there was no crash. From then on 
> > I
> > get crash always
>
> What is session.cmake?
>

Automatically created, see attached.
Anyway, it does not crash with the latest commit. Moreover, the icons are not 
reversed.

Kornel

signature.asc
Description: This is a digitally signed message part.
## Automatically generated lyx session file 
## Editing this file manually may cause lyx to crash.

[recent files]
/usr/src/lyx/lyx-git/lib/examples/splash.lyx
/usr/local/lyx2.2/examples/splash.lyx

[last opened files]
1, /usr/src/lyx/lyx-git/lib/examples/splash.lyx

[cursor positions]
0, 5, /usr/local/lyx2.2/examples/splash.lyx
0, 0, /usr/src/lyx/lyx-git/lib/examples/splash.lyx

[last commands]

[bookmarks]


Re: [patch] Prefer svg icons

2015-03-13 Thread Kornel Benko
Am Freitag, 13. März 2015 um 17:38:22, schrieb Enrico Forestieri 

> Can you write to the directory where LyX gets installed?

No.

Kornel

signature.asc
Description: This is a digitally signed message part.


Re: [patch] Prefer svg icons

2015-03-13 Thread Enrico Forestieri
On Fri, Mar 13, 2015 at 05:52:51PM +0100, Kornel Benko wrote:
> Am Freitag, 13. März 2015 um 17:38:22, schrieb Enrico Forestieri 
> 
> > Can you write to the directory where LyX gets installed?
> 
> No.

Ok. This doesn't matter anymore, though, given that it is now fixed.

-- 
Enrico


Re: [patch] Prefer svg icons

2015-03-12 Thread Stephan Witt
Am 12.03.2015 um 01:35 schrieb Enrico Forestieri for...@lyx.org:

 On Wed, Mar 11, 2015 at 10:50:00PM +0100, Enrico Forestieri wrote:
 
 However, the problem that documents with svgz files used in the info
 inset are not compilable is still unsolved.
 
 I have solved this mystery, too. When compiling, LyX converts the
 uncompressed svg file to proper format (pdf or eps) by using
 rsvg-convert. Now, rsvg-convert cannot deal with compressed svg
 files, but you would think that this is not a problem because LyX
 had already uncompressed the file. The point is that the stupid
 thing only looks at the extension, and LyX still leaves the svgz
 extension also for the uncompressed file. So, rsvg-convert refuses
 to convert the file complaining that it is compressed...
 
 Well, the temporary file thing and this one were the cause of all
 the problems I have reported in this thread. Don't ask me why it
 would fail if the file is in a nfs or ntfs mounted directory because
 I have no explanation. All I know is that with the attached patch
 everything is fine on all platforms I have access to.
 
 So, barring the explanation about the temporary file location, I would
 commit all this series of patches and also move the svg files to
 proper place, so that LyX uses them instead of the png ones.

I'd like to say thank you too and will check the result of your commit on Mac.

Stephan

Re: [patch] Prefer svg icons

2015-03-12 Thread Kornel Benko
Am Montag, 16. Februar 2015 um 21:17:32, schrieb Enrico Forestieri 
for...@lyx.org
 On Mon, Feb 16, 2015 at 05:02:15PM +0100, Kornel Benko wrote:
  
  I get messages like
  frontends/qt4/GuiApplication.cpp (612): Cannot load icon
  /usr/local/lyx2.2/images/oxygen/buffer-new.svgz please verify resource
  system!
 
 Strange, I don't get them when using the oxygen set. However, I get:
 
 Could not resolve property : linearGradient5167
 Could not resolve property : pattern5614
 Could not resolve property : pattern5626
 couldn't create image from  
 /home/david/Oxygen/trunk/32x32/actions/edit-copy.png
 couldn't create image from  
 /home/david/Oxygen/trunk/32x32/actions/edit-paste.png
 link XMLID_34_ hasn't been detected!
 link XMLID_34_ hasn't been detected!
 link XMLID_36_ hasn't been detected!
 link XMLID_34_ hasn't been detected!
 link XMLID_34_ hasn't been detected!
 link XMLID_36_ hasn't been detected!
 link use5411 hasn't been detected!
 Could not resolve property : pattern6080
 Could not resolve property : pattern5633
 
 which are clearly due to problems with the svgs themselves. Funny the
 couldn't create image warning mentioning a path that does not exist
 on my system.
 
  Do I need some extra command?
 
 Try to see whether the symlink is okay by issuing
 ls -lL /usr/local/lyx2.2/images/oxygen/buffer-new.svgz
 

Funny, I missed this message. Sorry for the delay.
To answer:
I installed the files directly, so no need for symlink.
But from the recent posts, it may be because the directory is not writeable. 
Will check ...
Looks like it works.

Kornel

signature.asc
Description: This is a digitally signed message part.


Re: [patch] Prefer svg icons

2015-03-12 Thread Jean-Marc Lasgouttes

Le 12/03/2015 11:30, Kornel Benko a écrit :

At least for cmake, there is no need to move them to the proper place. It can 
easily be done
while installing (One line patch).
Should not be too difficult for automake too?


It is better to do it in the source, so that LyX can use the files 
without installing.


JMarc



Re: [patch] Prefer svg icons

2015-03-12 Thread Kornel Benko
Am Donnerstag, 12. März 2015 um 11:47:01, schrieb Jean-Marc Lasgouttes 
lasgout...@lyx.org
 Le 12/03/2015 11:30, Kornel Benko a écrit :
  At least for cmake, there is no need to move them to the proper place. It 
  can easily be done
  while installing (One line patch).
  Should not be too difficult for automake too?
 
 It is better to do it in the source, so that LyX can use the files 
 without installing.
 
 JMarc

You have a point, didn't think of it.

Kornel

signature.asc
Description: This is a digitally signed message part.


Re: [patch] Prefer svg icons

2015-03-12 Thread Kornel Benko
Am Donnerstag, 12. März 2015 um 01:35:01, schrieb Enrico Forestieri 
for...@lyx.org
 On Wed, Mar 11, 2015 at 10:50:00PM +0100, Enrico Forestieri wrote:
  
  However, the problem that documents with svgz files used in the info
  inset are not compilable is still unsolved.
 
 I have solved this mystery, too. When compiling, LyX converts the
 uncompressed svg file to proper format (pdf or eps) by using
 rsvg-convert. Now, rsvg-convert cannot deal with compressed svg
 files, but you would think that this is not a problem because LyX
 had already uncompressed the file. The point is that the stupid
 thing only looks at the extension, and LyX still leaves the svgz
 extension also for the uncompressed file. So, rsvg-convert refuses
 to convert the file complaining that it is compressed...
 
 Well, the temporary file thing and this one were the cause of all
 the problems I have reported in this thread. Don't ask me why it
 would fail if the file is in a nfs or ntfs mounted directory because
 I have no explanation. All I know is that with the attached patch
 everything is fine on all platforms I have access to.
 
 So, barring the explanation about the temporary file location, I would
 commit all this series of patches and also move the svg files to
 proper place, so that LyX uses them instead of the png ones.
 

It is working nice for the GUI.
If using svgz also as images in text,
then instant preview is not working. The pdf-output is OK though.

After creating new format svgz, and convertter form svgz-SVG, also the preview
works, but feels too big in lyx-window compared with the png icons.

Kornel

signature.asc
Description: This is a digitally signed message part.


Re: [patch] Prefer svg icons

2015-03-12 Thread Georg Baum
Enrico Forestieri wrote:

 On Wed, Mar 11, 2015 at 10:50:00PM +0100, Enrico Forestieri wrote:
 
 I discovered the reason of this last thing. It is not related to the
 platform or the kind of inset (graphics or info) but to whether the
 directory containing the compressed svg is writable or not. Indeed,
 LyX uncompresses the file before using it, but uses a temporary file
 located in the same directory. Of course, if the directory is not
 writable, the operation fails and the image is not displayed.
 
 Georg, is there any reason why a temporary file is not always created
 in the LyX temporary directory?

When I look at your patch I believe that the creation of temp files in local 
directories is not wanted. This is simply a side effect of the 
implementation. If you use strings for passing arguments you never know how 
it is interpreted.


Georg



Re: [patch] Prefer svg icons

2015-03-12 Thread Kornel Benko
Am Donnerstag, 12. März 2015 um 01:35:01, schrieb Enrico Forestieri 
for...@lyx.org
 On Wed, Mar 11, 2015 at 10:50:00PM +0100, Enrico Forestieri wrote:
 
  However, the problem that documents with svgz files used in the info
  inset are not compilable is still unsolved.

 I have solved this mystery, too. When compiling, LyX converts the
 uncompressed svg file to proper format (pdf or eps) by using
 rsvg-convert. Now, rsvg-convert cannot deal with compressed svg
 files, but you would think that this is not a problem because LyX
 had already uncompressed the file. The point is that the stupid
 thing only looks at the extension, and LyX still leaves the svgz
 extension also for the uncompressed file. So, rsvg-convert refuses
 to convert the file complaining that it is compressed...

 Well, the temporary file thing and this one were the cause of all
 the problems I have reported in this thread. Don't ask me why it
 would fail if the file is in a nfs or ntfs mounted directory because
 I have no explanation. All I know is that with the attached patch
 everything is fine on all platforms I have access to.

 So, barring the explanation about the temporary file location, I would
 commit all this series of patches and also move the svg files to
 proper place, so that LyX uses them instead of the png ones.


At least for cmake, there is no need to move them to the proper place. It can 
easily be done
while installing (One line patch).
Should not be too difficult for automake too?

Kornel

signature.asc
Description: This is a digitally signed message part.
diff --git a/development/cmake/Install.cmake b/development/cmake/Install.cmake
index f85dfa9..9b5f103 100755
--- a/development/cmake/Install.cmake
+++ b/development/cmake/Install.cmake
@@ -90,7 +90,8 @@ lyx_install(${TOP_SRC_DIR}/lib doc/${_all_languages} *clipart)
 lyx_install(${TOP_SRC_DIR}/lib examples *  . ${_all_languages} springer thesis)
 lyx_install(${TOP_SRC_DIR}/lib fonts*  .)
 lyx_install(${TOP_SRC_DIR}/lib images   *  . math ipa commands attic classic oxygen)
-lyx_install(${TOP_SRC_DIR}/lib images/svg   *  . math ipa oxygen)
+#lyx_install(${TOP_SRC_DIR}/lib images/svg   *  . math ipa oxygen)
+lyx_install(${TOP_SRC_DIR}/lib images   *  svg/. svg/math svg/ipa svg/oxygen)
 lyx_install(${TOP_SRC_DIR}/lib kbd  *  .)
 lyx_install(${TOP_SRC_DIR}/lib layouts  *  .)
 lyx_install(${TOP_SRC_DIR}/lib lyx2lyx  *.py   .)


Re: [patch] Prefer svg icons

2015-03-12 Thread Enrico Forestieri
On Wed, Mar 11, 2015 at 09:15:30PM -0400, Richard Heck wrote:
 
 Regarding the use of Qt in src/insets/, I have never quite
 understood the thinking here,
 at least since we abandoned all other frontends. But if anyone
 objects, presumably it
 would be trivial to create an imgWidth() method somewhere in
 support. That seems to
 be all you need here.

Yes, I think I could do that straight away. I'll stick a method
in filetools.cpp, lacking any other better option.

-- 
Enrico


Re: [patch] Prefer svg icons

2015-03-12 Thread Enrico Forestieri
On Thu, Mar 12, 2015 at 09:28:32PM +0100, Georg Baum wrote:
 Enrico Forestieri wrote:
 
  On Wed, Mar 11, 2015 at 10:50:00PM +0100, Enrico Forestieri wrote:
  
  I discovered the reason of this last thing. It is not related to the
  platform or the kind of inset (graphics or info) but to whether the
  directory containing the compressed svg is writable or not. Indeed,
  LyX uncompresses the file before using it, but uses a temporary file
  located in the same directory. Of course, if the directory is not
  writable, the operation fails and the image is not displayed.
  
  Georg, is there any reason why a temporary file is not always created
  in the LyX temporary directory?
 
 When I look at your patch I believe that the creation of temp files in local 
 directories is not wanted. This is simply a side effect of the 
 implementation. If you use strings for passing arguments you never know how 
 it is interpreted.

Thanks. I thought there could have been a reason, in which case we could
simply have done that only when the directory is not writable.

-- 
Enrico


Re: [patch] Prefer svg icons

2015-03-12 Thread Enrico Forestieri
On Thu, Mar 12, 2015 at 11:22:12AM +0100, Kornel Benko wrote:
 
 Funny, I missed this message. Sorry for the delay.
 To answer:
   I installed the files directly, so no need for symlink.
 But from the recent posts, it may be because the directory is not writeable.
 Will check ...
 Looks like it works.

Thanks for testing.

-- 
Enrico


Re: [patch] Prefer svg icons

2015-03-12 Thread Stephan Witt
Am 12.03.2015 um 01:35 schrieb Enrico Forestieri :

> On Wed, Mar 11, 2015 at 10:50:00PM +0100, Enrico Forestieri wrote:
>> 
>> However, the problem that documents with svgz files used in the info
>> inset are not compilable is still unsolved.
> 
> I have solved this mystery, too. When compiling, LyX converts the
> uncompressed svg file to proper format (pdf or eps) by using
> rsvg-convert. Now, rsvg-convert cannot deal with compressed svg
> files, but you would think that this is not a problem because LyX
> had already uncompressed the file. The point is that the stupid
> thing only looks at the extension, and LyX still leaves the svgz
> extension also for the uncompressed file. So, rsvg-convert refuses
> to convert the file complaining that it is compressed...
> 
> Well, the temporary file thing and this one were the cause of all
> the problems I have reported in this thread. Don't ask me why it
> would fail if the file is in a nfs or ntfs mounted directory because
> I have no explanation. All I know is that with the attached patch
> everything is fine on all platforms I have access to.
> 
> So, barring the explanation about the temporary file location, I would
> commit all this series of patches and also move the svg files to
> proper place, so that LyX uses them instead of the png ones.

I'd like to say thank you too and will check the result of your commit on Mac.

Stephan

Re: [patch] Prefer svg icons

2015-03-12 Thread Kornel Benko
Am Montag, 16. Februar 2015 um 21:17:32, schrieb Enrico Forestieri 

> On Mon, Feb 16, 2015 at 05:02:15PM +0100, Kornel Benko wrote:
> > 
> > I get messages like
> > frontends/qt4/GuiApplication.cpp (612): Cannot load icon
> > /usr/local/lyx2.2/images/oxygen/buffer-new.svgz please verify resource
> > system!
> 
> Strange, I don't get them when using the oxygen set. However, I get:
> 
> Could not resolve property : linearGradient5167
> Could not resolve property : pattern5614
> Could not resolve property : pattern5626
> couldn't create image from  
> "/home/david/Oxygen/trunk/32x32/actions/edit-copy.png"
> couldn't create image from  
> "/home/david/Oxygen/trunk/32x32/actions/edit-paste.png"
> link XMLID_34_ hasn't been detected!
> link XMLID_34_ hasn't been detected!
> link XMLID_36_ hasn't been detected!
> link XMLID_34_ hasn't been detected!
> link XMLID_34_ hasn't been detected!
> link XMLID_36_ hasn't been detected!
> link use5411 hasn't been detected!
> Could not resolve property : pattern6080
> Could not resolve property : pattern5633
> 
> which are clearly due to problems with the svgs themselves. Funny the
> "couldn't create image" warning mentioning a path that does not exist
> on my system.
> 
> > Do I need some extra command?
> 
> Try to see whether the symlink is okay by issuing
> ls -lL /usr/local/lyx2.2/images/oxygen/buffer-new.svgz
> 

Funny, I missed this message. Sorry for the delay.
To answer:
I installed the files directly, so no need for symlink.
But from the recent posts, it may be because the directory is not writeable. 
Will check ...
Looks like it works.

Kornel

signature.asc
Description: This is a digitally signed message part.


Re: [patch] Prefer svg icons

2015-03-12 Thread Kornel Benko
Am Donnerstag, 12. März 2015 um 01:35:01, schrieb Enrico Forestieri 

> On Wed, Mar 11, 2015 at 10:50:00PM +0100, Enrico Forestieri wrote:
> >
> > However, the problem that documents with svgz files used in the info
> > inset are not compilable is still unsolved.
>
> I have solved this mystery, too. When compiling, LyX converts the
> uncompressed svg file to proper format (pdf or eps) by using
> rsvg-convert. Now, rsvg-convert cannot deal with compressed svg
> files, but you would think that this is not a problem because LyX
> had already uncompressed the file. The point is that the stupid
> thing only looks at the extension, and LyX still leaves the svgz
> extension also for the uncompressed file. So, rsvg-convert refuses
> to convert the file complaining that it is compressed...
>
> Well, the temporary file thing and this one were the cause of all
> the problems I have reported in this thread. Don't ask me why it
> would fail if the file is in a nfs or ntfs mounted directory because
> I have no explanation. All I know is that with the attached patch
> everything is fine on all platforms I have access to.
>
> So, barring the explanation about the temporary file location, I would
> commit all this series of patches and also move the svg files to
> proper place, so that LyX uses them instead of the png ones.
>

At least for cmake, there is no need to move them to the proper place. It can 
easily be done
while installing (One line patch).
Should not be too difficult for automake too?

Kornel

signature.asc
Description: This is a digitally signed message part.
diff --git a/development/cmake/Install.cmake b/development/cmake/Install.cmake
index f85dfa9..9b5f103 100755
--- a/development/cmake/Install.cmake
+++ b/development/cmake/Install.cmake
@@ -90,7 +90,8 @@ lyx_install(${TOP_SRC_DIR}/lib doc/${_all_languages} *clipart)
 lyx_install(${TOP_SRC_DIR}/lib examples *  . ${_all_languages} springer thesis)
 lyx_install(${TOP_SRC_DIR}/lib fonts*  .)
 lyx_install(${TOP_SRC_DIR}/lib images   *  . math ipa commands attic classic oxygen)
-lyx_install(${TOP_SRC_DIR}/lib images/svg   *  . math ipa oxygen)
+#lyx_install(${TOP_SRC_DIR}/lib images/svg   *  . math ipa oxygen)
+lyx_install(${TOP_SRC_DIR}/lib images   *  svg/. svg/math svg/ipa svg/oxygen)
 lyx_install(${TOP_SRC_DIR}/lib kbd  *  .)
 lyx_install(${TOP_SRC_DIR}/lib layouts  *  .)
 lyx_install(${TOP_SRC_DIR}/lib lyx2lyx  *.py   .)


Re: [patch] Prefer svg icons

2015-03-12 Thread Jean-Marc Lasgouttes

Le 12/03/2015 11:30, Kornel Benko a écrit :

At least for cmake, there is no need to move them to the proper place. It can 
easily be done
while installing (One line patch).
Should not be too difficult for automake too?


It is better to do it in the source, so that LyX can use the files 
without installing.


JMarc



Re: [patch] Prefer svg icons

2015-03-12 Thread Kornel Benko
Am Donnerstag, 12. März 2015 um 11:47:01, schrieb Jean-Marc Lasgouttes 

> Le 12/03/2015 11:30, Kornel Benko a écrit :
> > At least for cmake, there is no need to move them to the proper place. It 
> > can easily be done
> > while installing (One line patch).
> > Should not be too difficult for automake too?
> 
> It is better to do it in the source, so that LyX can use the files 
> without installing.
> 
> JMarc

You have a point, didn't think of it.

Kornel

signature.asc
Description: This is a digitally signed message part.


Re: [patch] Prefer svg icons

2015-03-12 Thread Kornel Benko
Am Donnerstag, 12. März 2015 um 01:35:01, schrieb Enrico Forestieri 

> On Wed, Mar 11, 2015 at 10:50:00PM +0100, Enrico Forestieri wrote:
> > 
> > However, the problem that documents with svgz files used in the info
> > inset are not compilable is still unsolved.
> 
> I have solved this mystery, too. When compiling, LyX converts the
> uncompressed svg file to proper format (pdf or eps) by using
> rsvg-convert. Now, rsvg-convert cannot deal with compressed svg
> files, but you would think that this is not a problem because LyX
> had already uncompressed the file. The point is that the stupid
> thing only looks at the extension, and LyX still leaves the svgz
> extension also for the uncompressed file. So, rsvg-convert refuses
> to convert the file complaining that it is compressed...
> 
> Well, the temporary file thing and this one were the cause of all
> the problems I have reported in this thread. Don't ask me why it
> would fail if the file is in a nfs or ntfs mounted directory because
> I have no explanation. All I know is that with the attached patch
> everything is fine on all platforms I have access to.
> 
> So, barring the explanation about the temporary file location, I would
> commit all this series of patches and also move the svg files to
> proper place, so that LyX uses them instead of the png ones.
> 

It is working nice for the GUI.
If using svgz also as images in text,
then instant preview is not working. The pdf-output is OK though.

After creating new format svgz, and convertter form svgz->SVG, also the preview
works, but feels too big in lyx-window compared with the png icons.

Kornel

signature.asc
Description: This is a digitally signed message part.


Re: [patch] Prefer svg icons

2015-03-12 Thread Georg Baum
Enrico Forestieri wrote:

> On Wed, Mar 11, 2015 at 10:50:00PM +0100, Enrico Forestieri wrote:
>> 
>> I discovered the reason of this last thing. It is not related to the
>> platform or the kind of inset (graphics or info) but to whether the
>> directory containing the compressed svg is writable or not. Indeed,
>> LyX uncompresses the file before using it, but uses a temporary file
>> located in the same directory. Of course, if the directory is not
>> writable, the operation fails and the image is not displayed.
> 
> Georg, is there any reason why a temporary file is not always created
> in the LyX temporary directory?

When I look at your patch I believe that the creation of temp files in local 
directories is not wanted. This is simply a side effect of the 
implementation. If you use strings for passing arguments you never know how 
it is interpreted.


Georg



Re: [patch] Prefer svg icons

2015-03-12 Thread Enrico Forestieri
On Wed, Mar 11, 2015 at 09:15:30PM -0400, Richard Heck wrote:
> 
> Regarding the use of Qt in src/insets/, I have never quite
> understood the thinking here,
> at least since we abandoned all other frontends. But if anyone
> objects, presumably it
> would be trivial to create an imgWidth() method somewhere in
> support. That seems to
> be all you need here.

Yes, I think I could do that straight away. I'll stick a method
in filetools.cpp, lacking any other better option.

-- 
Enrico


Re: [patch] Prefer svg icons

2015-03-12 Thread Enrico Forestieri
On Thu, Mar 12, 2015 at 09:28:32PM +0100, Georg Baum wrote:
> Enrico Forestieri wrote:
> 
> > On Wed, Mar 11, 2015 at 10:50:00PM +0100, Enrico Forestieri wrote:
> >> 
> >> I discovered the reason of this last thing. It is not related to the
> >> platform or the kind of inset (graphics or info) but to whether the
> >> directory containing the compressed svg is writable or not. Indeed,
> >> LyX uncompresses the file before using it, but uses a temporary file
> >> located in the same directory. Of course, if the directory is not
> >> writable, the operation fails and the image is not displayed.
> > 
> > Georg, is there any reason why a temporary file is not always created
> > in the LyX temporary directory?
> 
> When I look at your patch I believe that the creation of temp files in local 
> directories is not wanted. This is simply a side effect of the 
> implementation. If you use strings for passing arguments you never know how 
> it is interpreted.

Thanks. I thought there could have been a reason, in which case we could
simply have done that only when the directory is not writable.

-- 
Enrico


Re: [patch] Prefer svg icons

2015-03-12 Thread Enrico Forestieri
On Thu, Mar 12, 2015 at 11:22:12AM +0100, Kornel Benko wrote:
> 
> Funny, I missed this message. Sorry for the delay.
> To answer:
>   I installed the files directly, so no need for symlink.
> But from the recent posts, it may be because the directory is not writeable.
> Will check ...
> Looks like it works.

Thanks for testing.

-- 
Enrico


Re: [patch] Prefer svg icons

2015-03-11 Thread Enrico Forestieri
On Tue, Mar 10, 2015 at 07:09:59PM +0100, Enrico Forestieri wrote:
 On Mon, Feb 16, 2015 at 09:13:13PM +0100, Jean-Marc Lasgouttes wrote:
  Le 16/02/2015 21:10, Enrico Forestieri a écrit :
  On Mon, Feb 16, 2015 at 04:40:35PM +0100, Stephan Witt wrote:
  
  In principle this is ok, but
  1. it doesn't solve the problem with HiRes-display on Mac and
  
  Why?
  
  2. did you check the effect on Tutorial.lyx where the icons are rendered 
  as
  part of the document?
  
  I'll attach an screenshot excerpt to give you an impression.
  
  Yes, the math icons seem to be problematic.
  
  With the info inset, I suspect that the icon size should be set to
  match the font ascent as well as possible. Currently, we use
  whatever icon gets loaded.
 
 The attached patch solves this issue. It makes sure that the size of
 the icons displayed in the info inset matches the nominal size.
 It has no effect with png icons, which are still displayed as before
 (unless they are bigger than the nominal size).
 
 However, I need using Qt in the insets dir. Is this OK?

I assume the answer is yes.

 BTW, when using the compressed svg icons in an info inset, LyX crashes
 when trying to preview the document. The crash is very bad and produces
 no backtrace, so I don't know what happens. Anyway, I traced this down
 to the fact that the icons are compressed. Indeed, uncompressing them
 (through, e.g., gunzip -c foo.svgz  foo.svg) and applying the svgicons
 patch after replacing everywhere svgz with svg, everything is fine.
 
 However, something fishy is occurring here. I did some experiments to
 try to understand the matter. I summarize here my findings.
 Inserting a svgz file through the graphics inset is Ok if the file is
 on a local file system. If, instead, the file is on an nfs mounted
 directory, then LyX crashes in the same bad manner when previewing.
 This also occurs for files that are on the same disk but on an NTFS
 partition (mounted using the linux ntfs-3g driver).
 
 I also found that Linux is able to display svgz files on screen in both
 the graphics inset and the info inset, while Windows and Solaris are
 not able to display them in the info inset (but the graphics inset is Ok).

I discovered the reason of this last thing. It is not related to the
platform or the kind of inset (graphics or info) but to whether the
directory containing the compressed svg is writable or not. Indeed,
LyX uncompresses the file before using it, but uses a temporary file
located in the same directory. Of course, if the directory is not
writable, the operation fails and the image is not displayed.

However, the problem that documents with svgz files used in the info
inset are not compilable is still unsolved. Anyway, I have a clue.
If you load in a graphics inset a svgz file residing in the lib/images
directory, the document does not compile. But, if you copy the exact
same svgz file in your home directory and load it, then the document
compiles. This is independent of the writability of the directory and
I have to still understand why this happens, but I feel it is something
as stupid as the temporary file thing.

-- 
Enrico


Re: [patch] Prefer svg icons

2015-03-11 Thread Enrico Forestieri
On Wed, Mar 11, 2015 at 10:50:00PM +0100, Enrico Forestieri wrote:
 
 I discovered the reason of this last thing. It is not related to the
 platform or the kind of inset (graphics or info) but to whether the
 directory containing the compressed svg is writable or not. Indeed,
 LyX uncompresses the file before using it, but uses a temporary file
 located in the same directory. Of course, if the directory is not
 writable, the operation fails and the image is not displayed.

Georg, is there any reason why a temporary file is not always created
in the LyX temporary directory?

-- 
Enrico


Re: [patch] Prefer svg icons

2015-03-11 Thread Richard Heck

On 03/11/2015 08:35 PM, Enrico Forestieri wrote:

On Wed, Mar 11, 2015 at 10:50:00PM +0100, Enrico Forestieri wrote:

However, the problem that documents with svgz files used in the info
inset are not compilable is still unsolved.

I have solved this mystery, too. When compiling, LyX converts the
uncompressed svg file to proper format (pdf or eps) by using
rsvg-convert. Now, rsvg-convert cannot deal with compressed svg
files, but you would think that this is not a problem because LyX
had already uncompressed the file. The point is that the stupid
thing only looks at the extension, and LyX still leaves the svgz
extension also for the uncompressed file. So, rsvg-convert refuses
to convert the file complaining that it is compressed...

Well, the temporary file thing and this one were the cause of all
the problems I have reported in this thread. Don't ask me why it
would fail if the file is in a nfs or ntfs mounted directory because
I have no explanation. All I know is that with the attached patch
everything is fine on all platforms I have access to.

So, barring the explanation about the temporary file location, I would
commit all this series of patches and also move the svg files to
proper place, so that LyX uses them instead of the png ones


This seems reasonable to me, and thanks for all the work: I gather that 
lack of decent
icons for hi-rez screens was one major issue blocking 2.2, though there 
is still other

work to be done at the level of actual hi-rez support.

Regarding the use of Qt in src/insets/, I have never quite understood 
the thinking here,
at least since we abandoned all other frontends. But if anyone objects, 
presumably it
would be trivial to create an imgWidth() method somewhere in support. 
That seems to

be all you need here.

Richard



Re: [patch] Prefer svg icons

2015-03-11 Thread Enrico Forestieri
On Wed, Mar 11, 2015 at 10:50:00PM +0100, Enrico Forestieri wrote:
 
 However, the problem that documents with svgz files used in the info
 inset are not compilable is still unsolved.

I have solved this mystery, too. When compiling, LyX converts the
uncompressed svg file to proper format (pdf or eps) by using
rsvg-convert. Now, rsvg-convert cannot deal with compressed svg
files, but you would think that this is not a problem because LyX
had already uncompressed the file. The point is that the stupid
thing only looks at the extension, and LyX still leaves the svgz
extension also for the uncompressed file. So, rsvg-convert refuses
to convert the file complaining that it is compressed...

Well, the temporary file thing and this one were the cause of all
the problems I have reported in this thread. Don't ask me why it
would fail if the file is in a nfs or ntfs mounted directory because
I have no explanation. All I know is that with the attached patch
everything is fine on all platforms I have access to.

So, barring the explanation about the temporary file location, I would
commit all this series of patches and also move the svg files to
proper place, so that LyX uses them instead of the png ones.

-- 
Enrico
diff --git a/src/support/TempFile.cpp b/src/support/TempFile.cpp
index 21559e1..6e5a91d 100644
--- a/src/support/TempFile.cpp
+++ b/src/support/TempFile.cpp
@@ -14,6 +14,7 @@
 
 #include support/debug.h
 #include support/FileName.h
+#include support/filetools.h
 #include support/Package.h
 #include support/qstring_helpers.h
 
@@ -47,14 +48,16 @@ struct TempFile::Private
 
 TempFile::TempFile(FileName const  temp_dir, string const  mask)
 {
-   QFileInfo tmp_fi(QDir(toqstr(temp_dir.absoluteFilePath())), 
toqstr(mask));
+   QFileInfo tmp_fi(QDir(toqstr(temp_dir.absoluteFilePath())),
+toqstr(onlyFileName(mask)));
d = new Private(tmp_fi.absoluteFilePath());
 }
 
 
 TempFile::TempFile(string const  mask)
 {
-   QFileInfo tmp_fi(QDir(toqstr(package().temp_dir().absoluteFilePath())), 
toqstr(mask));
+   QFileInfo tmp_fi(QDir(toqstr(package().temp_dir().absoluteFilePath())),
+toqstr(onlyFileName(mask)));
d = new Private(tmp_fi.absoluteFilePath());
 }
 
diff --git a/src/support/filetools.cpp b/src/support/filetools.cpp
index 2008838..8fd3031b 100644
--- a/src/support/filetools.cpp
+++ b/src/support/filetools.cpp
@@ -872,6 +872,8 @@ string const unzippedFileName(string const  zipped_file)
string const ext = getExtension(zipped_file);
if (ext == gz || ext == z || ext == Z)
return changeExtension(zipped_file, string());
+   else if (ext == svgz)
+   return changeExtension(zipped_file, svg);
return onlyPath(zipped_file) + unzipped_ + onlyFileName(zipped_file);
 }
 


Re: [patch] Prefer svg icons

2015-03-11 Thread Enrico Forestieri
On Tue, Mar 10, 2015 at 07:09:59PM +0100, Enrico Forestieri wrote:
> On Mon, Feb 16, 2015 at 09:13:13PM +0100, Jean-Marc Lasgouttes wrote:
> > Le 16/02/2015 21:10, Enrico Forestieri a écrit :
> > >On Mon, Feb 16, 2015 at 04:40:35PM +0100, Stephan Witt wrote:
> > >>
> > >>In principle this is ok, but
> > >>1. it doesn't solve the problem with HiRes-display on Mac and
> > >
> > >Why?
> > >
> > >>2. did you check the effect on Tutorial.lyx where the icons are rendered 
> > >>as
> > >>part of the document?
> > >>
> > >>I'll attach an screenshot excerpt to give you an impression.
> > >
> > >Yes, the math icons seem to be problematic.
> > 
> > With the info inset, I suspect that the icon size should be set to
> > match the font ascent as well as possible. Currently, we use
> > whatever icon gets loaded.
> 
> The attached patch solves this issue. It makes sure that the size of
> the icons displayed in the info inset matches the nominal size.
> It has no effect with png icons, which are still displayed as before
> (unless they are bigger than the nominal size).
> 
> However, I need using Qt in the insets dir. Is this OK?

I assume the answer is yes.

> BTW, when using the compressed svg icons in an info inset, LyX crashes
> when trying to preview the document. The crash is very bad and produces
> no backtrace, so I don't know what happens. Anyway, I traced this down
> to the fact that the icons are compressed. Indeed, uncompressing them
> (through, e.g., gunzip -c foo.svgz > foo.svg) and applying the svgicons
> patch after replacing everywhere "svgz" with "svg", everything is fine.
> 
> However, something fishy is occurring here. I did some experiments to
> try to understand the matter. I summarize here my findings.
> Inserting a svgz file through the graphics inset is Ok if the file is
> on a local file system. If, instead, the file is on an nfs mounted
> directory, then LyX crashes in the same bad manner when previewing.
> This also occurs for files that are on the same disk but on an NTFS
> partition (mounted using the linux ntfs-3g driver).
> 
> I also found that Linux is able to display svgz files on screen in both
> the graphics inset and the info inset, while Windows and Solaris are
> not able to display them in the info inset (but the graphics inset is Ok).

I discovered the reason of this last thing. It is not related to the
platform or the kind of inset (graphics or info) but to whether the
directory containing the compressed svg is writable or not. Indeed,
LyX uncompresses the file before using it, but uses a temporary file
located in the same directory. Of course, if the directory is not
writable, the operation fails and the image is not displayed.

However, the problem that documents with svgz files used in the info
inset are not compilable is still unsolved. Anyway, I have a clue.
If you load in a graphics inset a svgz file residing in the lib/images
directory, the document does not compile. But, if you copy the exact
same svgz file in your home directory and load it, then the document
compiles. This is independent of the writability of the directory and
I have to still understand why this happens, but I feel it is something
as stupid as the temporary file thing.

-- 
Enrico


Re: [patch] Prefer svg icons

2015-03-11 Thread Enrico Forestieri
On Wed, Mar 11, 2015 at 10:50:00PM +0100, Enrico Forestieri wrote:
> 
> I discovered the reason of this last thing. It is not related to the
> platform or the kind of inset (graphics or info) but to whether the
> directory containing the compressed svg is writable or not. Indeed,
> LyX uncompresses the file before using it, but uses a temporary file
> located in the same directory. Of course, if the directory is not
> writable, the operation fails and the image is not displayed.

Georg, is there any reason why a temporary file is not always created
in the LyX temporary directory?

-- 
Enrico


Re: [patch] Prefer svg icons

2015-03-11 Thread Enrico Forestieri
On Wed, Mar 11, 2015 at 10:50:00PM +0100, Enrico Forestieri wrote:
> 
> However, the problem that documents with svgz files used in the info
> inset are not compilable is still unsolved.

I have solved this mystery, too. When compiling, LyX converts the
uncompressed svg file to proper format (pdf or eps) by using
rsvg-convert. Now, rsvg-convert cannot deal with compressed svg
files, but you would think that this is not a problem because LyX
had already uncompressed the file. The point is that the stupid
thing only looks at the extension, and LyX still leaves the svgz
extension also for the uncompressed file. So, rsvg-convert refuses
to convert the file complaining that it is compressed...

Well, the temporary file thing and this one were the cause of all
the problems I have reported in this thread. Don't ask me why it
would fail if the file is in a nfs or ntfs mounted directory because
I have no explanation. All I know is that with the attached patch
everything is fine on all platforms I have access to.

So, barring the explanation about the temporary file location, I would
commit all this series of patches and also move the svg files to
proper place, so that LyX uses them instead of the png ones.

-- 
Enrico
diff --git a/src/support/TempFile.cpp b/src/support/TempFile.cpp
index 21559e1..6e5a91d 100644
--- a/src/support/TempFile.cpp
+++ b/src/support/TempFile.cpp
@@ -14,6 +14,7 @@
 
 #include "support/debug.h"
 #include "support/FileName.h"
+#include "support/filetools.h"
 #include "support/Package.h"
 #include "support/qstring_helpers.h"
 
@@ -47,14 +48,16 @@ struct TempFile::Private
 
 TempFile::TempFile(FileName const & temp_dir, string const & mask)
 {
-   QFileInfo tmp_fi(QDir(toqstr(temp_dir.absoluteFilePath())), 
toqstr(mask));
+   QFileInfo tmp_fi(QDir(toqstr(temp_dir.absoluteFilePath())),
+toqstr(onlyFileName(mask)));
d = new Private(tmp_fi.absoluteFilePath());
 }
 
 
 TempFile::TempFile(string const & mask)
 {
-   QFileInfo tmp_fi(QDir(toqstr(package().temp_dir().absoluteFilePath())), 
toqstr(mask));
+   QFileInfo tmp_fi(QDir(toqstr(package().temp_dir().absoluteFilePath())),
+toqstr(onlyFileName(mask)));
d = new Private(tmp_fi.absoluteFilePath());
 }
 
diff --git a/src/support/filetools.cpp b/src/support/filetools.cpp
index 2008838..8fd3031b 100644
--- a/src/support/filetools.cpp
+++ b/src/support/filetools.cpp
@@ -872,6 +872,8 @@ string const unzippedFileName(string const & zipped_file)
string const ext = getExtension(zipped_file);
if (ext == "gz" || ext == "z" || ext == "Z")
return changeExtension(zipped_file, string());
+   else if (ext == "svgz")
+   return changeExtension(zipped_file, "svg");
return onlyPath(zipped_file) + "unzipped_" + onlyFileName(zipped_file);
 }
 


Re: [patch] Prefer svg icons

2015-03-11 Thread Richard Heck

On 03/11/2015 08:35 PM, Enrico Forestieri wrote:

On Wed, Mar 11, 2015 at 10:50:00PM +0100, Enrico Forestieri wrote:

However, the problem that documents with svgz files used in the info
inset are not compilable is still unsolved.

I have solved this mystery, too. When compiling, LyX converts the
uncompressed svg file to proper format (pdf or eps) by using
rsvg-convert. Now, rsvg-convert cannot deal with compressed svg
files, but you would think that this is not a problem because LyX
had already uncompressed the file. The point is that the stupid
thing only looks at the extension, and LyX still leaves the svgz
extension also for the uncompressed file. So, rsvg-convert refuses
to convert the file complaining that it is compressed...

Well, the temporary file thing and this one were the cause of all
the problems I have reported in this thread. Don't ask me why it
would fail if the file is in a nfs or ntfs mounted directory because
I have no explanation. All I know is that with the attached patch
everything is fine on all platforms I have access to.

So, barring the explanation about the temporary file location, I would
commit all this series of patches and also move the svg files to
proper place, so that LyX uses them instead of the png ones


This seems reasonable to me, and thanks for all the work: I gather that 
lack of decent
icons for hi-rez screens was one major issue blocking 2.2, though there 
is still other

work to be done at the level of actual hi-rez support.

Regarding the use of Qt in src/insets/, I have never quite understood 
the thinking here,
at least since we abandoned all other frontends. But if anyone objects, 
presumably it
would be trivial to create an imgWidth() method somewhere in support. 
That seems to

be all you need here.

Richard



  1   2   >