[Lazarus] RE : How to I publish the SearchFont method of TFontManager?

silvioprog silvioprog at gmail.com
Tue Jun 21 15:04:31 CEST 2011


2011/6/21 Graeme Geldenhuys <graemeg.lists at gmail.com>:
> On 21/06/2011 12:30, silvioprog wrote:
>> function LSFontExists(const AFileName: TFileName): Boolean;
>> {$IFDEF UNIX}
>> const
>>   VFontPath = '/usr/share/fonts';
>> {$ENDIF}
>> begin
>>   Result := FileExists(AFileName) or
>> {$IFDEF UNIX}
>>    (FileExists(VFontPath + AFileName)) or
>>    (FileExists(VFontPath + '/truetype/' + AFileName)) or
>>    (FileExists(VFontPath + '/truetype/freefont/')) ;
>> {$ENDIF}
>
> Maybe one should add  ~/.fonts/ to the search path as well? For example,
> I often have custom fonts installed in my home directory, which are not
> accessible to other users on the system.
>
>
> Regards,
>  - Graeme -
>
> --
> fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
> http://fpgui.sourceforge.net/

Good idea. I'll implement it.

Thx Graeme. ;)

-- 
Silvio Clécio
===============================================
Blog - <silvioprog.com.br>
Twitter - <twitter.com/silvioprog>
LazSolutions - <code.google.com/p/lazsolutions>
LazWebSolutions - <code.google.com/p/lazwebsolutions>
Lazarus-BR - <groups.google.com.br/group/lazarus-br?hl=pt-BR>
===============================================
   * Conheça nosso canal IRC sobre Lazarus: #lazarus-br *
===============================================




More information about the Lazarus mailing list