#include "bcsignals.h"
#include "clip.h"
-#include "colormodels.h"
+#include "bccmodels.h"
#include "filexml.h"
#include "filesystem.h"
#include "transportque.inc"
fade_out = 0.0;
x = 0.0;
y = 0.0;
- dropshadow = 10;
+ dropshadow = 2;
sprintf(font, "fixed");
sprintf(encoding, DEFAULT_ENCODING);
timecode_format = DEFAULT_TIMECODEFORMAT;
// this->y = prev.y;
timecode = prev.timecode;
timecode_format = prev.timecode_format;
-// this->dropshadow = (int)(prev.dropshadow * prev_scale + next.dropshadow * next_scale);
- this->dropshadow = prev.dropshadow;
+ this->dropshadow = prev.dropshadow * prev_scale + next.dropshadow * next_scale;
+// this->dropshadow = prev.dropshadow;
}
void TitleConfig::limits()
unsigned char **out_rows = output->get_rows();
int baseline = plugin->get_char_height();
- if(engine->do_dropshadow) {
+ if( engine->do_dropshadow ) {
x += plugin->config.dropshadow;
y += plugin->config.dropshadow;
}
+ else if( plugin->config.dropshadow < 0 ) {
+ x -= plugin->config.dropshadow;
+ y -= plugin->config.dropshadow;
+ }
int x_in = 0, y_in = 0;
int x_out = x + glyph->left;
-
TitleTranslatePackage::TitleTranslatePackage()
: LoadPackage()
{
-
#define TRANSLATE(type, max, components, ofs) \
{ \
unsigned char **in_rows = plugin->text_mask->get_rows(); \
delete outline_engine;
}
-const char* TitleMain::plugin_title() { return N_("Title"); }
+const char* TitleMain::plugin_title() { return _("Title"); }
int TitleMain::is_realtime() { return 1; }
int TitleMain::is_synthesis() { return 1; }
for(int j = 0; j < len; j++)
{
FT_ULong c = test_string[j];
- check_char_code_path(freetype_library,
- font_entry->path,
- c,
- (char *)new_path);
+// memory leaks here are fatal
+// check_char_code_path(freetype_library,
+// font_entry->path,
+// c,
+// (char *)new_path);
+ strcpy(new_path, font_entry->path);
if( !load_freetype_face(freetype_library,
freetype_face, new_path)) {
FT_Set_Pixel_Sizes(freetype_face, text_height, 0);
if(!FT_Load_Char(freetype_face, c, FT_LOAD_RENDER)) {
if(pass == 0) {
current_w = current_x + freetype_face->glyph->bitmap.width;
- if(freetype_face->glyph->bitmap_top > current_ascent)
+ if((int)freetype_face->glyph->bitmap_top > current_ascent)
current_ascent = freetype_face->glyph->bitmap_top;
- if(freetype_face->glyph->bitmap.rows > total_h)
+ if((int)freetype_face->glyph->bitmap.rows > total_h)
total_h = freetype_face->glyph->bitmap.rows;
- if(freetype_face->glyph->bitmap.rows > current_h)
+ if((int)freetype_face->glyph->bitmap.rows > current_h)
current_h = freetype_face->glyph->bitmap.rows;
}
else {
int out_y = (total_h - height[font_number]) / 2 +
ascent[font_number] - freetype_face->glyph->bitmap_top;
for(int in_y = 0;
- in_y < freetype_face->glyph->bitmap.rows &&
+ in_y < (int)freetype_face->glyph->bitmap.rows &&
out_y < total_h;
in_y++, out_y++) {
unsigned char *out_row = font_entry->image->get_rows()[out_y] +
unsigned char *in_row = freetype_face->glyph->bitmap.buffer +
freetype_face->glyph->bitmap.pitch * in_y;
- for(int out_x = 0; out_x < freetype_face->glyph->bitmap.width &&
+ for(int out_x = 0; out_x < (int)freetype_face->glyph->bitmap.width &&
out_x < total_w;
out_x++) {
*out_row = (*in_row * r +
{
FT_Set_Pixel_Sizes(temp_freetype_face, 128, 0);
int gindex = FT_Get_Char_Index(temp_freetype_face, char_code);
- if((!gindex == 0) && (!char_code != 10))
+ if( gindex != 0 && char_code == 10 )
{
strcpy(path_new, path_old);
notfindit = 0;
{
FT_Set_Pixel_Sizes(temp_freetype_face, 128, 0);
int gindex = FT_Get_Char_Index(temp_freetype_face, char_code);
- if((!gindex == 0) && (!char_code != 10))
+ if( gindex != 0 && char_code == 10 )
{
sprintf(path_new, "%s", tmpstring);
notfindit = 0;
extent.x1 -= config.outline_size*2;
extent.y1 -= config.outline_size*2;
- extent.x2 += config.dropshadow + config.outline_size*2;
- extent.y2 += config.dropshadow + config.outline_size*2;
+ extent.x2 += abs(config.dropshadow) + config.outline_size*2;
+ extent.y2 += abs(config.dropshadow) + config.outline_size*2;
// Determine mask geometry
mask_w = extent.x2 - extent.x1;
text_mask = new VFrame;
text_mask->set_use_shm(0);
text_mask->reallocate(0, -1, 0, 0, 0, mask_w, mask_h, color_model, -1);
- int drop = !config.dropshadow ? 0 : config.dropshadow;
+ float drop = abs(config.dropshadow);
int drop_w = mask_w + drop;
int drop_h = mask_h + drop;
text_mask_stroke = new VFrame;