OpenType fonts with postscript outlines not supported.

Bug #167337 reported by Zeimusu-users
12
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
High
Ishmal
Pango
Fix Released
Medium

Bug Description

In recent SVN builds opentype fonts with postscript
outlines are not handled. The font names don't appear
in the text and font dialogue, and in file that use the
fonts, the fonts are substituted.

This bug only affects Windows 32 systems and builds
that use Pango not freetype. In particular 0.43 doesn't
show this bug.

It has been suggested on the development mailing list
that this may be caused by problems in
GetGlyphOutline(GGO_NATIVE).

Tags: win32 other
Revision history for this message
Zeimusu-users (zeimusu-users) wrote :
Revision history for this message
Richard Hughes (cyreve) wrote :

We'll conduct the conversation here rather than via e-mail.
I had assumed that the fonts would be copyrighted, but since
they're not this will do just fine.

There are two pieces of code which need changing to make
those fonts work. One is in Inkscape, which made it barf and
fallback to Sans when presented with those fonts. A fix for
this is now checked in to svn.

The second is in pango-win32 and is the subject of a heated
discussion at http://bugzilla.gnome.org/show_bug.cgi?
id=142579. I have done a binary edit of my copy of
libpangowin32-1.0-0.dll based on a similar idea to Tor's
"single test" in comment #9 (change bytes 0x36fd and 0x36fe
from 04 75 to 02 72 in you want it) and I have seen no ill
effects yet, but I haven't given it a major workout on lots
of fonts either.

What would you like to do about this issue? I suggest you
write a comment in that Pango bug just to make your feelings
known, but beyond that I really don't know what to say. It
seems to have been stalled for the better part of a year.

Revision history for this message
Zeimusu-users (zeimusu-users) wrote :

I've done as suggested and commented on the pango bug. Tor
has replied saying that a fix may be possible but would not
be trivial.

I suppose here now the matter rests. We could leave this bug
open (in case of duplicates and to guide hackers to the
pango bug) but reduce its priority.

I can't get that binary edit to work. I just don't have
those bits at that position, either on a stripped or
unstripped library.

Revision history for this message
Richard Hughes (cyreve) wrote :

Yeah, I've usually done something weird to my DLLs. In ftp:/
/ftp.gtk.org/pub/gtk/v2.8/win32/pango-1.10.3.zip it's at
offset 0x377d.

Regarding your comment about using FreeType on Win32, the
only way to do so at the moment uses FontConfig, which was
the method used in 0.43 and the cause of many, many really
ugly bugs on Win32. This bug doesn't even come close to
making me think about maybe going back.

From Tor's comments I expect that OpenType-with-PostScript
will work reliably but plain PostScript will crash Pango. It
would be interesting to hear your feedback on this.

As for the matter of what to do with this bug, I want to
keep it around for a while just to remind me to test plain
PostScript fonts (there might be some code changes necessary
to prevent their use).

Revision history for this message
Zeimusu-users (zeimusu-users) wrote :

Thanks. I tried that binary edit, and can confirm that
type-1 fonts do crash pango (the usual crash at line 75 of
shape.c). But opentype fonts seem to work. Scratch the idea
about freetype if it isn't going to work. I'm sure we don't
need anymore pango crashes but postscript font support will
be good for using inkscape in publishing and pre-press. I'll
try the edited library for a few days. If no major problems
appear we can investigate if it is possible to turn on
support for opentype, but not Type 1.

Revision history for this message
Zeimusu-users (zeimusu-users) wrote :

I've had no special problems with the modified library. It
seems that the outlines are converted to quadratic curves by
windows, so the object->convert to path makes too many
points, but that is a minor niggle.

If this isn't going to be fixed for 0.44, there should be
mention in the release notes.

Revision history for this message
Richard Hughes (cyreve) wrote :

Bob: If I can drag you in to this conversation for a moment,
what do you think about shipping the aforementioned patched
binary with our main distribution?

Revision history for this message
Bug Importer (bug-importer) wrote :

Hi Cyreve. On the pango bug there is a little interest in
the binary patch you suggest here. In particular, do you
have a source patch that does the same thing? Hans Breuer
would like to know. Could you go there and comment.

Revision history for this message
Zeimusu-users (zeimusu-users) wrote :

The windows gtk28 package that shipped with 0.44 (Bob's
package from 2006-06-17) seems to have new version of
libpangowin32-1.0-0.dll, so the binary patch mentioned here
won't work. I can't work out how to change the new
libpangowin32. I see bytes 04 75 at offset 3aa0, but
changing them doesn't help, and causes silent crashes. Can
the new library be patched?

This bug has already got three duplicates (1512136, 1513843
& 1514592 since 0.44 was released. Can I nominate it to be
fixed for 0.44.1 (by a patched binary or otherwise). Since
the assertion in shape.c was removed this patch is safer.

Revision history for this message
Richard Hughes (cyreve) wrote :

Ah, got it. The compiler seems to have managed to do
something weird with this release, so there are two places
to patch:

3aa0: 04 75 -> 02 72
3a48: 04 74 -> 02 7d

The first will only get used if you have debugging turned
on. The second is the inverse test of the first.

Revision history for this message
Zeimusu-users (zeimusu-users) wrote :

I'm going to attach a patched version of libpangowin32 to
this bug. It has the changes that cyreve decribes here.

Revision history for this message
Zeimusu-users (zeimusu-users) wrote :

Originator: YES

Ishmal has made a gtk2.10 library pack, and there is a new version of
libpangowin32. I think I've found the 04 75 (at 0x3b70) and 04 74 (at
0x3b1b) that can be changed as below, but could you check that this is
correct?

Revision history for this message
Richard Hughes (cyreve) wrote :

Originator: NO

Yes, that looks correct to me.

Revision history for this message
Zeimusu-users (zeimusu-users) wrote :

Originator: YES

File Added: libpangowin32-1.0-0.dll

Revision history for this message
Buliabyak-users (buliabyak-users) wrote :

Originator: NO

cyreve, so what's with this bug? do we need to ship a hacked binary lib?
or is there a better way?

Revision history for this message
Richard Hughes (cyreve) wrote :

Originator: NO

We don't want to ship this hacked binary lib, because the tweak is to tell
it to accept all outline fonts. This means it crashes horribly when it
encounters a Type1 font. In the Pango bug report I described a way to fix
it to provide a proper conditional, but I've never succeeded in building
Pango myself so I wouldn't feel confident providing a patch without having
tested it.

I haven't forgotten that you wanted an FAQ entry for this. I'll do it this
weekend, when I have more time.

hash (hash-g)
Changed in inkscape:
status: New → Confirmed
Revision history for this message
Robert Gash (gashalot) wrote :

The upstream team has fixed the bug in Pango for OpenType/PS fonts as of earlier this week, with discussion of it being included in Pango 1.20.

I think it would be prudent to try to include this in the 0.46 release, provided Pango has released 1.20 at that point.

For more information, see the patch here: http://bugzilla.gnome.org/show_bug.cgi?id=142579

Changed in pango:
status: Unknown → Confirmed
Changed in pango:
status: Confirmed → Fix Released
Revision history for this message
Adrian Johnson (ajohnson-redneon) wrote :

A new stable release of Pango (1.20.0) with this fix has been released.

The NEWS file only mentions win32 fixes for Type 1 fonts however I verified that both my patches for OpenType/PS and Type 1 fonts on win32 are included.

Revision history for this message
Idan Gazit (idan-fastmail) wrote :

+1 !

This is a pretty big deal for me as I use inkscape at work all the time and there are so many delicious fonts in opentype...

I tried using the precompiled pango 1.20 binaries (they're not listed on the GTK download page but they're there, just need to get creative with the URL). I simply moved the existing pango 1.18.4 dll's aside and put the 1.20 ones in their place.

Unfortunately it bombs out, so assuming that something needs to change inside inkscape. Error message: "The procedure entry point g_assertion_message could not be located in the dll libglib-2.0-0.dll" I guess something in the interface between pango and glib has changed...

Please please please don't wait another major release to include this fix! :)

Revision history for this message
Adrian Johnson (ajohnson-redneon) wrote :
Revision history for this message
Adrian Johnson (ajohnson-redneon) wrote :

I have tested with Inkscape0803122143.7z and installed the pango 1.20.0 [1] and glib 1.16.1 [2] dlls over the top of the dlls supplied with inkscape.

Both OpenType/PS and Type 1 fonts work perfectly in Inkscape. They are appear in the font selection menu, display correctly on the screen and are correctly exported to cairo PDF.

[1] http://ftp.gnome.org/pub/gnome/binaries/win32/pango/1.20/pango-1.20.0.zip
[2] http://ftp.gnome.org/pub/gnome/binaries/win32/glib/2.16/glib-2.16.1.zip

Revision history for this message
Idan Gazit (idan-fastmail) wrote :

Confirmed -- works great here.

Thanks for the tip, Adrian!

Revision history for this message
Rygle (rygle) wrote :

Confirmed that the latest pango dlls with trunk 18352 enable the use of the Inkcalig font above - http://launchpadlibrarian.net/10578133/Inkcalig.otf

Revision history for this message
Rygle (rygle) wrote :

The pango version in the devlibs needs to be upgraded to 1.20.0 as per the link Adrian Johnson pointed out.
http://ftp.gnome.org/pub/gnome/binaries/win32/pango/1.20/pango-1.20.0.zip

Changed in inkscape:
status: Confirmed → Fix Released
Revision history for this message
Rygle (rygle) wrote :

Ishmal has added the relevant pango dlls to a new devlibs package - http://inkscape.modevia.com/win32libs/devlibs-2.12-080417.7z.

I have updated the link in the win32 compiling page.

Changed in inkscape:
status: Fix Released → Fix Committed
Revision history for this message
Adrian Johnson (ajohnson-redneon) wrote : Re: [Bug 167337] Re: OpenType fonts with postscript outlines not supported.

Rygle wrote:
> Ishmal has added the relevant pango dlls to a new devlibs package -
> http://inkscape.modevia.com/win32libs/devlibs-2.12-080417.7z.
>
> I have updated the link in the win32 compiling page.
>
> ** Changed in: inkscape
> Status: Fix Released => Fix Committed
>

Isn't this already released in 0.46? Both OpenType and Type 1 fonts work
for me on Windows using the 0.46 release. The pango dll in 0.46 appears
to be 1.20.0.

Also, the FAQ entry for this bug (3.11) probably should be updated and
https://bugs.launchpad.net/inkscape/+bug/172119 appears to be a dupe of
this bug.

Revision history for this message
Rygle (rygle) wrote :

Yes, you're right, the release version does have pango 1.20.0 dlls, however somewhere along the line this had reverted in the devlibs.

It surprised me when I went back to look, because a more recent version of the devlibs than was used in 0.46 somehow had an earlier version of the pango libs - (1.18). The readme file said 1.20.0, but there was a discrepancy with the version in the devlibs. Just so you know I'm not crazy, I tested the font mentioned above on a build of trunk with and without changing the pango dlls and it made a difference.

I was only trying to close this bug off, but accidentally picked up the discrepancy in the process. All fixed now.

Also changing back to fix released, as apparently the Launchpad terminology considers fix released closed, but fix committed not closed (seems backwards to me, but that's how it reads in Bryce's stats).

Changed in inkscape:
status: Fix Committed → Fix Released
Revision history for this message
glenstewart (glen-stewart) wrote :

Is this possibly associated to this bug report ? https://bugs.launchpad.net/inkscape/+bug/277603

Changed in pango:
importance: Unknown → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.