1) nope, it's 1.1.4 from the download, not off the repo
2) osx mountain lion + windows 8 haven't tried any others.
3) lib/pyglet/font/base.py
4) 'fraid not, just the ones I'm using. That said, fontTool is the only dep 
and that appears to be cross platform
5) I'm not sure how useful it'll be, since, like I said, it depends on 
fontTool, but I could probably clean it up and do that.

Yeah, reading the source I saw lots of :( in there.

I honestly wouldn't want to touch it if I didn't have to. The entire thing 
should be ripped out and replaced with a freetype binding that loads and 
renders font files directly imho. The mountains of code in there to access 
the system fonts is just crazy. 

~
Doug.

On Tuesday, May 7, 2013 11:50:18 AM UTC+8, Nathan wrote:
>
> Doug, let me try to ask you all the questions you're probably going to get 
> all at once.  :-)
>
> Is this with the latest version of pyglet from the repository?
> What OS are you using?
> What file were you working on specifically?
> Did you look at the code/implementation for other operating systems?
> Will you submit your patch so that others can take a look at it?
>
> ...and remind you that cross-platform development IS really tricky and 
> arduous, and no one is being paid to do this.  I'm sure the committers 
> would be happy to accept quality patches from you.  :-)  Font stuff is 
> especially nasty.  I spent several hours looking over some of the font 
> implementation recently, and there are quite a few comments detailing the 
> pain and agony the author(s) experienced with this or that platform.
>
> ~ Nathan
>
>
> On Mon, May 6, 2013 at 6:58 PM, Doug Linder <[email protected]<javascript:>
> > wrote:
>
>> -_____-
>>
>> Anyway, as a work around for this craziness, see here:
>>
>> http://www.starrhorne.com/2012/01/18/how-to-extract-font-names-from-ttf-files-using-python-and-our-old-friend-the-command-line.html
>>
>> I've manually patched my copy of pyglet so:
>> 1) have_font() does what it is supposed to and checks if the font exists
>> 2) a new font_name() function that returns the font name for a given ttf 
>> / otf, etc.
>>
>> It pulls a dependency in on fontTools (
>> http://sourceforge.net/projects/fonttools/) so it's probably no good for 
>> a mainline merge, but something along these lines would make the pyglet 
>> font for working with font files a great deal easier to use.
>>
>> ~
>> Doug.
>>
>>
>> On Monday, May 6, 2013 8:29:44 PM UTC+8, Doug Linder wrote:
>>>
>>> Hey there,
>>>
>>> I'm having a lot of trouble with the font api.
>>>
>>> Basically it comes down to this:
>>>
>>> 1) If you have a font, and you call add_file() on it, you have no idea 
>>> what the associated font name is.
>>>
>>> 2) If you call either pyglet.font.load() for pyglet.font.base.Font.have_
>>> **font(), these return a font / true in all circumstances.
>>>
>>> The only way I've found to determine if we're successfully using a font 
>>> or not is:
>>>
>>>         pyglet.font.add_file(path)
>>>         font = pyglet.font.load(name=font_**name, size=1)
>>>         span = font.ascent + font.descent
>>>         if span > 5:
>>>           print("ID %s did not match a known font name" % self.font)
>>>
>>> This seems absolutely ridiculous to me. 
>>>
>>> I mean, what the heck is this nonsense? 
>>>
>>>     @classmethod
>>>     def have_font(cls, name):
>>>         '''Determine if a font with the given name is installed.
>>>
>>>         :Parameters:
>>>             `name` : str
>>>                 Name of a font to search for
>>>
>>>         :rtype: bool
>>>         '''
>>>         return True
>>>
>>> !!! Why does the call even exist? 
>>>
>>> I appreciate loading fonts cross platform is tricky, and I suppose it's 
>>> vaguely nice having access to the default system fonts, but this api is 
>>> really really hard to use.
>>>
>>>
>>> Am I doing something wrong?
>>> Why is using fonts so difficult?
>>>
>>> ~
>>> Doug.
>>>
>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "pyglet-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To post to this group, send email to [email protected]<javascript:>
>> .
>> Visit this group at http://groups.google.com/group/pyglet-users?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pyglet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to