Re: [Bitbucket] Issue #22: add '~/.fonts' (for user fonts on Ubuntu) to TTFSearchPath (rptlab/reportlab)

Marius Gedminas <[email protected]>
Newsgroups gmane.comp.python.reportlab.user
Message-ID <20140224224007.GB13366@platonas>
On Mon, Feb 24, 2014 at 10:43:32AM +0000, Robin Becker wrote:
> On 22/02/2014 06:17, Ian Wood wrote:
> >--- you can reply above this line ---
> >
> >New issue 22: add '~/.fonts' (for user fonts on Ubuntu) to TTFSearchPath
> >https://bitbucket.org/rptlab/reportlab/issue/22/add-fonts-for-user-fonts-on-ubuntu-to
> >
> >Ian Wood:
> >
> >Probably could be in search paths for other types of font also..
> ...
> I am trying to avoid answering all these issues on bitbucket so I'm
> copying reportlab-users to give others a chance to weigh in.
> 
> I have no particular feeling about this particular entry. Since
> python doesn't recognize the ~ as special just using that character
> would not work.
> 
> The question sould probably be re-phrased as can you do add
> os.path.join(os.environ.get('HOME','/dev/null'),'.fonts') to one or
> more search paths?

os.path.expanduser is indeed the canonical solution for this.

> I'm not an expert at all the places where font paths can be
> specified; presumably there might be FONTPATH environment variables
> as well.

I believe the new standard is ~/.local/share/fonts/ [1] (where the
~/.local/share part can be overridden by the $XDG_DATA_HOME environment
variable[2]).

[1] https://github.com/ValveSoftware/steam-for-linux/issues/2307
[2] http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html

Marius Gedminas
-- 
I am right now in the process of reading the Xft source code (the suspense near
the end of Chapter 7 is unbearable) [...]
	-- Juliusz Chroboczek
signature.asc (application/pgp-signature, 190 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.14 (GNU/Linux)

iD8DBQFTC8pHkVdEXeem148RAj2rAJ9XecqNy3ibuxO+176bZTaOomj4gwCdFnUS
XdPsHW/ZCYNhVRXlgA64QQY=
=I/hT
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.