waddou / libass

Automatically exported from code.google.com/p/libass
1 stars 0 forks source link

Font rendering issue with Thai scripts #62

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Try with any Thai script

vsfilter: http://puu.sh/L94p
libass: http://puu.sh/L95s << And the script turns out unreadable

Original issue reported on code.google.com by nat3...@gmail.com on 24 Jul 2012 at 12:29

GoogleCodeExporter commented 8 years ago
Thai support in HarfBuzz might be incomplete, but I'll check that for you. Do 
you know which HarfBuzz version your copy of libass uses? If you don't know, a 
simpler question: OS and software used for playback?

Original comment by g...@chown.ath.cx on 24 Jul 2012 at 12:45

GoogleCodeExporter commented 8 years ago
Screenshot from Windows 7 64-bit taken with Aegisub r6933, but I do see this 
problem with VLC 2.0.1 too.

Thank you.

Original comment by nat3...@gmail.com on 24 Jul 2012 at 12:46

GoogleCodeExporter commented 8 years ago
Almost forgot: can you upload the .ass script, or better yet, an MKV that also 
includes the right font?

Original comment by g...@chown.ath.cx on 24 Jul 2012 at 12:48

GoogleCodeExporter commented 8 years ago
ASS with Font attached (the font is Cordia New). It would take hours to upload 
the mkv with my connection, sorry. But this script's timing should only be a 
little off to [UTWoots] Sword Art Online 03.

Original comment by nat3...@gmail.com on 24 Jul 2012 at 12:53

Attachments:

GoogleCodeExporter commented 8 years ago
With latest HarfBuzz, shaping seems to look fine, see the attached screenshot. 
Unfortunately, VLC does not include HarfBuzz support at all. :( I'm not sure 
about Aegisub, might be the same here.

Original comment by g...@chown.ath.cx on 24 Jul 2012 at 2:37

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks. I'll try reporting to VLC then. I just try in mplayer, and it seems to 
works fine.

Another thing though, could you try with this font? 
http://www.f0nt.com/download/sipafonts/THSarabunNew.zip It is used during 
opening sequence of the file I sent to you.

Expected: http://puu.sh/Lb36
libass: http://puu.sh/Lb3F

Though not readable, it does look out of place. (Screenshot taken from 
SMPlayer2)

Thank you for quick reply.

Original comment by nat3...@gmail.com on 24 Jul 2012 at 2:55

GoogleCodeExporter commented 8 years ago
I am told by VLC dev that latest HarfBuzz on Mac still has this problem, 
though...

Original comment by nat3...@gmail.com on 24 Jul 2012 at 3:24

GoogleCodeExporter commented 8 years ago
By the way: what's your opinion on word wrapping with Thai? Is it good enough 
to allow wrapping at zero width white space characters? Does VSFilter handle 
this in any way?

Original comment by g...@chown.ath.cx on 30 Jul 2012 at 2:28

GoogleCodeExporter commented 8 years ago
In Thai we didn't use zero width white space like other complex script, so it 
would be quite hard to do word-wrapping. I don't believe VSFilter handle this 
in anyway. Currently, I just force line break where appropriate.

Original comment by nat3...@gmail.com on 30 Jul 2012 at 10:58

GoogleCodeExporter commented 8 years ago
Hello, I'm one of the VLC dev written in the Comment 7.

I want to add HarfBuzz support in libass plugin, and I wrote a patch 
(especially for Windows and OS X).
https://trac.videolan.org/vlc/ticket/7209#comment:12
http://mailman.videolan.org/pipermail/vlc-devel/2012-August/089549.html

I want to ask one question. Should we build HarfBuzz with ICU support?
I think we don't have to do it.

Best regards,

Original comment by nkoriy...@gmail.com on 12 Aug 2012 at 10:24

GoogleCodeExporter commented 8 years ago
I did some initial contrib for VLC last year that included HarfBuzz for win32 
with glib. I had a lot of problems with ICU, building with mingw simply didn't 
really work. However, if ICU works fine for you now that's great. ICU support 
in HarfBuzz should work fine.

Original comment by g...@chown.ath.cx on 12 Aug 2012 at 12:51

GoogleCodeExporter commented 8 years ago
Thank you for quick reply.

I tried to build ICU and glib, but I think it's a little hard to build with our 
contrib system...(especially when cross compiling)

I made HarfBuzz with no-ICU no-Glib. At least, for this issue (Thai script), it 
seemed to work fine.

As for working with libass, does HarfBuzz require ICU or Glib?

Original comment by nkoriy...@gmail.com on 12 Aug 2012 at 9:03

GoogleCodeExporter commented 8 years ago
HarfBuzz needs a working backend. This is independent of libass. Basically you 
can either use

a) HarfBuzz native shaping. This requires a Unicode support library, e.g. glib, 
ICU or something else (it is easy to supply your own set of Unicode functions).
b) OS-specific shaper backends, i.e. CoreText (OS X) or Uniscribe (Windows). 
However, these are designed for compatibility/interoperability testing only, 
and might not perform well in practice.

IMO the best solution would be to come up with a simple, small Unicode database 
library instead of relying on huge frameworks like ICU or glib.

Original comment by g...@chown.ath.cx on 12 Aug 2012 at 11:08

GoogleCodeExporter commented 8 years ago
Thanks for explanation.
That clears my question!

I also hope simple, small Unicode library.

Original comment by nkoriy...@gmail.com on 13 Aug 2012 at 10:01

GoogleCodeExporter commented 8 years ago
I have written such a library: https://github.com/grigorig/ucdn

I'll probably include it in libass in some way, which should simplify getting 
HarfBuzz support to work on all OSes.

Original comment by g...@chown.ath.cx on 19 Aug 2012 at 6:31

GoogleCodeExporter commented 8 years ago
OK, HarfBuzz will *probably* get UCDN integration now (depends a bit on 
Behdad). Or I'll simply add support directly to libass. Either way, this bug 
can be closed.

Original comment by g...@chown.ath.cx on 1 Oct 2012 at 2:46