Forum > Unix

TFont Full path

<< < (2/2)

winni:
Hi!

Okay, Linux only:

Look in /etc/fonts/fonts.conf

In the first lines there are the font directories of your system.
For Suse Linux it is:

--- Code: Text  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---<!-- Font directory list -->         <dir>/usr/share/fonts</dir>        <dir>/usr/X11R6/lib/X11/fonts</dir>         <dir>/opt/kde3/share/fonts</dir>          <dir>/usr/local/share/fonts</dir>        <dir prefix="xdg">fonts</dir>        <!-- the following element will be removed in the future -->        <dir>~/.fonts</dir>  
As you see it is XML.

Keep on hacking!
Winni

alanphys:
Hi

You can use unit fpTTF in fcl-pdf.


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---function GetFontFile(fName:string):string;var lFC:TFPFontCacheItem;begingTTFontCache.ReadStandardFonts;lFC := gTTFontCache.Find(fName, fBold, fItalic);Result := lFC.FileName;end; 
My problem is gTTFontCache does not include font aliases. So the component 'default' font's name on my Fedora system is Sans Serif. If I look at the /usr/share/fonts directory there is no Sans Serif font. fc-match gives the Sans Serif font as Bitstream Vera Sans.

Listing Screen.fonts does list the Sans Serif font but I can't get the path to it.

There is an example under lazarus/examples/fontenum that lists the fonts including Serif and Sans Serif but doesn't appear to show how to get file info.

Perhaps the author of fpTTF @Graeme Geldenhys can help.

Regards

Navigation

[0] Message Index

[*] Previous page

Go to full version