[librsvg: 2/15] For the test suite, ensure only the testing FcConfig is being used




commit e61bb31c033c76d91195936b90d318c936accc8d
Author: Federico Mena Quintero <federico gnome org>
Date:   Fri Oct 8 17:42:00 2021 -0500

    For the test suite, ensure only the testing FcConfig is being used
    
    Thanks to Behdad Esfahbod for the recipe:
    
    https://mces.blogspot.com/2015/05/how-to-use-custom-application-fonts.html
    
    Part-of: <https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/613>

 tests/src/utils.rs | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/tests/src/utils.rs b/tests/src/utils.rs
index 939e1729..4788d53d 100644
--- a/tests/src/utils.rs
+++ b/tests/src/utils.rs
@@ -73,6 +73,9 @@ mod pango_ft2 {
         ];
 
         let config = fontconfig::FcConfigCreate();
+        if fontconfig::FcConfigSetCurrent(config) == 0 {
+            panic!("Could not set a fontconfig configuration");
+        }
 
         for path in &font_paths {
             let path_cstring = CString::new(*path).unwrap();


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