[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Missing function



Where did that function go! ;)

That has been added to cvs.  Thanks again.


On 10/28/05, John Popplewell <john@xxxxxxxxxxxxxxxxxxxxxx> wrote:
> Hi,
>
> whilst testing pygame CVS on Linux I discovered that SolarWolf was
> failing to start with an error about a missing function.
>
> Seems like read_unix_fontscache() in lib/sysfont.py has gone missing.
> Here is a diff against current CVS, which puts the missing function back in,
>
> cheers,
> John Popplewell.
>
> Index: lib/sysfont.py
> ===================================================================
> RCS file: /home/cvspsrv/cvsroot/games/pygame/lib/sysfont.py,v
> retrieving revision 1.21
> diff -c -r1.21 sysfont.py
> *** lib/sysfont.py      28 Aug 2005 06:20:30 -0000      1.21
> --- lib/sysfont.py      27 Oct 2005 20:42:41 -0000
> ***************
> *** 126,131 ****
> --- 126,149 ----
>       return fonts
>
>
> + #read the fonts from a unix 'fonts.cache-1' file
> + def read_unix_fontscache(dir, file, fonts):
> +     file = open(os.path.join(dir, file))
> +     for line in file.readlines():
> +         try:
> +             font, num, vals = line.split(' ', 2)
> +         except ValueError:
> +             continue
> +         font = font.replace('"', '')
> +         if font[-4:].lower() not in [".ttf", ".ttc"]:
> +             continue
> +         font = os.path.join(dir, font)
> +         vals = vals.split(':')
> +         name = _simplename(vals[0][1:])
> +         bold = vals[1].find('Bold') >= 0
> +         italic = vals[1].find('Italic') >= 0
> +         _addfont(name, bold, italic, font, fonts)
> +
>
>   #read the fonts from a unix 'fonts.cache-1' file
>   def read_unix_fontsdir(dir, file, fonts):
>
>