+ int x = 0;
+ switch (subtitle.h_align ()) {
+ case dcp::HALIGN_LEFT:
+ /* h_position is distance between left of frame and left of subtitle */
+ x = subtitle.h_position() * target.width;
+ break;
+ case dcp::HALIGN_CENTER:
+ /* h_position is distance between centre of frame and centre of subtitle */
+ x = (0.5 + subtitle.h_position()) * target.width - layout_width / (PANGO_SCALE * 2);
+ break;
+ case dcp::HALIGN_RIGHT:
+ /* h_position is distance between right of frame and right of subtitle */
+ x = (1.0 - subtitle.h_position()) * target.width - layout_width / PANGO_SCALE;
+ break;
+ }
+