FontConfig Error

Linux specific forum
User avatar
Guimauve
Enthusiast
Enthusiast
Posts: 742
Joined: Wed Oct 22, 2003 2:51 am
Location: Canada

FontConfig Error

Post by Guimauve »

Hello everyone,

I have a small with the Gadget display in one of my program. Apparently, My program seems to have a problem to load the system FontConfig file. This two lines shows up when I launch my program from the Terminal
Fontconfig error: line 1: unknown encoding
Fontconfig error: Cannot load default config file
I'm not sure if it's a bug or not because another program use the same Font related command set (FontRequester(), LoadFont() and SetGadgetFont()) without any problems. So why one program have a problem and not the other one ? I can't figure out why. Does anyone have a clue about what happen.

Linux Mint 12 x64
PureBasic 4.60 x64

Best regards.
Guimauve
User avatar
idle
Always Here
Always Here
Posts: 5886
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: FontConfig Error

Post by idle »

can you post an example? I can't see any issue on ubuntu 11.04
Windows 11, Manjaro, Raspberry Pi OS
Image
User avatar
Guimauve
Enthusiast
Enthusiast
Posts: 742
Joined: Wed Oct 22, 2003 2:51 am
Location: Canada

Re: FontConfig Error

Post by Guimauve »

Yes I can if it's possible but it's not the case. The program in question has 24 638 lines so finding what command generating the problem is little bit difficult.
It's probably more efficient know what PureBasic command are related to the FontCong file.

I guess this problem is somehow related to GTK 2.0 vs GTK 3.0 incompatibility reading the FontConfig file. But it's just a guess.

As I said this problem occur in Linux Mint 12 (a Ubuntu 11.10 derivative). Ubuntu 11.04 is based on GTK 2.0.

So I will continue my investigation and thanks anyway.

Edit :

Ok this is it, A greatly reduced source code (from 8600 to 422)

Code: Select all

#ProgramName = "Basic-Mesh"
#Version = "V1." 

Enumeration 
  
  #MainWin
  
  #Panel_BasicMesh
  
  ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  ; <<<<< Constantes pour la définition du cube <<<<<
  
  #Frame_Cube_Geometry
  #Text_Cube_Width
  #String_Cube_Width
  #Text_Cube_Height
  #String_Cube_Height 
  #Text_Cube_Depth
  #String_Cube_Depth
  
  #Frame_Cube_Mapping
  #Option_Cube_Single_Texture
  #Option_Cube_Multiple_Texture
  
  #Frame_Cube_Mesh
  #Option_Cube_Single_SubMesh
  #Option_Cube_Multiple_SubMesh
  
  #Frame_Cube_Texture  
   
EndEnumeration 

Macro GadgetDown(GadgetID)
  
  GadgetY(GadgetID) + GadgetHeight(GadgetID)
  
EndMacro

Macro GadgetRight(GadgetID)

  GadgetX(GadgetID) + GadgetWidth(GadgetID)
  
EndMacro

Procedure GeometryGadgetGroup(PosX.l, PosY.l, FrameWidth.l, FirstGadget.l, LastGadget.l)
  
  FrameHeight = 25 + ((LastGadget - FirstGadget + 1) >> 1) * 30
  
  Frame3DGadget(FirstGadget, PosX, PosY, FrameWidth, FrameHeight, "")
  
  Y = PosY + 20
  W1 = FrameWidth * 2 / 3 - 10
  W2 = FrameWidth - W1 - 10
  
  For GadgetID = FirstGadget + 1 To LastGadget Step 2
    
    TextGadget(GadgetID, PosX + 5, Y, W1, 25, "", #PB_Text_Center)
    StringGadget(GadgetID + 1, PosX + 5 + W1, Y, W2, 25, "")
    Y + 30
    
  Next
  
EndProcedure

Procedure OptionnalGadgetGroup(PosX.l, PosY.l, FrameWidth.l, FrameID.l, LastOptionID.l)
  
  FrameHeight = 25 + (LastOptionID - FrameID) * 25
  
  Frame3DGadget(FrameID, PosX, PosY, FrameWidth, FrameHeight, "")
  
  PosY + 20
  FirstOptionID = FrameID + 1
  
  For OptionID = FirstOptionID To LastOptionID
    
    OptionGadget(OptionID, PosX + 5, PosY, FrameWidth - 10, 25, "")
    PosY + 25
    
  Next
  
EndProcedure

Procedure TrackBarGadgetGroup(PosX, PosY, FrameWidth, FirstGadget.l, LastGadget.l)

  FrameHeight = 25 + ((LastGadget - FirstGadget + 1) >> 1) * 30
  Frame3DGadget(FirstGadget, PosX, PosY, FrameWidth, FrameHeight, "")
  PosY + 20

  For TrackBarID = FirstGadget + 1 To LastGadget Step 2
    
    TrackBarGadget(TrackBarID, PosX + 5, PosY, FrameWidth - 40, 25, 0, 0, #PB_TrackBar_Ticks)
    TextGadget(TrackBarID + 1, GadgetRight(TrackBarID), PosY, 30, 25, "", #PB_Text_Center)
    PosY + 30
    
  Next
  
EndProcedure 

; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
; <<<<< Déclaration de la Structure <<<<<

Structure Matrix44
  
  e11.d
  e12.d
  e13.d
  e14.d

EndStructure

; <<<<<<<<<<<<<<<<<<<<<<<<<<<<
; <<<<< Les observateurs <<<<<

Macro GetMatrix44e11(MatrixA)
  
  MatrixA\e11
  
EndMacro

Macro GetMatrix44e12(MatrixA)
  
  MatrixA\e12
  
EndMacro

Macro GetMatrix44e13(MatrixA)
  
  MatrixA\e13
  
EndMacro

Macro GetMatrix44e14(MatrixA)
  
  MatrixA\e14
  
EndMacro

; <<<<<<<<<<<<<<<<<<<<<<<<<
; <<<<< Les mutateurs <<<<<

Macro SetMatrix44e11(MatrixA, P_e11)
  
  GetMatrix44e11(MatrixA) = P_e11
  
EndMacro

Macro SetMatrix44e12(MatrixA, P_e12)
  
  GetMatrix44e12(MatrixA) = P_e12
  
EndMacro

Macro SetMatrix44e13(MatrixA, P_e13)
  
  GetMatrix44e13(MatrixA) = P_e13
  
EndMacro

Macro SetMatrix44e14(MatrixA, P_e14)
  
  GetMatrix44e14(MatrixA) = P_e14
  
EndMacro

; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
; <<<<< Set - Noeud avec noeuds enfants <<<<<

Procedure SetMatrix44XMLNode(CurrentNode, *MatrixA.Matrix44)
  
  If ParentXMLNode(CurrentNode) = #Null
    StructNode = CreateXMLNode(CurrentNode)
    SetXMLNodeName(StructNode, "Matrix44")
  Else
    StructNode = CurrentNode
  EndIf
  
  FieldNode = CreateXMLNode(StructNode)
  SetXMLNodeName(FieldNode, "Line1")
  SetXMLAttribute(FieldNode, "e11", StrD(GetMatrix44e11(*MatrixA)))
  SetXMLAttribute(FieldNode, "e12", StrD(GetMatrix44e12(*MatrixA)))
  SetXMLAttribute(FieldNode, "e13", StrD(GetMatrix44e13(*MatrixA)))
  SetXMLAttribute(FieldNode, "e14", StrD(GetMatrix44e14(*MatrixA)))

EndProcedure

; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
; <<<<< Get - Noeud avec noeuds enfants <<<<<

Procedure GetMatrix44XMLNode(CurrentNode, *MatrixA.Matrix44)
  
  If ParentXMLNode(CurrentNode) = #Null
    StructNode = ChildXMLNode(CurrentNode)
    If GetXMLNodeName(StructNode) = "Matrix44"
      Success = #True
    EndIf
  Else
    Success = #True
    StructNode = CurrentNode
  EndIf
  
  If Success = #True
    
    FieldNode = ChildXMLNode(StructNode)
    
    While FieldNode
      
      Select GetXMLNodeName(FieldNode)
          
        Case "Line1"
          SetMatrix44e11(*MatrixA, ValD(GetXMLAttribute(FieldNode, "e11")))
          SetMatrix44e12(*MatrixA, ValD(GetXMLAttribute(FieldNode, "e12")))
          SetMatrix44e13(*MatrixA, ValD(GetXMLAttribute(FieldNode, "e13")))
          SetMatrix44e14(*MatrixA, ValD(GetXMLAttribute(FieldNode, "e14")))
                
      EndSelect
      
      FieldNode = NextXMLNode(FieldNode)
      
    Wend
    
  EndIf
  
  ProcedureReturn Success
EndProcedure

; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
; <<<<< Déclaration de la Structure <<<<<

Structure MeshEditor

  PrefFileName.s

EndStructure

; <<<<<<<<<<<<<<<<<<<<<<<<<<<<
; <<<<< Les observateurs <<<<<

Macro GetMeshEditorPrefFileName(MeshEditorA)

  MeshEditorA\PrefFileName

EndMacro

; <<<<<<<<<<<<<<<<<<<<<<<<<
; <<<<< Les mutateurs <<<<<

Macro SetMeshEditorPrefFileName(MeshEditorA, P_PrefFileName)

  GetMeshEditorPrefFileName(MeshEditorA) = P_PrefFileName

EndMacro

; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<
; <<<<< L'opérateur Reset <<<<<

Macro ResetMeshEditor(MeshEditorA)
  
  SetMeshEditorPrefFileName(MeshEditorA, "")

EndMacro

; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
; <<<<< L'opérateur Initialize <<<<<

Procedure InitializeMeshEditor(*MeshEditorA.MeshEditor)
  
  UsePNGImageDecoder()
  
  Path.s = GetPathPart(ProgramFilename())
  SetCurrentDirectory(Path)

  SetMeshEditorPrefFileName(*MeshEditorA, #ProgramName + ".pref")

EndProcedure

; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
; <<<<< Routine de fermeture du programme <<<<<

Procedure ShutDownMeshEditor(*MeshEditorA.MeshEditor)
  
  CloseWindow(#MainWin)
  ResetMeshEditor(*MeshEditorA)
  
EndProcedure

; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
; <<<<< Routine de rafraichissement du programme <<<<<

Procedure RefreshMeshEditor(*MeshEditorA.MeshEditor)
  
  SetGadgetState(#Panel_BasicMesh, 0)

EndProcedure

; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
; <<<<< Ouverture de la fenètre principale <<<<<

Procedure OpenMeshEditorWindow(*MeshEditorA.MeshEditor)
  
  If OpenWindow(#MainWin, 50,50,750,500, "Basic-Mesh")

    PanelGadget(#Panel_BasicMesh, 5, 5, WindowWidth(#MainWin) - 60, WindowHeight(#MainWin) - 10)
      
      ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
      ; <<<<< Gadgets pour la définition du cube <<<<<
      
      AddGadgetItem(#Panel_BasicMesh, 0, "Cube")
      TabH = GetGadgetAttribute(#Panel_BasicMesh, #PB_Panel_TabHeight)
      
      GeometryGadgetGroup(5, 5, 225, #Frame_Cube_Geometry, #String_Cube_Depth)
      OptionnalGadgetGroup(5, GadgetDown(#Frame_Cube_Geometry) - TabH + 5, 225, #Frame_Cube_Mapping, #Option_Cube_Multiple_Texture)
      OptionnalGadgetGroup(5, GadgetDown(#Frame_Cube_Mapping) - TabH + 5, 225, #Frame_Cube_Mesh, #Option_Cube_Multiple_SubMesh)
      
      SetGadgetText(#Frame_Cube_Geometry, "Size")
      SetGadgetText(#Text_Cube_Width, "Width")
      SetGadgetText(#Text_Cube_Height, "Height")
      SetGadgetText(#Text_Cube_Depth, "Depth")
      SetGadgetText(#Frame_Cube_Mapping, "UV Mapping Type")
      SetGadgetText(#Option_Cube_Single_Texture, "Single Texture")
      SetGadgetText(#Option_Cube_Multiple_Texture, "One Texture per face")
      SetGadgetText(#Frame_Cube_Mesh, "Mesh Style")
      SetGadgetText(#Option_Cube_Single_SubMesh, "Single Sub-Mesh")
      SetGadgetText(#Option_Cube_Multiple_SubMesh, "One Sub-Mesh per face")
      
      ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
      ; <<<<< Gadgets pour la définition du cône <<<<<
     
      AddGadgetItem(#Panel_BasicMesh, 1, "Cône")
      
      ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
      ; <<<<< Gadgets pour la définition du cylindre <<<<<

      AddGadgetItem(#Panel_BasicMesh, 2, "Cylindre")

      ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
      ; <<<<< Gadgets pour la définition de la capsule <<<<<
      
      AddGadgetItem(#Panel_BasicMesh, 3, "Capsule")

      ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
      ; <<<<< Gadgets pour la définition de la sphère <<<<<
      
      AddGadgetItem(#Panel_BasicMesh, 4, "Sphère")

      ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
      ; <<<<< Gadgets pour la définition du tore <<<<<
      
      AddGadgetItem(#Panel_BasicMesh, 5, "Tore")

      ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
      ; <<<<< Gadgets pour la définition de la Sphère géodésique <<<<<
      
      AddGadgetItem(#Panel_BasicMesh, 6, "Sphère Geodesic")

      ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
      ; <<<<< Gadgets pour la définition de la flèche <<<<<
      
      AddGadgetItem(#Panel_BasicMesh, 7, "Flèche")
 
      ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
      ; <<<<< Gadgets pour la définition du trièdre <<<<<
      
      AddGadgetItem(#Panel_BasicMesh, 8, "Trièdre")

      ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
      ; <<<<< Gadgets pour la définition d'un noeud <<<<<
      
      AddGadgetItem(#Panel_BasicMesh, 9, "Noeuds Tubulaire")
 
    CloseGadgetList()
    
  EndIf 
  
EndProcedure 

; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
; <<<<< Gestion des évènements <<<<<

Procedure MeshEditorEventManager(*MeshEditorA.MeshEditor)
  
  Repeat

    EventID = WaitWindowEvent()
    
    Select EventID
        
      Case #PB_Event_Menu
        
        Select EventMenu()
            
        EndSelect
        
      Case #PB_Event_Gadget
        
        Select EventGadget()

        EndSelect
        
    EndSelect

  Until EventID = #PB_Event_CloseWindow

EndProcedure 

; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
; <<<<< Routine d'initialisation du programme <<<<<

InitializeMeshEditor(MeshEditor.MeshEditor)

; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
; <<<<< Ouverture de la fenètre principale <<<<<

OpenMeshEditorWindow(MeshEditor)

; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
; <<<<< Gestion des évènements <<<<<

MeshEditorEventManager(MeshEditor)

; <<<<<<<<<<<<<<<<<<<<<<<<<<
; <<<<< FIN DU FICHIER <<<<<
; <<<<<<<<<<<<<<<<<<<<<<<<<<
To see the problem you will have to compile the code, save the executable file in your home then launch it from the terminal : /home/your_name/BasicMesh

If this code really bug on your system the Terminal will show this :
guimauve@guimauve-Desktop ~ $ /home/guimauve/BasicMesh
Fontconfig error: line 1: unknown encoding
Fontconfig error: Cannot load default config file
By the way, all french character will show up but smaller than other letters. Then recompile the source code with these command commented (line no. 168 to 224) to see the difference.

Code: Select all

SetMatrix44XMLNode(CurrentNode, *MatrixA.Matrix44)
GetMatrix44XMLNode(CurrentNode, *MatrixA.Matrix44)
Gentle reminder :

Linux Mint 12 x64 + Gnome-Shell (Gnome 3)
PureBasic 4.60 x64 Final

Best regards.
Guimauve
User avatar
Guimauve
Enthusiast
Enthusiast
Posts: 742
Joined: Wed Oct 22, 2003 2:51 am
Location: Canada

Re: FontConfig Error

Post by Guimauve »

Hello everyone,

Apparently, this problem also has an effect on Open/SaveFileRequester() and the FontRequester() as well.

Best regards.
Guimauve
User avatar
idle
Always Here
Always Here
Posts: 5886
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: FontConfig Error

Post by idle »

must be the gnome3 stuff, no error messages from running it in the console
Windows 11, Manjaro, Raspberry Pi OS
Image
User avatar
Guimauve
Enthusiast
Enthusiast
Posts: 742
Joined: Wed Oct 22, 2003 2:51 am
Location: Canada

Re: FontConfig Error

Post by Guimauve »

idle wrote:must be the gnome3 stuff, no error messages from running it in the console
Or a bug from the "libxslt" library update.

Best regards.
Guimauve
Post Reply