Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Font problem when opening svg file in Gimp
#1
I have Windows 10 v 1511; Gimp 2.8.18; Inkscape v 0.91 and v 0.92 - all fonts available for all programs. I have Linux Ubuntu 16.04; Gimp 2.8.16; Inkscape 0.91 - all fonts available here too.

In Windows 10 v 1511:
When opening an svg file which contain fonts with white spaces made in Inkscape v 0.92 in Gimp 2.8.18  I encounter a problem. Gimp converts these fonts to a plain font despite the fonts being available in Gimp.

If I make an identical .svg file (same fonts) in Inkscape v 0.91 Gimp 2.8.18 opens the file correctly.


If I edit the file from Inkscape 0.92 in a text editor and remove the pings (') that is before and after the font name and save; this new file will open in Gimp 2.8.18

Using both Windows 10 v 1511 + Ubuntu 16.04
If I open the .svg file created in Windows Inkscape 0.92 in Gimp 2.8.16 running on Ubuntu 16.04 it displays correctly (not necessary to remove pings for the fonts to be correct).
I hope this makes sense Shy

Is there a setting in Gimp 2.8.18 for Windows that needs changing for the fonts with white spaces to display correctly?
TIA

Maga
Reply
#2
I can reproduce the problem with Inkscape 0.91 and Gimp 2.8.18.

According to the SVG spec, the "style" syntax is the same as the one used in CSS and the later allows quotes (it even recommends them when there are spaces in font names).

So this could be a a bona fide bug (in Gimp or in the Cairo lib).

Futher edit: I can reproduce the problem with the following code:

Code:
import cairo, rsvg

img =  cairo.ImageSurface(cairo.FORMAT_ARGB32, 1000, 2000)
ctx = cairo.Context(img)

with open('Text2.svg') as svgfile:
    svgstr=svgfile.read()

handler= rsvg.Handle(None, svgstr)
handler.render_cairo(ctx)
img.write_to_png('Text2.png')

So the problem isn't in Gimp but in the Cairo/Rsvg libraries. Maybe you can upgrade them (or at least check is the bug is known)
Reply
#3
I do not see the problem here, Using a font common to all 'Albertusbold' in my ~/.fonts folder
Tried a plain SVG, an Inkscape SVG then again after applying 'Clean Document' all open up in Gimp 2.8.18 showing the correct font: http://imgur.com/jiHgJjn even put in a hard space (U+00A0) for good measure.
FWIW
Kubuntu 16.04
Inkscape from https://launchpad.net/~inkscape.dev/+arc...ntu/stable ver 0.92
Cairo version 1.14.6-1
rSVG ver 2.40.13-3
Reply
#4
(01-30-2017, 03:57 PM)rich2005 Wrote: I do not see the problem here, Using a font common to all  'Albertusbold' in my ~/.fonts folder
Tried a plain SVG, an Inkscape SVG then again after applying 'Clean Document' all open up in Gimp 2.8.18 showing the correct font: http://imgur.com/jiHgJjn even put in a hard space (U+00A0) for good measure.
FWIW
Kubuntu 16.04
Inkscape from  https://launchpad.net/~inkscape.dev/+arc...ntu/stable ver 0.92
Cairo version 1.14.6-1
rSVG ver 2.40.13-3

The problem is with a space in the font name, such as "Roboto Condensed".
Reply
#5
Ofnuts, Thank yoo very much for trying this out.


>>I can reproduce the problem with Inkscape 0.91 and Gimp 2.8.18.<<
Very interesting that you can have the same happen in 0.91 - I tried so many things this week-end also opening older files made in Inkscape 0.48.5 and all but the ones created in Inkscape 0.92 opened correctly.

>>So the problem isn't in Gimp but in the Cairo/Rsvg libraries. Maybe you can upgrade them (or at least check is the bug is known) <<
I've just checked the Cairo lib on my Windows PC but to be honest I am rather at a loss there - no way of seeing what version they are. I guess that for now I will have to do a work around and hope when a new version of Gimp comes along it will have newer Cairo libs.

I had hoped I had overlooked a setting in Gimp

Thanks again for your time

Hi Rich,

Thank you very much for looking at this. Sorry I didn't explain the problem properly. As Ofnuts says it is white space in the font name not the text string.

Looks like it is a problem I will have to live with for now. Thanks too for posting where I can hold of Inkscape 0.92 for Ubuntu. I prefer to have the same version on both the Windows and the Linux machines
Thanks again
Reply
#6
I still can not reproduce that.

Worst font I could find Champagne & Limousines

Still opens ok in Gimp. http://imgur.com/ddiCguK
Reply
#7
Rich - what version of Windows are you testing this on? I haven't had time today but think I will try this out on a Windows 7 PC too. I compared the Cairo lib files on both the Windows 10 computers I can use and they are identical. It would be interesting to see if I can reproduce this on my old laptop. Thanks again for playing along
Reply
#8
Sorry - all in linux - Kubuntu 16.04

Inskcape as before
Gimp 2.8.18 from this ppa
https://launchpad.net/~otto-kesselgulasc...buntu/gimp
Reply
#9
Thanks Rich, that explains why you haven't got the same problem. I only have the problem on Windows not Linux (Ubuntu 16.04) as I tried to explain in my original post. Sorry abou the confusion.
Reply
#10
(01-31-2017, 08:55 AM)rich2005 Wrote: Sorry - all in linux - Kubuntu 16.04

Inskcape as before
Gimp 2.8.18 from this ppa
https://launchpad.net/~otto-kesselgulasc...buntu/gimp

I also  run Gimp 2.8.18 fro Otto's PPA. But if you are on 16.04 you likely have a more recent libcairo/librsvg...

What says
Code:
dpkg -l librsvg* libcairo*

on your 16.04? On my 14.04:
Code:
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                Version        Architecture   Description
+++-===================-==============-==============-===========================================
ii  libcairo-gobject2:a 1.13.0~2014020 amd64          The Cairo 2D vector graphics library (GObje
ii  libcairo-gobject2:i 1.13.0~2014020 i386           The Cairo 2D vector graphics library (GObje
ii  libcairo-perl       1.104-1        amd64          Perl interface to the Cairo graphics librar
ii  libcairo2:amd64     1.13.0~2014020 amd64          The Cairo 2D vector graphics library
ii  libcairo2:i386      1.13.0~2014020 i386           The Cairo 2D vector graphics library
un  libcairomm-1.0-0    <none>         <none>         (no description available)
ii  libcairomm-1.0-1:am 1.10.0-1ubuntu amd64          C++ wrappers for Cairo (shared libraries)
ii  librsvg2-2:amd64    2.40.2-1       amd64          SAX-based renderer library for SVG files (r
un  librsvg2-bin        <none>         <none>         (no description available)
ii  librsvg2-common:amd 2.40.2-1       amd64          SAX-based renderer library for SVG files (e
Reply


Forum Jump: