[vlc-devel] Re: new subtitle code by Dnumgis

Sigmund Augdal Sigmund.Augdal at idi.ntnu.no
Fri Jul 4 19:20:35 CEST 2003


On Fri, Jul 04, 2003 at 01:56:01AM +0200, Derk-Jan Hartman wrote:
> This is to sigmund and other interested parties.
> 
> As some of you might know, sigmund has been working for some time on 
> writing newer subtitle code for VLC. This new code will be using 
> freetype2. This will allow us to use any truetype, freetype font for 
> displaying subtitles ( not for DVD's of course ). Another advantage is 
> the ability to change the size of the font.
> 
> His code is now reaching a usuable state and gibalou and I actually got 
> a change to test it today. There is only one way to put this: 
> <stevejobs>It's amazing</stevejobs>.
> 
> These shots are showing subtitles on the movie Amelie. It's 
> LucidaBrightItalic.ttf from Apple's JavaFramework (i just typed 'locate 
> .ttf' )
> http://sidekick.student.utwente.nl/gallery/album01/freetype_subs1
> http://sidekick.student.utwente.nl/gallery/album01/freetype_subs2
> 
> Note that the first shot is paused and the second actually playing. The 
> quality when playing is dramatically better as you can see.
I had the same kind of blocking in the rendering on my linux box. Never
figured out what it might be. But the issue seems to be gone on my winxp
box. Maybe this is because of the way gibalou compiled freetype, I don't
know. I used the same freetype calles and drew the bitmaps on a qt widget
for a test case program, and that seemed to work correctly. I think it's
either because of some strange aspect of yuv, that I don't understand, or it
is some semantic bug in this line: 
pixel = ((pixel*(255-alpha))>>8) + (255*alpha>>8);
(pixel is the current pixel value, alpha is the transparency value to be
merged in)

> 
> The code still needs some cleaning up according to him, and there are 
> probably some bugs left. But it looks promising and the code will 
> probably be in CVS real soon now ;)
> I'll write some of what i found myself here.
> 
> bug.
> >[00000154] osdtext video output debug: 254
> >[00000154] osdtext video output debug: 255
> >[00000154] osdtext video output error: file 
> >/System/Library/Fonts/Symbol.dfont have unknown format
> >[00000154] main video output error: no suitable text renderer module
> >[00000154] main video output error: cannot delete object with a parent
> >[00000152] ffmpeg decoder error: cannot create vout
> 
> Everything freezes when the font could not be loaded, it should just 
> deactivate the osdtext module and continue.
> btw. the problem i experience here is described further below. I can 
> get it working with .ttf fonts etc though.
I will fix this. I'm also thinking of making a font renderer submodule for
the dummy module.

> 
> You call your module osdtext. Isn't freetype a better name since you 
> now have the "text render" capability ?? this would allow for a more 
> general naming scheme, so other possible text rendering methods could 
> follow??? Or perhaps freetype_osd, freetype_text ???
This was one of the things that needed to be cleaned up before release to
the rest of the world.
> 
> The space between two sublines can be somewhat small with larger font 
> sizes. perhaps this should be relative to subsize???
I'll look into this. Perhaps freetype gives some hints about the line feed.
> 
> We should probably find some package with some fonts ppl can use in 
> different areas. As far as i can tell with google'ing, no real/complete 
> unicode font seems to be present currently. Also see the following, and 
> not the etl-unicode font.
> http://czyborra.com/unifont/HEADER.html
> 
> OSX has some real nice unicode fonts. These are all .dfont's but 
> currently don't seem to work. However, since google shows that it 
> apparently ought to work, I think it should be possible to get this 
> working.
> I suspect it's because Meuuh and I compiled freetype as the unix 
> variant and not with the mac extensions.
I leave this part to you. This is perhaps a good starting point:
http://www.freetype.org/freetype2/docs/reference/ft2-mac_specific.html

Else, thanks for the feedback

Sigmund
-- 
This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html
If you are in trouble, please contact <postmaster at videolan.org>



More information about the vlc-devel mailing list