]> granicus.if.org Git - handbrake/commitdiff
decccsub608: make font size independent on the amount of cropping
authorjstebbins <jstebbins.hb@gmail.com>
Fri, 10 Apr 2015 16:12:40 +0000 (16:12 +0000)
committerjstebbins <jstebbins.hb@gmail.com>
Fri, 10 Apr 2015 16:12:40 +0000 (16:12 +0000)
And use alignment tag \an1 instead of \a1

git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7077 b64f7644-9d1e-0410-96f1-a4d463321fa5

libhb/deccc608sub.c
libhb/rendersub.c

index 77c677359b15b786bfdb16ddde963e01cf1b29c8..dacb064ee4a09d9dd4d9a76b92557189cdf52ced 100644 (file)
@@ -880,7 +880,7 @@ static int write_cc_buffer_as_ssa(struct eia608_screen *data,
         // then width of screen is 42 columns (see CEA-708)
         screen_columns = 42;
     }
-    font_size = cropped_height * .066;
+    font_size = wb->height * .8 * .066;
 
     safe_x = 0.1 * wb->width;
     safe_y = 0.1 * wb->height;
@@ -910,7 +910,7 @@ static int write_cc_buffer_as_ssa(struct eia608_screen *data,
         x = cropped_width - columns * cell_width - min_safe_x;
     if (x < min_safe_x)
         x = min_safe_x;
-    pos = hb_strdup_printf("{\\a1\\pos(%d,%d)}", x, y);
+    pos = hb_strdup_printf("{\\an1\\pos(%d,%d)}", x, y);
 
     int line = 1;
     for (i = 0; i < 15; i++)
@@ -1808,9 +1808,9 @@ static int decccInit( hb_work_object_t * w, hb_job_t * job )
         // Generate generic SSA Script Info.
         int height = job->title->geometry.height - job->crop[0] - job->crop[1];
         int width = job->title->geometry.width - job->crop[2] - job->crop[3];
-        int safe_height = 0.8 * height;
+        int safe_height = 0.8 * job->title->geometry.height;
         hb_subtitle_add_ssa_header(w->subtitle, "Courier New",
-                                   .08 * safe_height, width, height);
+                                   .066 * safe_height, width, height);
     }
     // When rendering subs, we need to push rollup subtitles out
     // asap (instead of waiting for a completed line) so that we
index 1ea4c764804f4b18d212baa7905e69daadb70c00..6c1a6339b5ff329da1487451b5818baf4a1240f4 100644 (file)
@@ -596,10 +596,10 @@ static int cc608sub_post_init( hb_filter_object_t * filter, hb_job_t * job )
     // to have the header rewritten with the correct dimensions.
     int height = job->title->geometry.height - job->crop[0] - job->crop[1];
     int width = job->title->geometry.width - job->crop[2] - job->crop[3];
-    int safe_height = 0.8 * height;
+    int safe_height = 0.8 * job->title->geometry.height;
     // Use fixed widht font for CC
     hb_subtitle_add_ssa_header(filter->subtitle, "Courier New",
-                               .08 * safe_height, width, height);
+                               .066 * safe_height, width, height);
     return ssa_post_init(filter, job);
 }