Pango OpenType support deprecated for HarfBuzz

Bug #1488159 reported by Alex Valavanis
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Medium
Unassigned

Bug Description

Since Pango 1.31.1, the OpenType functions in Pango have been deprecated in favour of using HarfBuzz directly [1].

Build deprecation warnings [2] as follows (Ubuntu Wiley, PPA).

[1] https://git.gnome.org/browse/pango/commit/pango/?id=6d6c556e9c725a4a69a94dbe045463ea4b855e4a
[2] https://launchpadlibrarian.net/215345069/buildlog_ubuntu-wily-amd64.inkscape-trunk_1%3A0.91.0%2Bdevel%2B14319%2B59~ubuntu15.10.1_BUILDING.txt.gz

../../src/libnrtype/FontFactory.cpp: In member function 'font_instance* font_factory::Face(PangoFontDescription*, bool)':
../../src/libnrtype/FontFactory.cpp:682:29: warning: 'PangoOTInfo* pango_ot_info_get(FT_Face)' is deprecated [-Wdeprecated-declarations]
         PangoOTInfo* info = pango_ot_info_get( res->theFace );
                             ^
In file included from ../../src/libnrtype/FontFactory.cpp:21:0:
/usr/include/pango-1.0/pango/pango-ot.h:257:14: note: declared here
 PangoOTInfo *pango_ot_info_get (FT_Face face);
              ^
../../src/libnrtype/FontFactory.cpp:682:29: warning: 'PangoOTInfo* pango_ot_info_get(FT_Face)' is deprecated [-Wdeprecated-declarations]
         PangoOTInfo* info = pango_ot_info_get( res->theFace );
                             ^
In file included from ../../src/libnrtype/FontFactory.cpp:21:0:
/usr/include/pango-1.0/pango/pango-ot.h:257:14: note: declared here
 PangoOTInfo *pango_ot_info_get (FT_Face face);
              ^
../../src/libnrtype/FontFactory.cpp:682:61: warning: 'PangoOTInfo* pango_ot_info_get(FT_Face)' is deprecated [-Wdeprecated-declarations]
         PangoOTInfo* info = pango_ot_info_get( res->theFace );
                                                             ^
In file included from ../../src/libnrtype/FontFactory.cpp:21:0:
/usr/include/pango-1.0/pango/pango-ot.h:257:14: note: declared here
 PangoOTInfo *pango_ot_info_get (FT_Face face);
              ^
../../src/libnrtype/FontFactory.cpp:684:31: warning: 'PangoOTTag* pango_ot_info_list_scripts(PangoOTInfo*, PangoOTTableType)' is deprecated [-Wdeprecated-declarations]
         PangoOTTag* scripts = pango_ot_info_list_scripts( info, PANGO_OT_TABLE_GSUB );
                               ^
In file included from ../../src/libnrtype/FontFactory.cpp:21:0:
/usr/include/pango-1.0/pango/pango-ot.h:281:13: note: declared here
 PangoOTTag *pango_ot_info_list_scripts (PangoOTInfo *info,
             ^
../../src/libnrtype/FontFactory.cpp:684:31: warning: 'PangoOTTag* pango_ot_info_list_scripts(PangoOTInfo*, PangoOTTableType)' is deprecated [-Wdeprecated-declarations]
         PangoOTTag* scripts = pango_ot_info_list_scripts( info, PANGO_OT_TABLE_GSUB );
                               ^
In file included from ../../src/libnrtype/FontFactory.cpp:21:0:
/usr/include/pango-1.0/pango/pango-ot.h:281:13: note: declared here
 PangoOTTag *pango_ot_info_list_scripts (PangoOTInfo *info,
             ^
../../src/libnrtype/FontFactory.cpp:684:85: warning: 'PangoOTTag* pango_ot_info_list_scripts(PangoOTInfo*, PangoOTTableType)' is deprecated [-Wdeprecated-declarations]
         PangoOTTag* scripts = pango_ot_info_list_scripts( info, PANGO_OT_TABLE_GSUB );
                                                                                     ^
In file included from ../../src/libnrtype/FontFactory.cpp:21:0:
/usr/include/pango-1.0/pango/pango-ot.h:281:13: note: declared here
 PangoOTTag *pango_ot_info_list_scripts (PangoOTInfo *info,
             ^
../../src/libnrtype/FontFactory.cpp:690:17: warning: 'gboolean pango_ot_info_find_script(PangoOTInfo*, PangoOTTableType, PangoOTTag, guint*)' is deprecated [-Wdeprecated-declarations]
             if( pango_ot_info_find_script( info, PANGO_OT_TABLE_GSUB, scripts[i], &script_index )) {
                 ^
In file included from ../../src/libnrtype/FontFactory.cpp:21:0:
/usr/include/pango-1.0/pango/pango-ot.h:260:10: note: declared here
 gboolean pango_ot_info_find_script (PangoOTInfo *info,
          ^
../../src/libnrtype/FontFactory.cpp:690:17: warning: 'gboolean pango_ot_info_find_script(PangoOTInfo*, PangoOTTableType, PangoOTTag, guint*)' is deprecated [-Wdeprecated-declarations]
             if( pango_ot_info_find_script( info, PANGO_OT_TABLE_GSUB, scripts[i], &script_index )) {
                 ^
In file included from ../../src/libnrtype/FontFactory.cpp:21:0:
/usr/include/pango-1.0/pango/pango-ot.h:260:10: note: declared here
 gboolean pango_ot_info_find_script (PangoOTInfo *info,
          ^
../../src/libnrtype/FontFactory.cpp:690:97: warning: 'gboolean pango_ot_info_find_script(PangoOTInfo*, PangoOTTableType, PangoOTTag, guint*)' is deprecated [-Wdeprecated-declarations]
             if( pango_ot_info_find_script( info, PANGO_OT_TABLE_GSUB, scripts[i], &script_index )) {
                                                                                                 ^
In file included from ../../src/libnrtype/FontFactory.cpp:21:0:
/usr/include/pango-1.0/pango/pango-ot.h:260:10: note: declared here
 gboolean pango_ot_info_find_script (PangoOTInfo *info,
          ^
../../src/libnrtype/FontFactory.cpp:693:21: warning: 'PangoOTTag* pango_ot_info_list_languages(PangoOTInfo*, PangoOTTableType, guint, PangoOTTag)' is deprecated [-Wdeprecated-declarations]
                     pango_ot_info_list_languages( info, PANGO_OT_TABLE_GSUB, script_index, NULL);
                     ^
In file included from ../../src/libnrtype/FontFactory.cpp:21:0:
/usr/include/pango-1.0/pango/pango-ot.h:284:13: note: declared here
 PangoOTTag *pango_ot_info_list_languages (PangoOTInfo *info,
             ^
../../src/libnrtype/FontFactory.cpp:693:21: warning: 'PangoOTTag* pango_ot_info_list_languages(PangoOTInfo*, PangoOTTableType, guint, PangoOTTag)' is deprecated [-Wdeprecated-declarations]
                     pango_ot_info_list_languages( info, PANGO_OT_TABLE_GSUB, script_index, NULL);
                     ^
In file included from ../../src/libnrtype/FontFactory.cpp:21:0:
/usr/include/pango-1.0/pango/pango-ot.h:284:13: note: declared here
 PangoOTTag *pango_ot_info_list_languages (PangoOTInfo *info,
             ^
../../src/libnrtype/FontFactory.cpp:693:96: warning: passing NULL to non-pointer argument 4 of 'PangoOTTag* pango_ot_info_list_languages(PangoOTInfo*, PangoOTTableType, guint, PangoOTTag)' [-Wconversion-null]
                     pango_ot_info_list_languages( info, PANGO_OT_TABLE_GSUB, script_index, NULL);
                                                                                                ^
../../src/libnrtype/FontFactory.cpp:693:96: warning: 'PangoOTTag* pango_ot_info_list_languages(PangoOTInfo*, PangoOTTableType, guint, PangoOTTag)' is deprecated [-Wdeprecated-declarations]
In file included from ../../src/libnrtype/FontFactory.cpp:21:0:
/usr/include/pango-1.0/pango/pango-ot.h:284:13: note: declared here
 PangoOTTag *pango_ot_info_list_languages (PangoOTInfo *info,
             ^
../../src/libnrtype/FontFactory.cpp:701:25: warning: 'gboolean pango_ot_info_find_language(PangoOTInfo*, PangoOTTableType, guint, PangoOTTag, guint*, guint*)' is deprecated [-Wdeprecated-declarations]
                     if( pango_ot_info_find_language(info, PANGO_OT_TABLE_GSUB, script_index, languages[j], &language_index, NULL)) {
                         ^
In file included from ../../src/libnrtype/FontFactory.cpp:21:0:
/usr/include/pango-1.0/pango/pango-ot.h:266:10: note: declared here
 gboolean pango_ot_info_find_language (PangoOTInfo *info,
          ^
../../src/libnrtype/FontFactory.cpp:701:25: warning: 'gboolean pango_ot_info_find_language(PangoOTInfo*, PangoOTTableType, guint, PangoOTTag, guint*, guint*)' is deprecated [-Wdeprecated-declarations]
                     if( pango_ot_info_find_language(info, PANGO_OT_TABLE_GSUB, script_index, languages[j], &language_index, NULL)) {
                         ^
In file included from ../../src/libnrtype/FontFactory.cpp:21:0:
/usr/include/pango-1.0/pango/pango-ot.h:266:10: note: declared here
 gboolean pango_ot_info_find_language (PangoOTInfo *info,
          ^
../../src/libnrtype/FontFactory.cpp:701:129: warning: 'gboolean pango_ot_info_find_language(PangoOTInfo*, PangoOTTableType, guint, PangoOTTag, guint*, guint*)' is deprecated [-Wdeprecated-declarations]
                     if( pango_ot_info_find_language(info, PANGO_OT_TABLE_GSUB, script_index, languages[j], &language_index, NULL)) {
                                                                                                                                 ^
In file included from ../../src/libnrtype/FontFactory.cpp:21:0:
/usr/include/pango-1.0/pango/pango-ot.h:266:10: note: declared here
 gboolean pango_ot_info_find_language (PangoOTInfo *info,
          ^
../../src/libnrtype/FontFactory.cpp:704:29: warning: 'PangoOTTag* pango_ot_info_list_features(PangoOTInfo*, PangoOTTableType, PangoOTTag, guint, guint)' is deprecated [-Wdeprecated-declarations]
                             pango_ot_info_list_features( info, PANGO_OT_TABLE_GSUB, 0, i, j );
                             ^
In file included from ../../src/libnrtype/FontFactory.cpp:21:0:
/usr/include/pango-1.0/pango/pango-ot.h:289:13: note: declared here
 PangoOTTag *pango_ot_info_list_features (PangoOTInfo *info,
             ^
../../src/libnrtype/FontFactory.cpp:704:29: warning: 'PangoOTTag* pango_ot_info_list_features(PangoOTInfo*, PangoOTTableType, PangoOTTag, guint, guint)' is deprecated [-Wdeprecated-declarations]
                             pango_ot_info_list_features( info, PANGO_OT_TABLE_GSUB, 0, i, j );
                             ^
In file included from ../../src/libnrtype/FontFactory.cpp:21:0:
/usr/include/pango-1.0/pango/pango-ot.h:289:13: note: declared here
 PangoOTTag *pango_ot_info_list_features (PangoOTInfo *info,
             ^
../../src/libnrtype/FontFactory.cpp:704:93: warning: 'PangoOTTag* pango_ot_info_list_features(PangoOTInfo*, PangoOTTableType, PangoOTTag, guint, guint)' is deprecated [-Wdeprecated-declarations]
                             pango_ot_info_list_features( info, PANGO_OT_TABLE_GSUB, 0, i, j );
                                                                                             ^
In file included from ../../src/libnrtype/FontFactory.cpp:21:0:
/usr/include/pango-1.0/pango/pango-ot.h:289:13: note: declared here
 PangoOTTag *pango_ot_info_list_features (PangoOTInfo *info,
             ^
../../src/libnrtype/FontFactory.cpp:716:29: warning: 'PangoOTTag* pango_ot_info_list_features(PangoOTInfo*, PangoOTTableType, PangoOTTag, guint, guint)' is deprecated [-Wdeprecated-declarations]
                             pango_ot_info_list_features( info, PANGO_OT_TABLE_GSUB, 0, i, PANGO_OT_DEFAULT_LANGUAGE );
                             ^
In file included from ../../src/libnrtype/FontFactory.cpp:21:0:
/usr/include/pango-1.0/pango/pango-ot.h:289:13: note: declared here
 PangoOTTag *pango_ot_info_list_features (PangoOTInfo *info,
             ^
../../src/libnrtype/FontFactory.cpp:716:29: warning: 'PangoOTTag* pango_ot_info_list_features(PangoOTInfo*, PangoOTTableType, PangoOTTag, guint, guint)' is deprecated [-Wdeprecated-declarations]
                             pango_ot_info_list_features( info, PANGO_OT_TABLE_GSUB, 0, i, PANGO_OT_DEFAULT_LANGUAGE );
                             ^
In file included from ../../src/libnrtype/FontFactory.cpp:21:0:
/usr/include/pango-1.0/pango/pango-ot.h:289:13: note: declared here
 PangoOTTag *pango_ot_info_list_features (PangoOTInfo *info,
             ^
../../src/libnrtype/FontFactory.cpp:716:117: warning: 'PangoOTTag* pango_ot_info_list_features(PangoOTInfo*, PangoOTTableType, PangoOTTag, guint, guint)' is deprecated [-Wdeprecated-declarations]
                             pango_ot_info_list_features( info, PANGO_OT_TABLE_GSUB, 0, i, PANGO_OT_DEFAULT_LANGUAGE );
                                                                                                                     ^
In file included from ../../src/libnrtype/FontFactory.cpp:21:0:
/usr/include/pango-1.0/pango/pango-ot.h:289:13: note: declared here
 PangoOTTag *pango_ot_info_list_features (PangoOTInfo *info,
             ^
../../src/libnrtype/FontFactory.cpp:735:13: warning: 'PangoOTTag* pango_ot_info_list_features(PangoOTInfo*, PangoOTTableType, PangoOTTag, guint, guint)' is deprecated [-Wdeprecated-declarations]
             pango_ot_info_list_features( info, PANGO_OT_TABLE_GSUB, 0, 0, PANGO_OT_DEFAULT_LANGUAGE );
             ^
In file included from ../../src/libnrtype/FontFactory.cpp:21:0:
/usr/include/pango-1.0/pango/pango-ot.h:289:13: note: declared here
 PangoOTTag *pango_ot_info_list_features (PangoOTInfo *info,
             ^
../../src/libnrtype/FontFactory.cpp:735:13: warning: 'PangoOTTag* pango_ot_info_list_features(PangoOTInfo*, PangoOTTableType, PangoOTTag, guint, guint)' is deprecated [-Wdeprecated-declarations]
             pango_ot_info_list_features( info, PANGO_OT_TABLE_GSUB, 0, 0, PANGO_OT_DEFAULT_LANGUAGE );
             ^
In file included from ../../src/libnrtype/FontFactory.cpp:21:0:
/usr/include/pango-1.0/pango/pango-ot.h:289:13: note: declared here
 PangoOTTag *pango_ot_info_list_features (PangoOTInfo *info,
             ^
../../src/libnrtype/FontFactory.cpp:735:101: warning: 'PangoOTTag* pango_ot_info_list_features(PangoOTInfo*, PangoOTTableType, PangoOTTag, guint, guint)' is deprecated [-Wdeprecated-declarations]
             pango_ot_info_list_features( info, PANGO_OT_TABLE_GSUB, 0, 0, PANGO_OT_DEFAULT_LANGUAGE );
                                                                                                     ^
In file included from ../../src/libnrtype/FontFactory.cpp:21:0:
/usr/include/pango-1.0/pango/pango-ot.h:289:13: note: declared here
 PangoOTTag *pango_ot_info_list_features (PangoOTInfo *info,
             ^

Tags: build fonts
Revision history for this message
Alex Valavanis (valavanisalex) wrote :

Here's a migration commit for GIMP... should give us some good hints:

https://git.gnome.org/browse/gimp/commit/?h=gtk3-port&id=33acc4b62b60107484ae5f6f9b00f939af6a6fa0

Revision history for this message
su_v (suv-lp) wrote :

Attached is a patch as proposed by and discussed with Tavmjong on irc:
- migrates pango calls to harfbuzz for OpenType API (Tav)
- adds workarounds for current build systems to explicitly link to harfbuzz (~suv)
For reasons unknown to both of us, building inkscape and inkview fails with a linker error about undefined symbols unless explicitly linking to harfbuzz.

Since this change would introduce a new dependency on harfbuzz, older distros would be left out. The burden to maintain a conditional solution depending on installed pango version and availability of harfbuzz might outweigh the benefits of silencing the deprecation warnings.

Proposing to milestone this report to '1.0' for now.

Revision history for this message
su_v (suv-lp) wrote :

On 2015-11-02 14:03 (+0100), ~suv wrote:
> - adds workarounds for current build systems to explicitly link to
> harfbuzz (~suv)

To clarify the scope of the diff wrt build systems: it does not yet include proper checks on pango version and harfbuzz availability - the intention at this stage was to support compiling & linking on systems which do provide harfbuzz.

Revision history for this message
Alex Valavanis (valavanisalex) wrote :

Looking at your patch, it seems that you perform the pkg-config check for HARFBUZZ but don't actually do anything with it! Instead of linking directly, it's better to add HARFBUZZ_LIBS to the linker list and HARFBUZZ_CFLAGS to the AM_CPPFLAGS variable. I'll hopefully take a look today.

Revision history for this message
Alex Valavanis (valavanisalex) wrote :

Committed in lp:inkscape r14549 with the HARFBUZZ_LIBS/CFLAGS set correctly in configure.ac

Changed in inkscape:
status: Triaged → Fix Committed
assignee: nobody → ~suv (suv-lp)
milestone: none → 0.92
Revision history for this message
su_v (suv-lp) wrote :

Unassigning myself from the report - the unconditional dependency on pango >= 1.31 and harfbuzz added in rev 14549 will break win32 trunk builds (AFAICT they have an older pango version, and no harfbuzz at all) which was not the intention, and among the reasons it was proposed to milestone a fix to get rid of the deprecation warnings to Inkscape 1.0.

Changed in inkscape:
assignee: ~suv (suv-lp) → nobody
Revision history for this message
su_v (suv-lp) wrote :

TODO: configure should fail if pango is too old and harfbuzz not found, otherwise the build fails later on when attempting to include the harfbuzz headers:

  CXX libnrtype/FontFactory.o
../../src/libnrtype/FontFactory.cpp:27:25: fatal error: harfbuzz/hb.h: No such file or directory
compilation terminated.

Revision history for this message
Alex Valavanis (valavanisalex) wrote :

Ah, sorry about this... I really didn't check the patch thoroughly enough. I'll work on a conditional version. Reverted in r14552

Changed in inkscape:
status: Fix Committed → In Progress
assignee: nobody → Alex Valavanis (valavanisalex)
Changed in inkscape-devlibs:
importance: Undecided → Low
Revision history for this message
su_v (suv-lp) wrote :

On 2015-12-27 19:29 (+0100), <email address hidden> wrote:
> Revert hard Harfbuzz dependency for Windows. Not yet in Devlibs.

@Alex - we do have 32bit and 64bit devlibs for Windows:
* https://launchpad.net/inkscape-devlibs
* https://launchpad.net/inkscape-devlibs64

The 64bit devlibs in general include newer versions of the dependencies. Based on the pkgconfig files, the 64bit devlibs include a sufficiently recent pango version (1.36.3) as well as harfbuzz (0.9.27):
http://bazaar.launchpad.net/~inkscape.dev/inkscape-devlibs64/trunk/view/head:/lib/pkgconfig/pango.pc
http://bazaar.launchpad.net/~inkscape.dev/inkscape-devlibs64/trunk/view/head:/lib/pkgconfig/harfbuzz.pc
In my original patch (as commented, it was intended for testing on systems with harfbuzz installed) I included the changes for 64bit builds on Windows after checking the versions included in the 64bit devlibs.

Only the 32bit builds (which use build.xml) have older pango (1.28.3) and no harfbuzz at all:
http://bazaar.launchpad.net/~inkscape.dev/inkscape-devlibs/trunk/view/head:/lib/pkgconfig/pango.pc

Revision history for this message
Alex Valavanis (valavanisalex) wrote :

OK, thanks for the clarification. I have added a new request for a Pango update in 32-bit Devlibs as bug #1529503. Perhaps we should consider that as a blocker for this issue, since the migration will be much easier if we can avoid a conditional build.

Changed in inkscape:
status: In Progress → Triaged
assignee: Alex Valavanis (valavanisalex) → nobody
su_v (suv-lp)
no longer affects: inkscape-devlibs
jazzynico (jazzynico)
Changed in inkscape:
milestone: 0.92 → 0.93
Revision history for this message
jazzynico (jazzynico) wrote :

Feel free to apply the changes in the trunk for 0.93. A massive win32 devlibs update is needed for GTK3, so we can also add Harfbuzz in the todo list.

Changed in inkscape:
status: Triaged → In Progress
Revision history for this message
Alex Valavanis (valavanisalex) wrote :

Thanks Nico... committed in lp:inkscape r15094

Changed in inkscape:
status: In Progress → Fix Committed
Max Gaukler (mgmax)
Changed in inkscape:
status: Fix Committed → Fix Released
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.