From: John H. <jdh...@ac...> - 2005-10-19 20:31:38
|
>>>>> "Nicholas" == Nicholas Young <su...@su...> writes: Nicholas> On Wed, 2005-10-19 at 12:08 -0500, John Hunter wrote: >> Hi this looks very nice! I have to run now but I'll give you a >> quick tip. kerning controls the inter-letter spacing, and your >> Fonts class has to override "get_kern"; the base class always >> returns 0 Nicholas> I had missed this function - but as far as I can see it Nicholas> isn't actually called in the majority of cases (only Nicholas> where set_font is called on the parent GroupElement - Nicholas> which doesn't always happen in any of the common cases Nicholas> I've tried). Am I missing something? The Group element is the only place kerning is set, but groups are the right place. Eg \rm{hi mom} is a group. I just took a look and noticed I commented out the place where the kern is set def advance(self): 'get the horiz advance' return self.metrics.advance # how to handle cm units?+ self.kern*self.widthm It looks like I was a bit confused about how to best include the kerning information, and was experimenting by treating it as a fraction of the width of an "m". You may want to try some alternatives. But this is where you would start hacking. JDH |