bohoomil / fontconfig-ultimate

freetype2-infinality run-time settings => infinality compatible fontconfig => infinality-bundle
453 stars 38 forks source link

Rendering errors with libass, missing characters/shading ("Glyph bounding box too large") #53

Closed aphirst closed 9 years ago

aphirst commented 9 years ago

Opening this on request of @bohoomil in the Arch BBS. (Of course, that means that I am using Arch.)

Since a relatively recent revision of infinality (I am not sure exactly which personally, but others in Freenode #libass believe since the 2.5.3-10 revision of freetype2-infinality), a very small subset of ASS subtitles experience erroneous rendering with libass.

For example, this sample file, which during the first second shows no "w" in the top line where it should, and a few other missing "w"s throughout. Full verbose log.

[statusline] AV: 00:00:00 / 00:01:31 (0%) A-V: -0.000
[libass] Glyph bounding box too large: 34x33554455px
[libass] Glyph bounding box too large: 33x33554455px
[libass] Glyph bounding box too large: 30x33554452px
[libass] Glyph bounding box too large: 30x33554452px

libass version (release or git) seems to have no effect in this behaviour, and other testers using vanilla freetype/fontconfig have told me the problem does not occur for them. At least over on #libass, the consensus is that this has to have something to do with the infinality patchset.

Software versions when I originally posted this to the BBS:

freetype2-infinality-ultimate 2.5.3-12
fontconfig-infinality-ultimate 2.11.1-20
libass-git 0.11.2.37.gcad1cae-1
mpv 0.5.4-1

Current software versions:

fontconfig-infinality-ultimate 2.11.1-22
freetype2-infinality-ultimate 2.5.3-14
libass-git 0.12.0.5.ga31ea56-1
mpv 0.6.2-1

As stated on the BBS, if there's any additional information I've neglected to mention which would be useful, please just ask.

Update: I thought I would post my hardware and OS setup too, in case it might be relevant or useful:

Thinkpad X220
Intel i5-2520m
Intel HD3000 (xf86-video-intel 2.99.916)
xorg-server 1.16.2
linux 3.16 & 3.17
bohoomil commented 9 years ago

Thanks a lot again. I hope we'll get back to this issue and decide what can be done about it.

bohoomil commented 9 years ago

Just a little note/reminder: as Infinality patchset hasn't really changed, the problem probably lies in freetype upstream updates and/or libass (media players work properly with the clean freetype2-2.5.3).

Update See comment by @astiob.

astiob commented 9 years ago

I’ve just tested the sample with FreeType git master (2c4832d3) on OS X (without any Infinality), and it still appears correctly.

bohoomil commented 9 years ago

Thanks for the feedback. I'll update my comment.

aphirst commented 9 years ago

I found a video sample which causes a freeze in mpv and then a segfault, due seemingly to the same font-related subtitling issue: SAMPLE

AV: 00:00:02 / 00:01:30 (3%) A-V: -0.000
Glyph bounding box too large: 14x33554438px
AV: 00:00:15 / 00:01:30 (17%) A-V:  0.000
Glyph bounding box too large: 15x33554438px
AV: 00:00:18 / 00:01:30 (20%) A-V:  0.000
Glyph bounding box too large: 18501319x30609149px
Segmentation fault (core dumped)V: -0.000

Just thought I would post it before I forgot about it, and just in case it's of any use.

bohoomil commented 9 years ago

Thank you very much. This is what we'll need for sure. If possible, please don't delete the sample so others willing to help can use it for tests.

aphirst commented 9 years ago

Regarding https://github.com/bohoomil/fontconfig-ultimate/issues/53#issuecomment-62467193, it seems that something in libass-git has recently changed, as I now no longer get a segmentation fault on that file. The fact that many letters fail to render persists, but I assume that some recent changes in libass regarding malloc checks have had some sort of effect.

bohoomil commented 9 years ago

I seem to have good news, too. Right now I'm testing an upcoming release of freetype2-iu with a bunch of upstream bug fixes and the stock mpv from [community], and all sample files I have play fine. If nothing else goes wrong, I'll prepare new packages soon.

bohoomil commented 9 years ago

I've spent most of the time testing the new release of freetype2-iu with the latest upstream fixes and I can confirm that my previous note seems to be valid: stock mpv plays mkv files with embedded TTF fonts seamlessly, with no crashes whatsoever.

In this case, as soon as I'm ready with a tiny fontconfig-iu update this weekend, I'll upload the packages to the repository.

aphirst commented 9 years ago

Tentatively, this problem seems to be fixed in:

fontconfig-infinality-ultimate 2.11.1-23
freetype2-infinality-ultimate 2.5.3-15

, however I would appreciate if the report could be kept open for a brief period, so that I (and presumably others) can continue to test it with other ASS scripts+fonts.

In any case, thanks a lot for pushing out the update.

aphirst commented 9 years ago

It's been almost a year now. I think it's safe to say I'm no longer experiencing this bug. Feel free to close, if you want.