[Gambas-user] Fonts: different answers from libraries

BB adamnt42 at gmail.com
Wed Oct 18 06:50:52 CEST 2023


On 18/10/23 1:51 pm, T Lee Davidson wrote:
> On 10/17/23 23:16, T Lee Davidson wrote:
>> On 10/17/23 16:27, Gianluigi wrote:
>>> The font is installed but I get information only with the GTK libraries. 
>>>
>>> Anyone know the reason?
>>> Code(*)
>>> System(**)
>>>
>>> Regards
>>> Gianluigi
>>>
>>> (*)
>>> Public Sub Form_Open()
>>>
>>>    If Fonts.Exist("D050000L") Then
>>>      Message.Info("The D050000L font is installed")
>>>    Else
>>>      Message.Warning("You have to install the D050000L font")
>>>    Endif
>>>    Me.Close
>>>
>>> End
>>>
>>> (**)
>>> [System]
>>> Gambas=3.18.90 d26f534 (master)
>>
>> I do not know the reason, but I can confirm that the list of fonts 
>> enumerated by Fonts is indeed different when using GTK3 versus Qt5; 
>> not only in number (141 versus 285, respectively) but also in name.
>
> I probably should have mentioned:
> 1) `fc-list : family` on the command-line yields 237, and
> 2) this is with v3.18.4 (stable)
>
In short, I believe the answer lies in how these three things "know" 
about fonts. QT5 has it's own internal list of what it thinks are names 
of installed fonts. fc (and fc-list) uses fontconfig files installed 
here there and everywhere by font packages and whatever GTK does it's 
probably a different way to the above. An important thing to know is 
that these three all have different ways of coming up with a font 
"name". I don't know for sure but Gialuigi's could be related to the 
fact that here D050000L is called "D050000L [URW]".

b

p.s. I guess that no matter how hard you try to be desktop agnostic, 4th 
parties (i.e. font providers) can stuff you up.



More information about the User mailing list