[MPlayer-users] How to force SSA subtitles size to constant one ?

Evgeniy Stepanov eugeni.stepanov at gmail.com
Sat Aug 25 00:10:02 CEST 2007


On Saturday 25 August 2007, Παναγιώτης Κατσαλούλης wrote:
> On 24 Αυγ 2007, at 11:23 ΜΜ, Evgeniy Stepanov wrote:
> > On Friday 24 August 2007, Παναγιώτης
> >
> > Κατσαλούλης wrote:
> >> 3) When jubler creates the subtitle file, instead of using the given
> >> font sizes, calculate new font size based on the value of OS2
> >> metrics. E.g. when the user requests a font size of 24, to save
> >> inside the file a font size of 30.
> >
> > If you are generating subtitles in SSA/ASS format, then they will
> > later be
> > displayed using os2 metrics. Either with mplayer, or asa (aegisub
> > and, in the
> > future, vlc), or vsfilter. It can be considered part of the
> > standard, and it
> > is absolutlely needed for all the subtitles made over the years to be
> > displayed correctly.
>
> You are probably right :(
> I know that in the long term, this is what I should do - retain
> compatibility with others.
> The key phrase is what you said: "It can be considered part of the
> standard"
>
> So, if I understood right (from the patch), the way to do this is to
> rescale font based on the following factor:
>
> (hori->Ascender - hori->Descender) / (os2->usWinAscent + os2-
>
>  >usWinDescent)
>
> where hori are actual metrics and os2 are OS2 metrics.
>
> Since I am using Java I know how to get the "hori" metrics. The
> problem is that Java seems to have dropped the "os2" metrics.
> It is able though to read font tables from the file, using this  method:
> http://java.sun.com/j2se/1.5.0/docs/api/java/awt/font/
> OpenType.html#getFontTable(java.lang.String)
> So, I think that if I use this information in conjunction with
> http://developer.apple.com/textfonts/TTRefMan/RM06/Chap6OS2.html
> I will be able to calculate this factor.
>
> Am I missing something?

I could not open the first link, but in general this is correct.



More information about the MPlayer-users mailing list