/* h_position is distance between left of frame and left of subtitle */
x = first.h_position() * target_width;
break;
/* h_position is distance between left of frame and left of subtitle */
x = first.h_position() * target_width;
break;
/* h_position is distance between centre of frame and centre of subtitle */
x = (0.5 + first.h_position()) * target_width - layout_width / 2;
break;
/* h_position is distance between centre of frame and centre of subtitle */
x = (0.5 + first.h_position()) * target_width - layout_width / 2;
break;
/* h_position is distance between right of frame and right of subtitle */
x = (1.0 - first.h_position()) * target_width - layout_width;
break;
/* h_position is distance between right of frame and right of subtitle */
x = (1.0 - first.h_position()) * target_width - layout_width;
break;
/* SMPTE says that v_position is the distance between top
of frame and top of subtitle, but this doesn't always seem to be
the case in practice; Gunnar Ásgeirsson's Dolby server appears
/* SMPTE says that v_position is the distance between top
of frame and top of subtitle, but this doesn't always seem to be
the case in practice; Gunnar Ásgeirsson's Dolby server appears
/* v_position is distance between centre of frame and centre of subtitle */
y = (0.5 + first.v_position()) * target_height - layout_height / 2;
break;
/* v_position is distance between centre of frame and centre of subtitle */
y = (0.5 + first.v_position()) * target_height - layout_height / 2;
break;
/* v_position is distance between bottom of frame and bottom of subtitle */
y = (1.0 - first.v_position()) * target_height - layout_height;
break;
/* v_position is distance between bottom of frame and bottom of subtitle */
y = (1.0 - first.v_position()) * target_height - layout_height;
break;
Glib::RefPtr<Pango::FontMap> font_map = Glib::wrap (c_font_map);
PangoContext* c_context = pango_font_map_create_context (c_font_map);
Glib::RefPtr<Pango::FontMap> font_map = Glib::wrap (c_font_map);
PangoContext* c_context = pango_font_map_create_context (c_font_map);
Glib::RefPtr<Pango::Context> context = Glib::wrap (c_context);
return Pango::Layout::create (context);
}
Glib::RefPtr<Pango::Context> context = Glib::wrap (c_context);
return Pango::Layout::create (context);
}
context->scale (x_scale, y_scale);
layout->update_from_cairo_context (context);
context->scale (x_scale, y_scale);
layout->update_from_cairo_context (context);
/* Drop-shadow effect */
set_source_rgba (context, first.effect_colour(), fade_factor);
context->move_to (x_offset + 4, y_offset + 4);
/* Drop-shadow effect */
set_source_rgba (context, first.effect_colour(), fade_factor);
context->move_to (x_offset + 4, y_offset + 4);
/* Border effect */
set_source_rgba (context, first.effect_colour(), fade_factor);
context->set_line_width (border_width);
/* Border effect */
set_source_rgba (context, first.effect_colour(), fade_factor);
context->set_line_width (border_width);
if (!pending.empty() && (i.v_align() != pending.back().v_align() || fabs(i.v_position() - pending.back().v_position()) > 1e-4)) {
images.push_back (render_line (pending, fonts, target, time, frame_rate));
pending.clear ();
if (!pending.empty() && (i.v_align() != pending.back().v_align() || fabs(i.v_position() - pending.back().v_position()) > 1e-4)) {
images.push_back (render_line (pending, fonts, target, time, frame_rate));
pending.clear ();