Browse Source

* Do not load font config if it is already loaded

Michaël Van Canneyt 1 year ago
parent
commit
8702fc416b
1 changed files with 4 additions and 6 deletions
  1. 4 6
      packages/fcl-pdf/src/fpttf.pp

+ 4 - 6
packages/fcl-pdf/src/fpttf.pp

@@ -645,13 +645,11 @@ var
   FN : PFcChar8;
   lDir: string;
   config: PfcConfig;
-const
-  is_fc_loaded:integer=0;
 {$endif}
 begin
   {$ifdef HasFontsConf} // Linux & BSD
-  if (is_fc_loaded=0) then
-    is_fc_loaded:=loadfontconfiglib('');
+  if not FontConfigLibLoaded then
+    loadfontconfiglib('');
 
   config := FcInitLoadConfigAndFonts();
 
@@ -894,8 +892,8 @@ begin
   Result:=false;
   res:='';
 
-  if (is_fc_loaded=0) then
-    is_fc_loaded:=loadfontconfiglib('');
+  if not FontConfigLibLoaded then
+    loadfontconfiglib('');
 
   config := FcInitLoadConfigAndFonts();