You are not logged in.

#1 2018-01-16 23:18:58

Salkay
Member
Registered: 2014-05-22
Posts: 618

[SOLVED] Image rendering differently on two systems

I have just upgraded my system, moving from an aging laptop to a new desktop. I cloned my home directory, and have installed almost identical packages (including identical fonts). However, Inkscape is rendering an svg differently in both.

The image in question includes a dot from a graph produced by R and imported into Inkscape. The font is ZapfDingbats, although I don't have that installed on either system. Presumably there is some fallback font that is used, although I'm not sure which, and I'm not sure how to tell.

Here is a minimal failing example, rendered on the original laptop.

V0uAa.png

And here it is on the new computer.

0z8qH.png

Here is the svg.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->

<svg
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:cc="http://creativecommons.org/ns#"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
   inkscape:export-ydpi="72"
   inkscape:export-xdpi="72"
   sodipodi:docname="minimal.svg"
   inkscape:version="0.92.2 5c3e80d, 2017-08-06"
   version="1.1"
   id="svg5366"
   height="1.1591525mm"
   width="1.2328247mm"
   style="enable-background:new">
  <defs
     id="defs404" />
  <sodipodi:namedview
     id="base"
     pagecolor="#ffffff"
     bordercolor="#666666"
     borderopacity="1.0"
     inkscape:pageopacity="0.0"
     inkscape:pageshadow="2"
     inkscape:zoom="46.556467"
     inkscape:cx="-1.581373"
     inkscape:cy="1.0153308"
     inkscape:document-units="px"
     inkscape:current-layer="layer3"
     showgrid="false"
     units="mm"
     inkscape:window-width="1920"
     inkscape:window-height="1025"
     inkscape:window-x="-2"
     inkscape:window-y="-3"
     inkscape:window-maximized="1"
     showguides="false"
     inkscape:guide-bbox="true"
     inkscape:object-nodes="true"
     inkscape:snap-grids="true"
     inkscape:snap-to-guides="true"
     width="85mm"
     inkscape:snap-bbox="true"
     inkscape:snap-page="false"
     inkscape:snap-global="false"
     inkscape:bbox-paths="true"
     inkscape:snap-smooth-nodes="true"
     inkscape:bbox-nodes="true"
     inkscape:object-paths="true"
     inkscape:snap-intersection-paths="true"
     fit-margin-top="0"
     fit-margin-left="0"
     fit-margin-right="0"
     fit-margin-bottom="0"
     inkscape:measure-start="318.1,324.217"
     inkscape:measure-end="141.254,325.329">
    <sodipodi:guide
       id="guide10119"
       position="457.29538,3727.4972"
       orientation="1,0"
       inkscape:locked="false" />
    <inkscape:grid
       type="xygrid"
       id="grid11091"
       originx="-1381.5952"
       originy="-1151.5606"
       spacingx="1"
       spacingy="1" />
  </sodipodi:namedview>
  <metadata
     id="metadata5371">
    <rdf:RDF>
      <cc:Work
         rdf:about="">
        <dc:format>image/svg+xml</dc:format>
        <dc:type
           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
        <dc:title />
      </cc:Work>
    </rdf:RDF>
  </metadata>
  <g
     inkscape:groupmode="layer"
     id="layer3"
     inkscape:label="layer 1"
     transform="translate(-1381.5952,-2838.3444)"
     style="display:inline">
    <g
       id="g9897-7"
       transform="matrix(0.39999999,0,0,-0.39999999,1272.6062,2612.0023)" />
    <g
       id="g8419"
       transform="matrix(0.39999999,0,0,-0.39999999,1301.5256,2904.2752)" />
    <text
       style="font-variant:normal;font-weight:normal;font-size:2.99199986px;font-family:ZapfDingbats;-inkscape-font-specification:ZapfDingbats;writing-mode:lr-tb;fill:#bbbbbb;fill-opacity:1;fill-rule:nonzero;stroke:#bbbbbb;stroke-width:0.29999998;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1"
       id="text8561"
       x="1382.6176"
       y="2842.2073">
      <tspan
         x="1382.6176"
         y="2842.2073"
         id="tspan8559"
         style="stroke-width:0.29999998">●</tspan>
    </text>
    <text
       style="font-variant:normal;font-weight:normal;font-size:2.99199986px;font-family:ZapfDingbats;-inkscape-font-specification:ZapfDingbats;writing-mode:lr-tb;fill:#bbbbbb;fill-opacity:1;fill-rule:nonzero;stroke:#bbbbbb;stroke-width:0.29999998;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1"
       id="text8585"
       x="1381.5815"
       y="2840.4111">
      <tspan
         x="1381.5815"
         y="2840.4111"
         id="tspan8583"
         style="stroke-width:0.29999998">●</tspan>
    </text>
    <text
       style="font-variant:normal;font-weight:normal;font-size:2.99199986px;font-family:ZapfDingbats;-inkscape-font-specification:ZapfDingbats;writing-mode:lr-tb;fill:#bbbbbb;fill-opacity:1;fill-rule:nonzero;stroke:#bbbbbb;stroke-width:0.29999998;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1"
       id="text8609"
       x="1383.6576"
       y="2840.4111">
      <tspan
         x="1383.6576"
         y="2840.4111"
         id="tspan8607"
         style="stroke-width:0.29999998">●</tspan>
    </text>
  </g>
</svg>

I've gone through the font list in Inkscape, and both systems are identical. There is clearly something different in my two systems. What else could I check?

Last edited by Salkay (2018-01-23 09:09:34)

Offline

#2 2018-01-16 23:56:45

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,442
Website

Re: [SOLVED] Image rendering differently on two systems

Salkay wrote:

Presumably there is some fallback font that is used, although I'm not sure which, and I'm not sure how to tell.

fc-match ZapfDingbats

"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2018-01-17 07:11:13

Salkay
Member
Registered: 2014-05-22
Posts: 618

Re: [SOLVED] Image rendering differently on two systems

Ah thank you! That command gives the same result on both systems.

$ fc-match ZapfDingbats
D050000L.otf: "D050000L" "Regular"

This font is installed on both systems (at /usr/share/fonts/gsfonts/D050000L.otf), but I'm not sure why they are rendering differently. I then tried typing the following into Abiword, and setting the font to D050000L.

●qwerty

The qwerty part looked consistent on both systems. However, the ● glyph was much larger than the other characters on my newer system! What could cause that?

Offline

#4 2018-01-17 08:21:34

seth
Member
Registered: 2012-09-03
Posts: 49,967

Re: [SOLVED] Image rendering differently on two systems

Likely the stroke and probably DPI related: xdpyinfo | grep resolution

Offline

#5 2018-01-17 08:39:21

Salkay
Member
Registered: 2014-05-22
Posts: 618

Re: [SOLVED] Image rendering differently on two systems

Oh, that's… bizarre. The newer system is "93x95 dots per inch" and the other is "96x96 dots per inch". This just brings up more questions though…

1. Why are they different, even after plugging the same monitor into the laptop?
2. Why doess my new system not have the same width dpi and height dpi?
3. I should have mentioned that I get the same output when exporting to PDF. I don't really understand how the X server's dpi would affect this. Also, the difference between the two systems' dpi isn't enough. Measuring the pictures on my first post, the glyphs are 46 and 70 pixels high, a difference much larger than the dpi difference.

Offline

#6 2018-01-17 11:56:52

seth
Member
Registered: 2012-09-03
Posts: 49,967

Re: [SOLVED] Image rendering differently on two systems

The value isn't necessarily calculated, also they're taken from one device at best.
What's

xrandr -q

on each system?

Offline

#7 2018-01-17 12:09:34

Salkay
Member
Registered: 2014-05-22
Posts: 618

Re: [SOLVED] Image rendering differently on two systems

Thank you for your continued help. On the old laptop, with the external monitor unplugged.

Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 8192 x 8192
LVDS-1 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 382mm x 215mm
   1920x1080     60.00*+
   1400x1050     59.98  
   1280x1024     60.02  
   1280x960      60.00  
   1024x768      60.04    60.00  
   960x720       60.00  
   928x696       60.05  
   896x672       60.01  
   800x600       60.00    60.32    56.25  
   700x525       59.98  
   640x512       60.02  
   640x480       60.00    59.94  
   512x384       60.00  
   400x300       60.32    56.34  
   320x240       60.05  
VGA-1 disconnected (normal left inverted right x axis y axis)
HDMI-1 disconnected (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)

On the new desktop, with the external monitor.

Screen 0: minimum 8 x 8, current 1920 x 1200, maximum 32767 x 32767
DVI-D-0 disconnected (normal left inverted right x axis y axis)
HDMI-0 disconnected (normal left inverted right x axis y axis)
DP-0 connected primary 1920x1200+0+0 (normal left inverted right x axis y axis) 518mm x 324mm
   1920x1200     59.95*+
   1920x1080     60.00  
   1680x1050     59.95  
   1600x1200     60.00  
   1280x1024     60.02  
   1280x960      60.00  
   1024x768      60.00  
   800x600       60.32  
   640x480       59.94  
DP-1 disconnected (normal left inverted right x axis y axis)
DP-2 disconnected (normal left inverted right x axis y axis)
DP-3 disconnected (normal left inverted right x axis y axis)
DP-4 disconnected (normal left inverted right x axis y axis)
DP-5 disconnected (normal left inverted right x axis y axis)

Offline

#8 2018-01-17 12:23:41

seth
Member
Registered: 2012-09-03
Posts: 49,967

Re: [SOLVED] Image rendering differently on two systems

The old laptops internal screen has ~128 dpi and the external monitor has ~94 dpi
What about the new laptops internal screen?

Offline

#9 2018-01-17 13:09:57

Salkay
Member
Registered: 2014-05-22
Posts: 618

Re: [SOLVED] Image rendering differently on two systems

Sorry, to clarify, the new system is a desktop, and it's only connected to the external monitor.

(Also, as a potential aside, when I tested the D050000L font in Abiword, the ● was rendered larger (when compared to the alphabetical characters) on the new desktop compared to the old laptop. I would have presumed all glyphs to render the same relative size compared to other glyphs, regardless of the dpi?)

Offline

#10 2018-01-17 13:12:54

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,442
Website

Re: [SOLVED] Image rendering differently on two systems

Even if that suspicion is true (I'm not sure it is) do you know that the glyph in question is actually provided by that font?  That may be the font you are attempting to use, but if you use a character not provided by that font, each system will search for a fallback font that provides that character: they may fallback on different fonts.

Font-config makes such things rather hard to trace, but comparing the output of `fc-match -s $fontname` on each machine would be a step in the right direction.

Last edited by Trilby (2018-01-17 13:15:39)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#11 2018-01-17 13:50:40

seth
Member
Registered: 2012-09-03
Posts: 49,967

Re: [SOLVED] Image rendering differently on two systems

FC_DEBUG=4 pango-view --font="ZapfDingbats" -t "●" | grep family:

This can also be impacted by the hinting settings (notably autohinter ./. BIC)

I didn't realize that the svg renders a glyph. This is very most likely just about the font resolution and does not depend on the DPI - notably since you don't have ZapfDingbats anywhere.

Last edited by seth (2018-01-17 13:52:12)

Offline

#12 2018-01-18 12:02:57

Salkay
Member
Registered: 2014-05-22
Posts: 618

Re: [SOLVED] Image rendering differently on two systems

Trilby wrote:

do you know that the glyph in question is actually provided by that font?

seth wrote:
FC_DEBUG=4 pango-view --font="ZapfDingbats" -t "●" | grep family:

I wasn't exactly sure how to parse the output of that command. It popped up a window displaying the glyph, and about 30 long lines of text.

I'm guess this is equivalent; I installed gucharmap and checked for the ● glyph. I specified D050000L as the font. On my old laptop, the glyph was provided by Noto Sans, on my new desktop, it's provided by DejaVu Sans! Also, the latter's glyph looks much larger!

So now the question is… why are the fallbacks different on each system?

Offline

#13 2018-01-18 12:11:31

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,442
Website

Re: [SOLVED] Image rendering differently on two systems

Salkay wrote:

So now the question is… why are the fallbacks different on each system?

Either you have different fonts installed, or different configurations under /etc/fonts

One of many reasons I'm not at all fond of font-config.  While I'm pretty sure it's behavior actually is deterministic, one would never be led to that conclusion by observing it's results.

I'm curious what your end goal is here, though.  Is this file strictly for personal use across just these two computers?  If so, does it really matter that the dots are different size?  If this file is to be shared with anyone else, or used anywhere else, then the minutia of why it appears different on your two arch linux systems with the same versions of software, same fonts, and everything as 'same' as you can make it is irrelevant: if the image renders differently on these two computers, it will definitely not render predictably anywhere else.

If you need it to render consistently, do not rely on mechanisms that are not even expected to provide consistent rendering: get it the way you want on one system, then convert text to paths as paths will render consistently.

Last edited by Trilby (2018-01-18 12:31:18)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#14 2018-01-22 07:27:48

Salkay
Member
Registered: 2014-05-22
Posts: 618

Re: [SOLVED] Image rendering differently on two systems

Trilby wrote:
Salkay wrote:

So now the question is… why are the fallbacks different on each system?

Either you have different fonts installed, or different configurations under /etc/fonts

Ugh. I had already checked that all fonts were identical, but my old laptop had a file at /etc/fonts/local.conf. After the deprecation of infinality, I had something had recommended this file. Thanks again for all the help. After copying this file over, everything is consistent again.

Trilby wrote:

I'm curious what your end goal is here, though.  Is this file strictly for personal use across just these two computers?  If so, does it really matter that the dots are different size?  If this file is to be shared with anyone else, or used anywhere else, then the minutia of why it appears different on your two arch linux systems with the same versions of software, same fonts, and everything as 'same' as you can make it is irrelevant: if the image renders differently on these two computers, it will definitely not render predictably anywhere else.

If you need it to render consistently, do not rely on mechanisms that are not even expected to provide consistent rendering: get it the way you want on one system, then convert text to paths as paths will render consistently.

I had some graphs that I exported from R, then imported into Inkscape so that I could modify them in preparation for publication. I'd set up the size of the plotted dots exported from R so that they rendered correctly downstream. However, after moving systems, the dots were overlapping each other, and looked poor. Hence, I was trying to get them back to the pretty version.

I'm exporting to PDF, so converting text to paths shouldn't be strictly necessary. However, next time I export from R, I'll certainly see how I can specify fonts that exist on my system, and/or export as paths instead!

Offline

#15 2018-01-22 12:27:27

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,442
Website

Re: [SOLVED] Image rendering differently on two systems

I don't know that R can create text as paths (I'm doubtful).  Inkscape can convert them though.

Exporting as pdf will not even necessarily help unless you also embed the font in the pdf.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#16 2018-01-22 12:40:10

Salkay
Member
Registered: 2014-05-22
Posts: 618

Re: [SOLVED] Image rendering differently on two systems

Trilby wrote:

I don't know that R can create text as paths (I'm doubtful).  Inkscape can convert them though.

It's actually just the dots from beeswarm. I haven't investigated much, but it seems bizarre that they are exported to pdf as glyphs and not just paths.

Trilby wrote:

Exporting as pdf will not even necessarily help unless you also embed the font in the pdf.

Yes, I embed the fonts too.

Offline

Board footer

Powered by FluxBB