Recent

Author Topic: TAChart demo nogui does not output text  (Read 2765 times)

wp

  • Hero Member
  • *****
  • Posts: 9025
Re: TAChart demo nogui does not output text
« Reply #15 on: September 28, 2021, 04:52:49 pm »
OK, I understand now. InitFont, simplified for Linux, does this:
Code: Pascal  [Select][+][-]
  1. procedure InitFonts;
  2. begin
  3.   InitEngine;
  4.   FontMgr.SearchPath :=
  5.     '/usr/share/cups/fonts/;' +
  6.     '/usr/share/fonts/truetype/;' +
  7.     '/usr/share/fonts/truetype/liberation/;' +
  8.     '/usr/local/lib/X11/fonts/;' +
  9.     GetUserDir + '.fonts/';
  10. end;
The font manager's SearchPath contains only a "liberation" folder, not the "liberation2" of your example. I looked in my Mint-VM, and I see that there should be many more. I'm no Linux specialist so that I cannot say that the situation in Mint is typical of all Linux versions around today. Probably every type of Linux distribution and every major application adds some dozens of font folders to the system. My intention with InitFonts was to provide a minimal solution which covers "most" cases (whatever that means). The user (you) still has the possibility to extend the SearchPath to any level:
Code: Pascal  [Select][+][-]
  1. procedure MyInitFonts;
  2. begin
  3.   InitFonts;
  4.   FontMgr.SearchPath := FontMgr.SearchPath +  ';' +
  5.     '/usr/share/fonts/truetype/liberation2/;'
  6.     '/usr/share/fonts/truetype/noto/;'+
  7.     '/usr/share/fonts/truetype/openoffice/;'+
  8.     '/usr/share/fonts/truetype/dejavu/;'+
  9.     '/usr/share/fonts/truetype/freefont/';   // plus many more...
  10. end;
Of course, I am willing to modify the font list in the InitFonts procedure if it is not typical.
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

MaartenJB

  • Jr. Member
  • **
  • Posts: 97
Re: TAChart demo nogui does not output text
« Reply #16 on: September 29, 2021, 08:18:00 am »
Those things are indeed pretty hard with all distros available. I think for my project I just specify the exact font path I want to use. Do you need me to test anything else for this fix to be applied?

wp

  • Hero Member
  • *****
  • Posts: 9025
Re: TAChart demo nogui does not output text
« Reply #17 on: September 29, 2021, 09:55:48 am »
That's fine, thanks. The changes should be in fixes_2_2 now.
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

MaartenJB

  • Jr. Member
  • **
  • Posts: 97
Re: TAChart demo nogui does not output text
« Reply #18 on: September 29, 2021, 10:09:05 am »
Ok nice, thanks for your help!

 

TinyPortal © 2005-2018