A single line of subtitle text with all the associated attributes.
More...
#include <text_string.h>
|
| TextString (boost::optional< std::string > font, bool italic, bool bold, bool underline, Colour colour, int size, float aspect_adjust, Time in, Time out, float h_position, HAlign h_align, float v_position, VAlign v_align, float z_position, Direction direction, std::string text, Effect effect, Colour effect_colour, Time fade_up_time, Time fade_down_time, float space_before, std::vector< Ruby > rubies) |
|
boost::optional< std::string > | font () const |
|
bool | italic () const |
|
bool | bold () const |
|
bool | underline () const |
|
Colour | colour () const |
|
std::string | text () const |
|
Direction | direction () const |
|
Effect | effect () const |
|
Colour | effect_colour () const |
|
int | size () const |
|
float | size_in_pixels (int screen_height) const |
|
float | space_before () const |
|
float | aspect_adjust () const |
|
std::vector< Ruby > const & | rubies () const |
|
void | set_font (std::string id) |
|
void | unset_font () |
|
void | set_size (int s) |
|
void | set_aspect_adjust (float a) |
|
void | set_text (std::string t) |
|
void | set_colour (Colour c) |
|
void | set_effect (Effect e) |
|
void | set_effect_colour (Colour c) |
|
void | set_rubies (std::vector< Ruby > rubies) |
|
bool | equals (std::shared_ptr< const dcp::Text > other_sub, EqualityOptions const &options, NoteHandler node) const override |
|
Time | in () const |
|
Time | out () const |
|
float | h_position () const |
|
HAlign | h_align () const |
|
float | v_position () const |
|
VAlign | v_align () const |
|
float | z_position () const |
|
Time | fade_up_time () const |
|
Time | fade_down_time () const |
|
void | set_in (Time i) |
|
void | set_out (Time o) |
|
void | set_h_position (float p) |
|
void | set_v_position (float p) |
|
void | set_z_position (float z) |
|
void | set_fade_up_time (Time t) |
|
void | set_fade_down_time (Time t) |
|
A single line of subtitle text with all the associated attributes.
Definition at line 57 of file text_string.h.
◆ TextString()
TextString::TextString |
( |
boost::optional< std::string > |
font, |
|
|
bool |
italic, |
|
|
bool |
bold, |
|
|
bool |
underline, |
|
|
Colour |
colour, |
|
|
int |
size, |
|
|
float |
aspect_adjust, |
|
|
Time |
in, |
|
|
Time |
out, |
|
|
float |
h_position, |
|
|
HAlign |
h_align, |
|
|
float |
v_position, |
|
|
VAlign |
v_align, |
|
|
float |
z_position, |
|
|
Direction |
direction, |
|
|
std::string |
text, |
|
|
Effect |
effect, |
|
|
Colour |
effect_colour, |
|
|
Time |
fade_up_time, |
|
|
Time |
fade_down_time, |
|
|
float |
space_before, |
|
|
std::vector< Ruby > |
rubies |
|
) |
| |
- Parameters
-
font | Font ID, or empty to use the default |
italic | true for italic text |
bold | true for bold text |
underline | true for underlined text |
colour | Colour of the text |
size | Size in points as if the screen height is 11 inches, so a 72pt font would be 1/11th of the screen height |
aspect_adjust | greater than 1 to stretch text to be wider, less than 1 to shrink text to be narrower (must be between 0.25 and 4) |
in | start time |
out | finish time |
h_position | Horizontal position as a fraction of the screen width (between 0 and 1) from h_align |
h_align | Horizontal alignment point |
v_position | Vertical position as a fraction of the screen height (between 0 and 1) from v_align |
v_align | Vertical alignment point |
z_position | Z position as a proportion of the primary picture width between -1 and +1; +ve moves the image away from the viewer, -ve moves it toward the viewer, 0 is in the plane of the screen. |
direction | Direction of text |
text | The text to display |
effect | Effect to use |
effect_colour | Colour of the effect |
fade_up_time | Time to fade the text in |
fade_down_time | Time to fade the text out |
space_before | Space to add before this string, in ems (could be negative to remove space). |
Definition at line 57 of file text_string.cc.
◆ aspect_adjust()
float dcp::TextString::aspect_adjust |
( |
| ) |
const |
|
inline |
- Returns
- Aspect ratio ‘adjustment’ of the font size. Values greater than 1 widen each character, values less than 1 narrow each character, and the value must be between 0.25 and 4.
Definition at line 159 of file text_string.h.
◆ font()
boost::optional<std::string> dcp::TextString::font |
( |
| ) |
const |
|
inline |
◆ _bold
bool dcp::TextString::_bold |
|
private |
true if the weight is bold, false for normal
Definition at line 211 of file text_string.h.
◆ _colour
Colour dcp::TextString::_colour |
|
private |
◆ _font
boost::optional<std::string> dcp::TextString::_font |
|
private |
◆ _italic
bool dcp::TextString::_italic |
|
private |
◆ _size
int dcp::TextString::_size |
|
private |
Size in points as if the screen height is 11 inches, so a 72pt font would be 1/11th of the screen height.
Definition at line 219 of file text_string.h.
◆ _underline
bool dcp::TextString::_underline |
|
private |
true to enable underlining, false otherwise
Definition at line 213 of file text_string.h.
The documentation for this class was generated from the following files: