[MPlayer-users] Incorrect font selection in libass (once again)

Evgeniy Stepanov eugeni.stepanov at gmail.com
Wed Jul 9 17:10:07 CEST 2008


On Wednesday 09 July 2008 02:06:31 Vladimir Mosgalin wrote:
> Hi everybody.
>
> This question is primary for Evgeniy, as I suspect. I have a mkv file
> with embedded fonts, and libass fails to choose one of them, rolling
> back to Sans. I wonder if subtitles should be fixed or some solution can
> be applied to libass to pick up correct font.
>
> Running mplayer -v produces output:
>
> event at 90290, +1960:
> 12,0,Azu_FO,,0000,0000,0000,,{\clip(0,0,320,305)}{\pos(152,343)}{\fnRub
> This!, Transfer
> Sheet\fs17\fscy102\fscx140\bord0\shad0\c&HE8E6D8&}O\Nn\N\Na\N\Ng\Nr\Ne\Na\N
>t\N\Nr\No\Na\Nd\N, event at 90290, +2210:
> 21,0,Azu_FO,,0000,0000,0000,,{\pos(125,315)}{\fnRub This!, Transfer
> Sheet\fs17\fscy102\fscx140\bord0\shad0\c&HE8E6D8&}s\Nh\Ne\Ne\Np\N\Na\Nr\Ne\
>N\Nl\No\Ns\Nt event at 90290, +2210:
> 27,0,Azu_FO,,0000,0000,0000,,{\clip(0,0,320,252)}{\pos(96,298)}{\fnRub
> This!, Transfer
> Sheet\fs17\fscy102\fscx140\bord0\shad0\c&HE8E6D8&}a\Nt\N\Nt\Nh\Ne\N\Nf\No\N
>r\Nk\Ns\N. [ass] Font info: family 'Arial', style 'Normal', fullname
> 'Arial', slant 0, weight 80 fontconfig_select: (Arial, 80, 0) ->
> /usr/share/fonts/default/TrueType/arial.ttf, 0 [ass] fontconfig: Выбранный
> шрифт не совпадает с запрошенным: 'DejaVu Sans' != 'Rub This!, Transfer
> Sheet' [ass] Font info: family 'DejaVu Sans', style 'Book', fullname
> 'DejaVu Sans', slant 0, weight 80 fontconfig_select: (Rub This!, Transfer
> Sheet, 80, 0) -> /usr/share/fonts/dejavu/DejaVuSans.ttf, 0
>
> mkv file has attachment with ID 1217773493, called RUBTTS__.TTF. I
> extracted it. Here's "ftdump RUBTTS__.TTF" output:
>
> There is 1 face in this file.
>
> ----- Face number: 0 -----
>
> font name entries
>    family:     Rub This!
>    style:      Transfer Sheet
>    postscript: RubThisTransferSheet
>
> font type entries
>    FreeType driver: truetype
>    sfnt wrapped:    yes
>    type:            scalable
>    direction:       horizontal
>    fixed width:     no
>    glyph names:     yes
>    EM size:         1000
>    global BBox:     (-36,-184):(775,804)
>    ascent:          804
>    descent:         -200
>    text height:     1004
>    glyph count: 117
>
> charmaps
>    0: platform 0, encoding 0 (active)
>    1: platform 1, encoding 0
>    2: platform 3, encoding 1
>
>
> Here's the font the way it's found by fc-match:
>
> $ fc-match -v 'Rub This!'
> Pattern has 31 elts (size 32)
>         family: "Rub This!"(s)
>         familylang: "en"(s)
>         style: "Transfer Sheet"(s)
>         stylelang: "en"(s)
>         fullname: "Rub This! Transfer Sheet"(s)
>         fullnamelang: "en"(s)
>         slant: 0(i)(s)
>         weight: 200(i)(s)
>         width: 100(i)(s)
>         size: 12(f)(s)
>         pixelsize: 12.5(f)(s)
>         foundry: "unknown"(s)
>         antialias: FcTrue(w)
>         hintstyle: 3(i)(w)
>         hinting: FcTrue(w)
>         verticallayout: FcFalse(s)
>         autohint: FcFalse(s)
>         globaladvance: FcTrue(s)
>         file: "/home/mosgalin/.fonts/RUBTTS__.TTF"(s)
>         index: 0(i)(s)
>         outline: FcTrue(s)
>         scalable: FcTrue(s)
>         dpi: 75(f)(s)
>         rgba: 5(i)(w)
>         scale: 1(f)(s)
>         charset: 0000: 00000000 ffffffff ffffffff 7fffffff 00000000
> 2990530a 91440170 11400070 0002: 00000000 00000000 00000000 00000000
> 00000000 00000000 2d000080 00000000 0020: 00010000 00000000 00000000
> 00000000 00000000 00000000 00000000 00000000 (s)
>     lang: fj|ho|ia|ie|io|nds|nr|om|so|ss|st|sw|ts|vo|xh|zu(s)
>     fontversion: 65536(i)(s)
>     fontformat: "TrueType"(s)
>     embeddedbitmap: FcTrue(s)
>     decorative: FcFalse(s)

It's probably because of the comma in font name. Do you know if it works in 
windows?

> I'm using MPlayer dev-SVN-r26982-4.3.0, fontconfig is 2.5.0.
>
>
>
> Also there's another problem with this file, resulting in messages like
>
> event at 1424670, +2000:
> 406,0,Azu_FO,,0000,0000,0000,,{\pos(232,88)}{\fnBilly Bear's
> Crayons\fs37\bord5\shad0\c&HBB6047&\3c&HEEF6F7&}{\frz5}Summer event at
> 1424670, +2000: 407,0,Azu_FO,,0000,0000,0000,,{\pos(423,83)}{\fnBilly
> Bear's Crayons\fs37\bord5\shad0\c&HBB6047&\3c&HEEF6F7&}Break Special event
> at 1424670, +2000:
> 408,0,Azu_FO,,0000,0000,0000,,{\pos(500,258)}{\frz5\fn\fnBilly Bear's
> Crayons\fs42\b0\bord5\shad0\c&H504BC4&\3c&HEEF6F7&}Home\N Inspections [ass]
> Font info: family 'Arial', style 'Normal', fullname 'Arial', slant 0,
> weight 80 fontconfig_select: (Arial, 80, 0) ->
> /usr/share/fonts/default/TrueType/arial.ttf, 0 [ass] Font info: family
> 'Billy Bear's Crayons', style 'Regular', fullname 'Billy Bear's Crayons',
> slant 0, weight 80 fontconfig_select: (Billy Bear's Crayons, 80, 0) ->
> CRAYON.TTF, 0
> [ass] fontconfig: Выбранный шрифт не совпадает с запрошенным: 'DejaVu Sans'
> != '\' [ass] Font info: family 'DejaVu Sans', style 'Book', fullname
> 'DejaVu Sans', slant 0, weight 80 fontconfig_select: (\, 80, 0) ->
> /usr/share/fonts/dejavu/DejaVuSans.ttf, 0 Unable to parse: "fnBilly Bear's
> Crayons\fs42\b0\bord5\shad0\c&H504BC4&\3c&HEEF6F7&}Home\N Inspections"
> Unable to parse: "fnBilly Bear's
> Crayons\fs42\b0\bord5\shad0\c&H504BC4&\3c&HEEF6F7&}Home\N Inspections" ...
> Unable to parse: "fnBilly Bear's
> Crayons\fs42\b0\bord5\shad0\c&H504BC4&\3c&HEEF6F7&}Home\N Inspections"
>
>
> The offending like in .ass are
> Dialogue:
> 0,0:23:44.67,0:23:46.67,Azu_FO,,0000,0000,0000,,{\pos(232,88)}{\fnBilly
> Bear's Crayons\fs37\bord5\shad0\c&HBB6047&\3c&HEEF6F7&}{\frz5}Summer
> Dialogue:
> 0,0:23:44.67,0:23:46.67,Azu_FO,,0000,0000,0000,,{\pos(423,83)}{\fnBilly
> Bear's Crayons\fs37\bord5\shad0\c&HBB6047&\3c&HEEF6F7&}Break Special
> Dialogue:
> 0,0:23:44.67,0:23:46.67,Azu_FO,,0000,0000,0000,,{\pos(500,258)}{\frz5\fn\fn
>Billy Bear's Crayons\fs42\b0\bord5\shad0\c&H504BC4&\3c&HEEF6F7&}Home\N
> Inspections
>
>
> Words "Summer" and "Break Special" are written with this (cool-looking)
> font, but "Home Inspections" isn't. Yeah I notice the double \fn ;)

Thanks for noticing, it is a bug in libass. Fixed.



More information about the MPlayer-users mailing list