[Android] Add bold subtitles option

Geoffrey Métais git at videolan.org
Tue Sep 5 12:50:25 CEST 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Sep  5 11:45:30 2017 +0200| [7c47d44db61646ee9f20d08efd666cd91b44f8a6] | committer: Geoffrey Métais

Add bold subtitles option

> https://code.videolan.org/videolan/vlc-android/commit/7c47d44db61646ee9f20d08efd666cd91b44f8a6
---

 vlc-android/res/values/strings.xml                                    | 1 +
 vlc-android/res/xml/preferences_subtitles.xml                         | 4 ++++
 .../src/org/videolan/vlc/gui/preferences/PreferencesSubtitles.java    | 1 +
 .../src/org/videolan/vlc/gui/tv/preferences/PreferencesSubtitles.java | 1 +
 vlc-android/src/org/videolan/vlc/util/VLCOptions.java                 | 3 +++
 5 files changed, 10 insertions(+)

diff --git a/vlc-android/res/values/strings.xml b/vlc-android/res/values/strings.xml
index 65c3783b2..06cf5444c 100644
--- a/vlc-android/res/values/strings.xml
+++ b/vlc-android/res/values/strings.xml
@@ -337,6 +337,7 @@
     <string name="subtitles_color_yellow">Yellow</string>
     <string name="subtitles_color_green">Green</string>
     <string name="subtitles_background_title">Subtitles Background</string>
+    <string name="subtitles_bold_title">Bold subtitles</string>
 
     <string name="audio_prefs_category">Audio</string>
     <string name="lockscreen_cover_title">Media cover on Lockscreen</string>
diff --git a/vlc-android/res/xml/preferences_subtitles.xml b/vlc-android/res/xml/preferences_subtitles.xml
index 716ca8922..222776180 100644
--- a/vlc-android/res/xml/preferences_subtitles.xml
+++ b/vlc-android/res/xml/preferences_subtitles.xml
@@ -22,6 +22,10 @@
         android:defaultValue="false"
         android:key="subtitles_background"
         android:title="@string/subtitles_background_title" />
+    <CheckBoxPreference
+        android:defaultValue="false"
+        android:key="subtitles_bold"
+        android:title="@string/subtitles_bold_title" />
     <android.support.v14.preference.MultiSelectListPreference
         android:dialogTitle="@string/preferences_languages_download"
         android:entries="@array/language_entries"
diff --git a/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesSubtitles.java b/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesSubtitles.java
index c5a357c57..88af78ca6 100644
--- a/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesSubtitles.java
+++ b/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesSubtitles.java
@@ -57,6 +57,7 @@ public class PreferencesSubtitles extends BasePreferenceFragment implements Shar
     public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
         switch (key){
             case "subtitles_size":
+            case "subtitles_bold":
             case "subtitles_color":
             case "subtitles_background":
             case "subtitle_text_encoding":
diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/preferences/PreferencesSubtitles.java b/vlc-android/src/org/videolan/vlc/gui/tv/preferences/PreferencesSubtitles.java
index d79e36fcd..d94719f78 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/preferences/PreferencesSubtitles.java
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/preferences/PreferencesSubtitles.java
@@ -61,6 +61,7 @@ public class PreferencesSubtitles extends BasePreferenceFragment implements Shar
     public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
         switch (key){
             case "subtitles_size":
+            case "subtitles_bold":
             case "subtitles_color":
             case "subtitles_background":
             case "subtitle_text_encoding":
diff --git a/vlc-android/src/org/videolan/vlc/util/VLCOptions.java b/vlc-android/src/org/videolan/vlc/util/VLCOptions.java
index 2106ab452..47c857ec0 100644
--- a/vlc-android/src/org/videolan/vlc/util/VLCOptions.java
+++ b/vlc-android/src/org/videolan/vlc/util/VLCOptions.java
@@ -78,6 +78,7 @@ public class VLCOptions {
             networkCaching = 0;
 
         final String freetypeRelFontsize = pref.getString("subtitles_size", "16");
+        final boolean freetypeBold = pref.getBoolean("subtitles_bold", false);
         final String freetypeColor = pref.getString("subtitles_color", "16777215");
         final boolean freetypeBackground = pref.getBoolean("subtitles_background", false);
         final int opengl = Integer.parseInt(pref.getString("opengl", "-1"));
@@ -102,6 +103,8 @@ public class VLCOptions {
         options.add(getResampler());
 
         options.add("--freetype-rel-fontsize=" + freetypeRelFontsize);
+        if (freetypeBold)
+            options.add("--freetype-bold");
         options.add("--freetype-color=" + freetypeColor);
         if (freetypeBackground)
             options.add("--freetype-background-opacity=128");



More information about the Android mailing list