diff options
author | jstebbins <[email protected]> | 2015-04-05 20:20:28 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2015-04-05 20:20:28 +0000 |
commit | 75e81dbbaafa76dfde25343f50563aed8c7776e7 (patch) | |
tree | 0a77a01ccc250a10518505ba6df0e122e59e3cee /libhb/rendersub.c | |
parent | 52f3c7354980d3f0467c7d8db7361d6009ab7d06 (diff) |
deccc608sub: fix column alignment issues
Use a fixed width font, and insert hard spaces where necessary to allign
columns correctly in multi-line CCs.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7061 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/rendersub.c')
-rw-r--r-- | libhb/rendersub.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/libhb/rendersub.c b/libhb/rendersub.c index 960609aef..006f4f156 100644 --- a/libhb/rendersub.c +++ b/libhb/rendersub.c @@ -53,6 +53,7 @@ static void ssa_close( hb_filter_object_t * filter ); // SRT static int textsub_post_init( hb_filter_object_t * filter, hb_job_t * job ); +static int cc608sub_post_init( hb_filter_object_t * filter, hb_job_t * job ); static int textsub_work( hb_filter_object_t * filter, hb_buffer_t ** buf_in, @@ -589,13 +590,24 @@ static int ssa_work( hb_filter_object_t * filter, return HB_FILTER_OK; } +static int cc608sub_post_init( hb_filter_object_t * filter, hb_job_t * job ) +{ + // Text subtitles for which we create a dummy ASS header need + // 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]; + // Use fixed widht font for CC + hb_subtitle_add_ssa_header(filter->subtitle, "Courier New", width, height); + return ssa_post_init(filter, job); +} + static int textsub_post_init( hb_filter_object_t * filter, hb_job_t * job ) { // Text subtitles for which we create a dummy ASS header need // 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]; - hb_subtitle_add_ssa_header(filter->subtitle, width, height); + hb_subtitle_add_ssa_header(filter->subtitle, "Arial", width, height); return ssa_post_init(filter, job); } @@ -872,13 +884,17 @@ static int hb_rendersub_post_init( hb_filter_object_t * filter, hb_job_t *job ) } break; case SRTSUB: - case CC608SUB: case UTF8SUB: case TX3GSUB: { return textsub_post_init( filter, job ); } break; + case CC608SUB: + { + return cc608sub_post_init( filter, job ); + } break; + case PGSSUB: { return pgssub_post_init( filter, job ); |