[meld: 1/2] win32: remove workaround for font backend



commit 08dca620a4951c64bd21b57c10d7cfa2db564ead
Author: Vasily Galkin <galkin-vv ya ru>
Date:   Wed May 16 19:10:14 2018 +0300

    win32: remove workaround for font backend
    
    It turns out that explicitely setting font backend on win32
    is only useful for pygobjectwin32 PangoCairo builds because
    in vanilla PangoCairo win32 backend is default on windows and
    changing default to fontconfig was patch included in pygobjectwin32 since
    >16/4/2015 rev16:
    >- PangoCairo: favor fontconfig over win32 fontmap by default,
    >this would overcome "Pango Warning:... expect ugly output"
    
    Recent libraries update in msys2-mingw64 breaks current code
    (according to https://github.com/Alexpux/MINGW-packages/pull/3611
    the breakage reason is PangoCairo.Win32FontMap being private)
    
    While meld code can be modified to use non-private API it looks
    unneeded since meld requires gtk 3.20 and pygobjectwin32 builds stalled
    with gtk 3.18 and can't run current meld 3.19+
    
    So font backend setting is removed.
    Also package presence check is removed
    since there in no other explicit uses in meld.

 bin/meld | 13 -------------
 1 file changed, 13 deletions(-)
---
diff --git a/bin/meld b/bin/meld
old mode 100755
new mode 100644
index 66341776..1f09a3dc
--- a/bin/meld
+++ b/bin/meld
@@ -182,7 +182,6 @@ def check_requirements():
     gtk_requirement = (3, 20)
     glib_requirement = (2, 48)
     gtksourceview_requirement = (3, 20, 0)
-    pangocairo_requirement = (1, 34)
 
     def missing_reqs(mod, ver, exc=None):
         if isinstance(exc, ImportError):
@@ -220,13 +219,6 @@ def check_requirements():
     except (ImportError, AssertionError, ValueError) as e:
         missing_reqs("GtkSourceView", gtksourceview_requirement, e)
 
-    try:
-        gi.require_version("PangoCairo", "1.0")
-        from gi.repository import PangoCairo  # noqa: F401
-        # Only check that imports ok; the version is fine since Gtk loaded fine
-    except (ImportError, ValueError) as e:
-        missing_reqs("PangoCairo", pangocairo_requirement, e)
-
 
 def setup_resources():
     from gi.repository import GLib
@@ -365,10 +357,5 @@ if __name__ == '__main__':
         from gi.repository import GLib
         GLib.unix_signal_add(GLib.PRIORITY_DEFAULT, signal.SIGINT,
                              lambda *args: meld.meldapp.app.quit(), None)
-    if sys.platform == 'win32':
-        # FontConfig on win32 at least with version <= 2.12.6 can cause several
-        # minutes 'hang' during first startup. So use native fonts backend.
-        from gi.repository import PangoCairo
-        PangoCairo.FontMap.set_default(PangoCairo.Win32FontMap())
     status = meld.meldapp.app.run(sys.argv)
     sys.exit(status)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]