[vlc-devel] Re: [PATCH] Quartz subtitle renderer

Bernie Purcell b.purcell at adbglobal.com
Sun Apr 1 13:19:44 CEST 2007


On Fri, 2007-03-30 at 15:25 +0200, Derk-Jan Hartman wrote:
> On 30-mrt-2007, at 8:55, Bernie Purcell wrote:
> > Warning: the patch below adds a new file: modules/misc/quartztext.c  
> > that
> > may need to be svn 'add'ed to repository.
> >
> > The module itself should be pretty straightforward, but a few  
> > things to
> > note:
> > 1) I've set the module's score to be higher than freetype because I
> > can't get into the preferences pane on OS X any more to configure it
> > there - this was the only way I could test it. Whether or not you  
> > leave
> > it at the score it's at is up to you I guess.
> 
> Good call
> 
> > 2) it doesn't rely on the last patch I submitted, but without it the
> > only subtitle type that can render styled subtitles is a USF stream
> > muxed into a mkv container.
> 
> Tested both, works on a SSA file
> 
> > 3) If you find the rendered text excessively yucky you can try  
> > changing
> > the 2nd argument to CGContextSetLineWidth at line 814 to set the
> > thickness of the outline. I found this made noticeable differences to
> > the text output, but it varied so much with the font chosen that I
> > couldn't come up with a systematic way of setting it appropriately  
> > for a
> > random font. It should probably be a configuration parameter - as I
> > can't get the preferences working though I had no opportunity to play
> > around with that prospect though.
> 
> This is looking VERY promising. couple of things:
> 
> 1: positioning seems problematic at times with SSA, not really sure  
> where that's coming from, haven't looked into it yet. But http:// 
> deneb.student.utwente.nl/~hartman/videolan/Those_Who_Hunt_Elves_II_- 
> _0.mkv shows it really well. I guess some margin values or stuff that  
> need to be inherited from the input fmt are not copied over.
> 
Sorry, I haven't downloaded the file yet - am just about to. I hope a
fix for part 2) has already fixed the problem though. The left margin
was being applied twice due to some careless code.

> 2: on plain text the last char appears to be missing at times. For  
> example. Try the hotkeys for audio-track subtitle-track ('l' vs.  
> 's' ) The text doesn't show the ']' that should be at the end of the  
> language tag ('[English]')
> 
I didn't even know about this feature. How funny! I thought the module
was only used to draw the subtitles. It appears to be fixed now though
in the patch attached.

> 3: I do think that a thicker black outline should be used in a lot of  
> cases. It's currently 1.0f, which by my interpretation of the spec  
> means 0.5 on either side of the graphic. I was wondering if we can  
> make it relative to the fontsize by default. Personally i think that  
> would result in the best visual appearance for most people. And then  
> have 1.0f as the minimum value unless "no border" is requested.
> 
Haven't done anything about this yet - will need a bit of
experimentation. My access to email is going to get a bit limited for a
while very shortly, so I'll try to do something about it next week
before that happens.

later:
On Fri, 2007-03-30 at 15:42 +0200, Derk-Jan Hartman wrote: 
> BTW. since the Quartz renderer has automatic font fallback systems  
> for unsupported charsets, we should probably select another default  
> font for the subtitles. Originally I chose Lucida Grande, because it  
> supported the  most charsets, not because of how good it looked.
> 
> Trebuchet, Arial or Verdana is probably a better font. If I remember  
> well one of the reasons Lucida Grande is the System Font, is because  
> it's a tall and sleek font. With white subtitles however, I think a  
> font that is a tad "fatter" is preferred.
> 
Trebuchet MS and Arial appear to be a bit thinner that Lucida Grande
when I look at them in TextEdit - Verdana looks like the best bet, so
I installed it as the default.

and:
On Fri, 2007-03-30 at 15:49 +0200, Christophe Mutricy wrote: 
> Some small details
> 
> 
> > +/*****************************************************************************
> > + * quartztext.c : Put text on the video, using Mac OS X Quartz Engine
> > + *****************************************************************************
> > + * Copyright (C) 2002 - 2005 the VideoLAN team
> 
> We are now in 2007
Are you sure? Most of the time I'm not. This is what I get for copying someone
else's header and not paying enough attention to what I have to change.
> 
> > +vlc_module_begin();
> > +    set_shortname( _("Text renderer"));
> > +    set_description( _("Quartz font renderer") );
> 
> the freetype module also use  set_shortname( _("Text renderer"));  so it
> needs to be changed (possibly in both places) if the quartz renderer use
> some configuretion variable and so appears in the preferences.
> 
and this is what happens when I don't know enough about what I'm doing to
realise I have to change this.
Both of these should be fixed in the patch. :-)

Bernie
-------------- next part --------------
A non-text attachment was scrubbed...
Name: quartz_fewfixes.svn-diff
Type: text/x-patch
Size: 37106 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20070401/0f4f091d/attachment.bin>


More information about the vlc-devel mailing list