[haiku-3rdparty-dev] Re: Get path to font file

  • From: scott mc <scottmc2@xxxxxxxxx>
  • To: haiku-3rdparty-dev@xxxxxxxxxxxxx
  • Date: Fri, 13 Nov 2009 07:06:45 +0000

On Fri, Nov 13, 2009 at 6:46 AM, Adrian Panasiuk <adek336@xxxxxxxxx> wrote:
> Hi ! Is it possible to get the path to a font , given the name of the font I
> want and whether it's bold/italic?
> Can I at least get a path to a default font without hardcoding?
> Regards,
> Adrian.

If you know the name of the font you could use find_directory() to
look in the font directories for it:
B_BEOS_FONTS_DIRECTORY
B_USER_FONTS_DIRECTORY
B_COMMON_FONTS_DIRECTORY
B_SYSTEM_FONTS_DIRECTORY

Or if in a bash script you could use finddir.  To see a list of the
dirs it knows type type finddir -l
Perhaps others know a better solutuion for finding a specific font?
-scottmc

Other related posts: