summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfaust3 <faust3@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-10-18 20:41:06 +0000
committerfaust3 <faust3@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-10-18 20:41:06 +0000
commit229c7f9c84f17a47ce650e36c2dc8b682e8a33bc (patch)
tree52a3955a442a82c912bda24d8d1bac4c78ea4bcc
parentd535890b50cbe4d33e89e7fb066ffff3be328b33 (diff)
downloadmpv-229c7f9c84f17a47ce650e36c2dc8b682e8a33bc.tar.bz2
mpv-229c7f9c84f17a47ce650e36c2dc8b682e8a33bc.tar.xz
correctly display the commas of most hebrew subtitles on the left side
of the sentence with fribidi, make the old behaviour optional patch by Shachar Raindel <shacharr <at> gmail.com> git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13680 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--DOCS/man/en/mplayer.15
-rw-r--r--cfg-common.h4
-rw-r--r--subreader.c3
-rw-r--r--subreader.h6
4 files changed, 17 insertions, 1 deletions
diff --git a/DOCS/man/en/mplayer.1 b/DOCS/man/en/mplayer.1
index 8eab94737e..a310566b24 100644
--- a/DOCS/man/en/mplayer.1
+++ b/DOCS/man/en/mplayer.1
@@ -1290,6 +1290,11 @@ bold black outline
Turns on flipping subtitles using FriBiDi.
.
.TP
+.B \-noflip-hebrew-commas
+Change FriBiDi's assumptions about the placements of commas in subtitles.
+Use this if commas in subtitles are shown at the start of a sentence
+instead of at the end.
+.TP
.B \-font <path\ to\ font.desc\ file> (OSD only)
Search for the OSD/\:SUB fonts in an alternative directory (default for normal
fonts: ~/\:.mplayer/\:font/\:font.desc, default for FreeType fonts:
diff --git a/cfg-common.h b/cfg-common.h
index 210ee03b24..b1718db3d3 100644
--- a/cfg-common.h
+++ b/cfg-common.h
@@ -219,10 +219,14 @@
{"fribidi-charset", &fribidi_charset, CONF_TYPE_STRING, 0, 0, 0, NULL},
{"flip-hebrew", &flip_hebrew, CONF_TYPE_FLAG, 0, 0, 1, NULL},
{"noflip-hebrew", &flip_hebrew, CONF_TYPE_FLAG, 0, 1, 0, NULL},
+ {"flip-hebrew-commas", &fribidi_flip_commas, CONF_TYPE_FLAG, 0, 1, 0, NULL},
+ {"noflip-hebrew-commas", &fribidi_flip_commas, CONF_TYPE_FLAG, 0, 0, 1, NULL},
#else
{"fribidi-charset", "MPlayer was compiled without FriBiDi support.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL},
{"flip-hebrew", "MPlayer was compiled without FriBiDi support.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL},
{"noflip-hebrew", "MPlayer was compiled without FriBiDi support.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL},
+ {"flip-hebrew-commas", "MPlayer was compiled without FriBiDi support.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL},
+ {"noflip-hebrew-commas", "MPlayer was compiled without FriBiDi support.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL},
#endif
#ifdef USE_ICONV
{"subcp", &sub_cp, CONF_TYPE_STRING, 0, 0, 0, NULL},
diff --git a/subreader.c b/subreader.c
index 0a0292d283..ad0ea9f89b 100644
--- a/subreader.c
+++ b/subreader.c
@@ -33,6 +33,7 @@ char *sub_cp=NULL;
#include <fribidi/fribidi.h>
char *fribidi_charset = NULL;
int flip_hebrew = 1;
+int fribidi_flip_commas = 0;
#endif
extern char* dvdsub_lang;
@@ -1208,7 +1209,7 @@ subtitle* sub_fribidi (subtitle *sub, int sub_utf8)
break;
}
len = fribidi_charset_to_unicode (char_set_num, ip, len, logical);
- base = FRIBIDI_TYPE_ON;
+ base = fribidi_flip_commas?FRIBIDI_TYPE_ON:FRIBIDI_TYPE_L;
log2vis = fribidi_log2vis (logical, len, &base,
/* output */
visual, NULL, NULL, NULL);
diff --git a/subreader.h b/subreader.h
index bcf9aed08b..06a9878fea 100644
--- a/subreader.h
+++ b/subreader.h
@@ -59,6 +59,12 @@ typedef struct {
int sub_errs;
} sub_data;
+#ifdef USE_FRIBIDI
+extern char *fribidi_charset;
+extern int flip_hebrew;
+extern int fribidi_flip_commas;
+#endif
+
sub_data* sub_read_file (char *filename, float pts);
subtitle* subcp_recode1 (subtitle *sub);
// enca_fd is the file enca uses to determine the codepage.