Opened 3 years ago

Closed 5 months ago

Last modified 5 months ago

#6152 closed defect (fixed)

Arabic subtitle doesn't work vlc 2.0.0

Reported by: busy Owned by: fkuehne
Priority: normal Milestone: 3.0.0
Component: Subtitles Version: 2.0.0
Severity: normal Keywords:
Cc: Difficulty: unknown
Platform(s): MacOS Work status: Not started

Description

Arabic subtitle doesn't work. I have vlc 2.00 mac. The old one work perfectly with Arabic subtitle. I changed the option to arabic widows 1256 but still does not work. It appears as squares. Thank you for your great program :).

Attachments (9)

macvlc_arabic.png (116.4 KB) - added by nkoriyama 3 years ago.
sample.srt (43.8 KB) - added by busy 3 years ago.
macvlc_arabic_arialq.png (117.5 KB) - added by nkoriyama 3 years ago.
sample.rar (16.4 KB) - added by busy 3 years ago.
quartztext.png (201.1 KB) - added by busy 3 years ago.
freetype.png (182.1 KB) - added by busy 3 years ago.
windows-freetype-0020.png (113.8 KB) - added by nkoriyama 3 years ago.
mac-freetype-0020.png (115.5 KB) - added by nkoriyama 3 years ago.
mac-quartztext-0020.png (118.7 KB) - added by nkoriyama 3 years ago.

Download all attachments as: .zip

Change History (50)

comment:1 Changed 3 years ago by nkoriyama

It should work. Try the following:

  • Set suitable default encoding in the preferences. (If the encoding of subtitles file is UTF-8, it doesn't need.)
  • Set font in the preferences. Default value is Arial Black that doesn't contain any Arabic glyphs.
  • Run VLC and play a short movie (1sec ok:-) from terminal.app: /Applications/VLC.app/Contents/MacOS/VLC -vvv >& /tmp/vlc.log And find the freetype log: [0x10409dcf0] freetype spu text debug: Using XXX as font from file /Library/Fonts?/XXX.ttf

If Arabic font is properly set, you should see Arabic subtitles.

If you cant. Try the following:

And please attach a piece of srt files you use. (not a full but a short in 250kb)

Changed 3 years ago by nkoriyama

comment:2 Changed 3 years ago by nkoriyama

Here is an evidence. attachment:macvlc_arabic.png

Well, there are too many users (Windows/Mac?) who complain that VLC2.0 doesn't work with foreign subtitles, but All of them work for me...
We must prepare a FAQ :-)

Last edited 3 years ago by nkoriyama (previous) (diff)

comment:3 Changed 3 years ago by nkoriyama

But there are possibility that the issue is really bug of VLC. So, I want to wait the user's reaction.

comment:4 follow-up: Changed 3 years ago by jb

Maybe we can do something about it? Like quitting Fontconfig and using Mac APIs?

comment:5 Changed 3 years ago by busy

It worked when I changed the font to Arial instead of Arial Black. but the font is bad in Arabic and some of the punctuation marks appear as squares.

But the font in your picture is very good!!.

If you want an example of a perfect program in Arabic subtitles there is movist and the old vlc. I hop you fix the font in the next version. Thank you very much, I appreciate your help and your fast answer.

comment:6 Changed 3 years ago by nkoriyama

@busy Please upload your example srt.

Changed 3 years ago by busy

comment:7 Changed 3 years ago by busy

Can you tell me what is the font in the picture ? I tried almost every font in vlc in the preferences but still the same bad font!.

comment:8 Changed 3 years ago by nkoriyama

Replying to busy:

It worked when I changed the font to Arial instead of Arial Black. but the font is bad in Arabic and some of the punctuation marks appear as squares.

I attached the arabic subtitles using Arial next. previous one is KacstOne?.ttf.

Changed 3 years ago by nkoriyama

comment:9 Changed 3 years ago by nkoriyama

I can't judge which is good or bad :-) Anyway thanks for the sample.srt!

comment:10 Changed 3 years ago by busy

I am sorry but, how can the old vlc and movist work with Arial Black in Arabic but the new doesn't ?

comment:11 Changed 3 years ago by nkoriyama

From 2.0, text renderer is changed from quartztext (using Mac OS X API) to freetype (library used widely Unices/windows). quartztext also exist snow but freetype is chosen by default.

Last edited 3 years ago by nkoriyama (previous) (diff)

comment:12 Changed 3 years ago by nkoriyama

I don't know well about quartztext, but maybe it has some fallback mechanism or another reason.

comment:13 follow-up: Changed 3 years ago by nkoriyama

Strictly speaking, Arial Black doesn't contain Arabic, but have Latin-1/Cyrillic/Greek/etc.Arial contains Arabic.

Freetype renderer uses only glyphs that choosen font has. So, you can't use Arial Black for Arabic subtitles at least if you use freetype renderer.

If you choose quartztext renderer, maybe you can use Arial Black.(!!!!BUT I DO NOT TESTED!!!!).

How to choose quartztext renderer:
preferences->all->video->subtitles/osd -> change text rendering module Default to CoreText? font renderer

comment:14 in reply to: ↑ 4 Changed 3 years ago by nkoriyama

Replying to jb:

Maybe we can do something about it? Like quitting Fontconfig and using Mac APIs?

I don't know well about Mac APIs, so I cannot state my opinion.. Do you mean changing only font choosing algolithm from using fontconfig to using Mac APIs, right?

comment:15 Changed 3 years ago by nkoriyama

@busy I downloaded sample.srt, but what file encoding?
Any of my editor cannot detect the file encoding...
I attached the two pictures of playing with Arabic subtitles, using UTF-8 encoding file.
But I cannot detect file encoding of your srt file. Can you re-attach not plain file, but zipped file?

Last edited 3 years ago by nkoriyama (previous) (diff)

Changed 3 years ago by busy

comment:16 in reply to: ↑ 13 ; follow-up: Changed 3 years ago by busy

Replying to nkoriyama:

How to choose quartztext renderer:
preferences->all->video->subtitles/osd -> change text rendering module Default to CoreText? font renderer

Your way is working the good font came back.

If you choose quartztext renderer, maybe you can use Arial Black.(!!!!BUT I DO NOT TESTED!!!!).

I tried, it's working.

comment:17 in reply to: ↑ 16 Changed 3 years ago by nkoriyama

Replying to busy:

Replying to nkoriyama:

How to choose quartztext renderer:
preferences->all->video->subtitles/osd -> change text rendering module Default to CoreText? font renderer

Your way is working the good font came back.

Oh, that's good to hear but ...

If you choose quartztext renderer, maybe you can use Arial Black.(!!!!BUT I DO NOT TESTED!!!!).

I tried, it's working.

And please attach zipped srt file please.

comment:18 follow-up: Changed 3 years ago by busy

I attached rar file, is it must be zip ?

comment:19 in reply to: ↑ 18 Changed 3 years ago by nkoriyama

Replying to busy:

I attached rar file, is it must be zip ?

That's enough. Plain text may be converted forcely, so I wanted some type of archives. And Do you know what encoding this file? (UTF-8? ISO-8859-6? Windows-1256? or something else?)

comment:20 Changed 3 years ago by busy

I think It's Windows-1256 because, when I select Windows-1256 it work correctly.

I am wondering in which country you are ?

comment:21 Changed 3 years ago by nkoriyama

I am Japanese. And I can see your subtitle with encoding Windows-1256/ISO-8859-6.

I want to ask once more, if you use freetype (default) and choose Arial(not Arial Black), you can see the Subtitle but a little bad? or see all the squares? I use freetype and I can see your subtitles (encoding windows-1256/ISO-8859-6 font:Arial), like as attachment:macvlc_arabic_arialq.png.

comment:22 Changed 3 years ago by nkoriyama

If you can, please upload screenshot when you use freetype with Arial, and when you use quartztext with Arial Black.
But I'm Japanese, so I may not judge which is better :-)

comment:23 follow-up: Changed 3 years ago by busy

I can see the subtitle but a little bad with squares in every sentence.

comment:24 in reply to: ↑ 23 Changed 3 years ago by nkoriyama

Replying to busy:

I can see the subtitle but a little bad with squares in every sentence.

With Arial? Can you upload this image (screenshot)?

comment:25 Changed 3 years ago by nkoriyama

Oh, I can confirm the squares.
I use 30sec movie to test and it first appears about 00:20.Before this, it seems good.
But to tell the truth, I can properly open the srt file because none of my editor (vim and OS X's text edit, Windows note pad) cannot handle the encoding... (If this file's encoding is UTF-8, all of my editor can handle it...) And I don't know Arabic at all so I cannot understand... I'm sorry.

Changed 3 years ago by busy

Changed 3 years ago by busy

comment:26 Changed 3 years ago by nkoriyama

On windwos also using freetype, the same glitch also appears at 00:20, so freetype may have a problem handling the Arabic text. And quartztext has no problem.

Last edited 3 years ago by nkoriyama (previous) (diff)

Changed 3 years ago by nkoriyama

comment:27 Changed 3 years ago by nkoriyama

@busy Thank you for feed back. I greatly appreciate your kindness.

comment:28 Changed 3 years ago by busy

aregato, taskatta

comment:29 Changed 3 years ago by busy

;)

Changed 3 years ago by nkoriyama

Changed 3 years ago by nkoriyama

comment:30 Changed 3 years ago by edwardw

  • Component changed from Unknown to Subtitles
  • Platform(s) changed from all to MacOS
  • Version changed from master git to 2.0.0

comment:31 Changed 3 years ago by jb

See #6450

comment:32 Changed 3 years ago by jb

  • Milestone changed from Bugs paradize to 2.0.x maintenance bugs
  • Platform(s) changed from MacOS to all
  • Summary changed from Arabic subtitle doesn't work vlc 2.00 mac to Arabic subtitle doesn't work vlc 2.0.0

comment:33 Changed 3 years ago by jb

Did we find the issue, in the end?

comment:34 Changed 3 years ago by nkoriyama

Unfortunately I cannot read Arabic, so hard to understand where is bad (freetype module or freetype library or FriBidi? library). But, obviously, some bugs still exist when using Arabic subtitles. In the screenshots of freetype, unnecessary squares are shown, and no square in the screenshots of quartztext.

comment:35 Changed 2 years ago by jb

  • Owner changed from jb to fkhuene
  • Platform(s) changed from all to MacOS

Are we using the same font here?

comment:36 Changed 2 years ago by fkuehne

  • Milestone changed from 2.0.x maintenance bugs to 2.1 bugs
  • Owner changed from fkhuene to fkuehne

Yes, the issue is that CoreText? supports character replacement, in case it is missing in a font, while freetype does not. Considering that the CoreText? module matured quite a bit in the mean time, we might want to consider to enable it by default in VLC 2.1, so this issue is fixed as well as similar issues with non-Western locales.

comment:37 Changed 2 years ago by fkuehne

  • Milestone changed from 2.1 bugs to Features paradize

I investigated this further in the mean time and the Quartztext module lacks a lot of functionality compared to the freetype one. We will have to expand it in the future for other reasons, but for now, I lack the time to do so. Thus, to play those subtitles, you'll have to manually switch to the Quartztext module.

comment:38 Changed 20 months ago by jb

  • Milestone changed from Features paradize to Bugs paradize

comment:39 Changed 5 months ago by sal-sh

I have investigated the issue. The offending character that causes the squares is U+FEFF (ZERO WIDTH NO-BREAK SPACE), and it seems to always precede some Arabic ligature glyphs. It is handled correctly only by a couple of fonts on my system. Ignoring this character fixes the problem for me on both Windows 7 and Ubuntu for all Arabic fonts.

I have submitted a patch for it https://patches.videolan.org/patch/6677/

comment:40 Changed 5 months ago by salshaaban@…

  • Resolution set to fixed
  • Status changed from new to closed

commit 9be4f7e0b5e289015f64508c8321d84c6abecd04 Author: Salah-Eddin Shaban <salshaaban@…> Date: Mon Jan 5 14:52:33 2015 +0000

freetype: fix extra squares in Arabic subtitles (fixes #6152 #8117)

Signed-off-by: Jean-Baptiste Kempf <jb@…>

comment:41 Changed 5 months ago by jb

  • Milestone changed from Bugs paradize to 3.0.0 release
Note: See TracTickets for help on using tickets.