Re: LyX SVG output size wrong

2018-09-21 Thread Daniel

On 20/09/2018 13:56, Jean-Marc Lasgouttes wrote:
I think that at this point it would be a good idea to open a ticket. 


Ticket at https://www.lyx.org/trac/ticket/11301.

Daniel





Re: LyX SVG output size wrong

2018-09-20 Thread Daniel

On 20/09/2018 14:34, Jean-Marc Lasgouttes wrote:

Le 20/09/2018 à 14:24, Daniel a écrit :
I just tried a conversion via Inkscape which works fine. Maybe there 
is a way to replace the conversion via rsvg-convert with Inkscape?


Inkscape is used when rsvg-convert is not available. Otherwise, you can 
change it by hand in your preferences.


Making rsvg-convert unavailable indeed solves the problem. Thanks.

I'll ask the rsvg people anyway since it is a solution only for those 
who have Inkscape...


Daniel



Re: LyX SVG output size wrong

2018-09-20 Thread Daniel

On 20/09/2018 14:24, Jean-Marc Lasgouttes wrote:

Le 20/09/2018 à 14:23, Daniel a écrit :

On 20/09/2018 14:00, Jean-Marc Lasgouttes wrote:

Le 20/09/2018 à 13:43, Daniel a écrit :

No idea what my converter is. How do I find out?


I just tried out online SVG to PNG converters. With Imagick the 
result was fine. However, with another tool that (like...) used 
rsvg the result was the same as in LyX. So maybe rsvg does not 
handle them correctly or needs some argument or so?


To find what your svg converter is, go In Tools>Preferences>File 
Handling>Converters, and look at the converters from svg to something 
else.


It's rsvg-convert then.


If you can get the rsvg-convert people to tell us how we are supposed to 
handle images, there may be things we can do.


Good idea. I'll try.



Re: LyX SVG output size wrong

2018-09-20 Thread Jean-Marc Lasgouttes

Le 20/09/2018 à 14:24, Daniel a écrit :
I just tried a conversion via Inkscape which works fine. Maybe there is 
a way to replace the conversion via rsvg-convert with Inkscape?


Inkscape is used when rsvg-convert is not available. Otherwise, you can 
change it by hand in your preferences.


JMarc


Re: LyX SVG output size wrong

2018-09-20 Thread Daniel

On 20/09/2018 13:56, Jean-Marc Lasgouttes wrote:

Le 20/09/2018 à 13:14, Daniel a écrit :

On 20/09/2018 10:58, Jean-Marc Lasgouttes wrote:

Le 20/09/2018 à 10:21, Daniel a écrit :
This leads to the middle and right text in the attached file having 
different sizes in LyX while they have the same size in other 
applications I tested.


It looks like we do not pass any information to the svg converter 
concerning dpi.


A few questions:

* what is you dpi setting in LyX?


I couldn't find a setting for this in LyX.


* what is your zoom setting in LyX?


120%.

But both of these question concern just the representation within LyX 
and not in the output which I was mainly concerned about.


Very good point. I did not get that initially.

I think that at this point it would be a good idea to open a ticket. 
Unfortunately, I am not sure we will be able to do something about it.


I just tried a conversion via Inkscape which works fine. Maybe there is 
a way to replace the conversion via rsvg-convert with Inkscape?


Daniel



Re: LyX SVG output size wrong

2018-09-20 Thread Jean-Marc Lasgouttes

Le 20/09/2018 à 14:23, Daniel a écrit :

On 20/09/2018 14:00, Jean-Marc Lasgouttes wrote:

Le 20/09/2018 à 13:43, Daniel a écrit :

No idea what my converter is. How do I find out?


I just tried out online SVG to PNG converters. With Imagick the 
result was fine. However, with another tool that (like...) used rsvg 
the result was the same as in LyX. So maybe rsvg does not handle 
them correctly or needs some argument or so?


To find what your svg converter is, go In Tools>Preferences>File 
Handling>Converters, and look at the converters from svg to something 
else.


It's rsvg-convert then.


If you can get the rsvg-convert people to tell us how we are supposed to 
handle images, there may be things we can do.


JMarc


Re: LyX SVG output size wrong

2018-09-20 Thread Daniel

On 20/09/2018 14:00, Jean-Marc Lasgouttes wrote:

Le 20/09/2018 à 13:43, Daniel a écrit :

No idea what my converter is. How do I find out?


I just tried out online SVG to PNG converters. With Imagick the 
result was fine. However, with another tool that (like...) used rsvg 
the result was the same as in LyX. So maybe rsvg does not handle them 
correctly or needs some argument or so?


To find what your svg converter is, go In Tools>Preferences>File 
Handling>Converters, and look at the converters from svg to something else.


It's rsvg-convert then.



This report from 2016 seems to point to a rsvg bug:
http://www.imagemagick.org/discourse-server/viewtopic.php?t=30591

JMarc






Re: LyX SVG output size wrong

2018-09-20 Thread Jean-Marc Lasgouttes

Le 20/09/2018 à 13:43, Daniel a écrit :

No idea what my converter is. How do I find out?


I just tried out online SVG to PNG converters. With Imagick the result 
was fine. However, with another tool that (like...) used rsvg the 
result was the same as in LyX. So maybe rsvg does not handle them 
correctly or needs some argument or so?


To find what your svg converter is, go In Tools>Preferences>File 
Handling>Converters, and look at the converters from svg to something else.


This report from 2016 seems to point to a rsvg bug:
http://www.imagemagick.org/discourse-server/viewtopic.php?t=30591

JMarc


Re: LyX SVG output size wrong

2018-09-20 Thread Jean-Marc Lasgouttes

Le 20/09/2018 à 13:14, Daniel a écrit :

On 20/09/2018 10:58, Jean-Marc Lasgouttes wrote:

Le 20/09/2018 à 10:21, Daniel a écrit :
This leads to the middle and right text in the attached file having 
different sizes in LyX while they have the same size in other 
applications I tested.


It looks like we do not pass any information to the svg converter 
concerning dpi.


A few questions:

* what is you dpi setting in LyX?


I couldn't find a setting for this in LyX.


* what is your zoom setting in LyX?


120%.

But both of these question concern just the representation within LyX 
and not in the output which I was mainly concerned about.


Very good point. I did not get that initially.

I think that at this point it would be a good idea to open a ticket. 
Unfortunately, I am not sure we will be able to do something about it.


JMarc


Re: LyX SVG output size wrong

2018-09-20 Thread Daniel

On 20/09/2018 13:39, Daniel wrote:

On 20/09/2018 13:14, Daniel wrote:

On 20/09/2018 10:58, Jean-Marc Lasgouttes wrote:

Le 20/09/2018 à 10:21, Daniel a écrit :
This leads to the middle and right text in the attached file having 
different sizes in LyX while they have the same size in other 
applications I tested.


It looks like we do not pass any information to the svg converter 
concerning dpi.


A few questions:

* what is you dpi setting in LyX?


I couldn't find a setting for this in LyX.


* what is your zoom setting in LyX?


120%.

But both of these question concern just the representation within LyX 
and not in the output which I was mainly concerned about.



* what is your svg->* converter?

I see here the same as what you describe. My system does not have 
rsvg-convert installed, so conversion is done by inkscape to EPS (why 
EPS? No idea).


No idea what my converter is. How do I find out?


I just tried out online SVG to PNG converters. With Imagick the result 
was fine. However, with another tool that (like...) used rsvg the result 
was the same as in LyX. So maybe rsvg does not handle them correctly or 
needs some argument or so?


"like..." should be "likely..."



Re: LyX SVG output size wrong

2018-09-20 Thread Daniel

On 20/09/2018 13:14, Daniel wrote:

On 20/09/2018 10:58, Jean-Marc Lasgouttes wrote:

Le 20/09/2018 à 10:21, Daniel a écrit :
This leads to the middle and right text in the attached file having 
different sizes in LyX while they have the same size in other 
applications I tested.


It looks like we do not pass any information to the svg converter 
concerning dpi.


A few questions:

* what is you dpi setting in LyX?


I couldn't find a setting for this in LyX.


* what is your zoom setting in LyX?


120%.

But both of these question concern just the representation within LyX 
and not in the output which I was mainly concerned about.



* what is your svg->* converter?

I see here the same as what you describe. My system does not have 
rsvg-convert installed, so conversion is done by inkscape to EPS (why 
EPS? No idea).


No idea what my converter is. How do I find out?


I just tried out online SVG to PNG converters. With Imagick the result 
was fine. However, with another tool that (like...) used rsvg the result 
was the same as in LyX. So maybe rsvg does not handle them correctly or 
needs some argument or so?


Daniel



Re: LyX SVG output size wrong

2018-09-20 Thread Daniel

On 20/09/2018 10:58, Jean-Marc Lasgouttes wrote:

Le 20/09/2018 à 10:21, Daniel a écrit :
This leads to the middle and right text in the attached file having 
different sizes in LyX while they have the same size in other 
applications I tested.


It looks like we do not pass any information to the svg converter 
concerning dpi.


A few questions:

* what is you dpi setting in LyX?


I couldn't find a setting for this in LyX.


* what is your zoom setting in LyX?


120%.

But both of these question concern just the representation within LyX 
and not in the output which I was mainly concerned about.



* what is your svg->* converter?

I see here the same as what you describe. My system does not have 
rsvg-convert installed, so conversion is done by inkscape to EPS (why 
EPS? No idea).


No idea what my converter is. How do I find out?

Daniel




Re: LyX SVG output size wrong

2018-09-20 Thread Daniel

On 2018-09-20 10:58, Jean-Marc Lasgouttes wrote:

Le 20/09/2018 à 10:21, Daniel a écrit :

Inkscape/Libre/Firefox: 1pt = 1.333px = 1.333


This corresponds to a setting of 96dpi. But obviously the number of 
pixels depends on your zoom setting in firefox/libreoffice..., doesn't it?


Firefox/LibreOffice scale the SVG so that 1pt in the application matches 
1.33px in the SVG. How many pixel that will be on your screen is 
determined by your DPI.


Daniel



Re: LyX SVG output size wrong

2018-09-20 Thread Jean-Marc Lasgouttes

Le 20/09/2018 à 10:21, Daniel a écrit :

Inkscape/Libre/Firefox: 1pt = 1.333px = 1.333


This corresponds to a setting of 96dpi. But obviously the number of 
pixels depends on your zoom setting in firefox/libreoffice..., doesn't it?



LyX: 1pt = 1px = 1


This leads to the middle and right text in the attached file having 
different sizes in LyX while they have the same size in other 
applications I tested.


It looks like we do not pass any information to the svg converter 
concerning dpi.


A few questions:

* what is you dpi setting in LyX?

* what is your zoom setting in LyX?

* what is your svg->* converter?

I see here the same as what you describe. My system does not have 
rsvg-convert installed, so conversion is done by inkscape to EPS (why 
EPS? No idea).


JMarc



Re: LyX SVG output size wrong

2018-09-20 Thread Daniel

On 20/09/2018 09:11, Daniel wrote:

On 20/09/2018 00:05, Jean-Marc Lasgouttes wrote:

Le 19/09/2018 à 23:54, Daniel a écrit :
The link you gave assumes that everything is displayed at 90dpi 
(which gives the 1.25 once you know that 1pt is 1/72th of inch).


I have no idea of how computations are done for svg images : 
external program rsvg, qt, inkscape...


But what matters is that the output is accurate, or not? The SVG spec 
sets 1px = 1pt independent of the resolution. Then it's the job of 
the program, like LyX (or whatever LyX is using to output SVG) to 
output it correctly. And this is not done correctly.


You mean 1.25px, right? I do not say I am giving a solution. I am 
thinking aloud. I do not even know what code (is it ours?) is to blame.


Yes, I meant 1.25px.

Just checked Inkscape and it converts 10pt font-size to 13.px 
font-size. But Libre Writer is still able to show it correctly as 12pt. 
So, there must be some data in the file (attached). 


Seems like I was wrong again. It seems like throughout:

Inkscape/Libre/Firefox: 1pt = 1.333px = 1.333

LyX: 1pt = 1px = 1

This leads to the middle and right text in the attached file having 
different sizes in LyX while they have the same size in other 
applications I tested.


Daniel


Re: LyX SVG output size wrong

2018-09-20 Thread Daniel

On 20/09/2018 00:05, Jean-Marc Lasgouttes wrote:

Le 19/09/2018 à 23:54, Daniel a écrit :
The link you gave assumes that everything is displayed at 90dpi 
(which gives the 1.25 once you know that 1pt is 1/72th of inch).


I have no idea of how computations are done for svg images : external 
program rsvg, qt, inkscape...


But what matters is that the output is accurate, or not? The SVG spec 
sets 1px = 1pt independent of the resolution. Then it's the job of the 
program, like LyX (or whatever LyX is using to output SVG) to output 
it correctly. And this is not done correctly.


You mean 1.25px, right? I do not say I am giving a solution. I am 
thinking aloud. I do not even know what code (is it ours?) is to blame.


Yes, I meant 1.25px.

Just checked Inkscape and it converts 10pt font-size to 13.px 
font-size. But Libre Writer is still able to show it correctly as 12pt. 
So, there must be some data in the file (attached). However, this too is 
not interpreted in LyX correctly and I have to set the scale to 75% in 
order to get the correct result.


Daniel


Re: LyX SVG output size wrong

2018-09-19 Thread Jean-Marc Lasgouttes

Le 19/09/2018 à 23:54, Daniel a écrit :
The link you gave assumes that everything is displayed at 90dpi (which 
gives the 1.25 once you know that 1pt is 1/72th of inch).


I have no idea of how computations are done for svg images : external 
program rsvg, qt, inkscape...


But what matters is that the output is accurate, or not? The SVG spec 
sets 1px = 1pt independent of the resolution. Then it's the job of the 
program, like LyX (or whatever LyX is using to output SVG) to output it 
correctly. And this is not done correctly.


You mean 1.25px, right? I do not say I am giving a solution. I am 
thinking aloud. I do not even know what code (is it ours?) is to blame.


JMarc


Re: LyX SVG output size wrong

2018-09-19 Thread Daniel

On 19/09/2018 23:07, Jean-Marc Lasgouttes wrote:

Le 19/09/2018 à 22:45, Daniel a écrit :

"1pt" equals "1.25px" (and therefore 1.25 user units)

https://www.w3.org/TR/SVG11/coords.html#Units

The basic problem is that LyX treats 1 svg pixel as 1pt rather than 
0.8pt.


The link you gave assumes that everything is displayed at 90dpi (which 
gives the 1.25 once you know that 1pt is 1/72th of inch).


I have no idea of how computations are done for svg images : external 
program rsvg, qt, inkscape...


But what matters is that the output is accurate, or not? The SVG spec 
sets 1px = 1pt independent of the resolution. Then it's the job of the 
program, like LyX (or whatever LyX is using to output SVG) to output it 
correctly. And this is not done correctly.


Daniel



Re: LyX SVG output size wrong

2018-09-19 Thread Jean-Marc Lasgouttes

Le 19/09/2018 à 22:45, Daniel a écrit :

"1pt" equals "1.25px" (and therefore 1.25 user units)

https://www.w3.org/TR/SVG11/coords.html#Units

The basic problem is that LyX treats 1 svg pixel as 1pt rather than 0.8pt.


The link you gave assumes that everything is displayed at 90dpi (which 
gives the 1.25 once you know that 1pt is 1/72th of inch).


I have no idea of how computations are done for svg images : external 
program rsvg, qt, inkscape...


JMarc



Re: LyX SVG output size wrong

2018-09-19 Thread Daniel

On 19/09/2018 21:00, Daniel wrote:

On 19/09/2018 18:02, Daniel wrote:

On 19/09/2018 16:55, Daniel wrote:

Hi,

I believe LyX outputs SVGs in the wrong size. Attached is an SVG 
where the right text "Test" is explicitly set to 12pt. Libre Writer 
shows the font-size correctly (see screenshot). However, LyX seems to 
scale the SVG so that "12pt" matches the unit-less (or pixel) size of 
"12" (see screenshot). That seems incorrect.


Also, is there a workaround?


Okay, a work around is to set Scale graphics (%) to 75 (=1/1.3).


Or it might be 80 (=1/1.25)... I am not fully sure yet


Okay, it's 80, I think.

This is also what the SVG specs say for the ratio between pc and pt:

"1pt" equals "1.25px" (and therefore 1.25 user units)

https://www.w3.org/TR/SVG11/coords.html#Units

The basic problem is that LyX treats 1 svg pixel as 1pt rather than 0.8pt.

Daniel



Re: LyX SVG output size wrong

2018-09-19 Thread Daniel

On 19/09/2018 18:02, Daniel wrote:

On 19/09/2018 16:55, Daniel wrote:

Hi,

I believe LyX outputs SVGs in the wrong size. Attached is an SVG where 
the right text "Test" is explicitly set to 12pt. Libre Writer shows 
the font-size correctly (see screenshot). However, LyX seems to scale 
the SVG so that "12pt" matches the unit-less (or pixel) size of "12" 
(see screenshot). That seems incorrect.


Also, is there a workaround?


Okay, a work around is to set Scale graphics (%) to 75 (=1/1.3).


Or it might be 80 (=1/1.25)... I am not fully sure yet



Re: LyX SVG output size wrong

2018-09-19 Thread Daniel

On 19/09/2018 16:55, Daniel wrote:

Hi,

I believe LyX outputs SVGs in the wrong size. Attached is an SVG where 
the right text "Test" is explicitly set to 12pt. Libre Writer shows the 
font-size correctly (see screenshot). However, LyX seems to scale the 
SVG so that "12pt" matches the unit-less (or pixel) size of "12" (see 
screenshot). That seems incorrect.


Also, is there a workaround?


Okay, a work around is to set Scale graphics (%) to 75 (=1/1.3).

However, I still think the defaults in LyX are incorrect.

Daniel



LyX SVG output size wrong

2018-09-19 Thread Daniel

Hi,

I believe LyX outputs SVGs in the wrong size. Attached is an SVG where 
the right text "Test" is explicitly set to 12pt. Libre Writer shows the 
font-size correctly (see screenshot). However, LyX seems to scale the 
SVG so that "12pt" matches the unit-less (or pixel) size of "12" (see 
screenshot). That seems incorrect.


Also, is there a workaround?

Daniel


font-size-pt.odt
Description: application/vnd.oasis.opendocument.text


font-size-pt.lyx
Description: application/lyx