X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fplugins%2Ftitler%2Ftitler.C;h=d96803425779e3f648925dffe7947c9d30ed5256;hb=c9bbecdcb49b2dc8fdefd017104fd4d052edb8a3;hp=dde50aa37bc9a0b7c98f572d31891a831d69059d;hpb=3badd817d6f012b5e882940db0c5d7e61cec15d7;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/plugins/titler/titler.C b/cinelerra-5.1/plugins/titler/titler.C index dde50aa3..d9680342 100644 --- a/cinelerra-5.1/plugins/titler/titler.C +++ b/cinelerra-5.1/plugins/titler/titler.C @@ -91,7 +91,7 @@ TitleConfig::TitleConfig() outline_color = WHITE; outline_alpha = 0xff; color_stroke = 0xff0000; - stroke_width = 1.0; + stroke_width = 0.0; motion_strategy = NO_MOTION; line_pitch = 0; loop = 0; @@ -1188,7 +1188,7 @@ void TitleMain::build_previews(TitleWindow *gui) for( int i=0; idisplayname, font->displayname) ) { if( pass == 1 ) { - font->image = fonts[i]->image; + font->image = new VFrame(*fonts[i]->image); } skip = 1; break; @@ -2329,7 +2329,8 @@ void TitleMain::draw_overlay() if( !translate ) translate = new TitleTranslate(this, cpus); - if( text_x+mask_w > 0 && text_x < title_w ) { + int tx = text_x - text_x1 + mask_x1; + if( tx < title_w && tx+mask_w > 0 ) { translate->xlat_mask = text_mask; translate->run_packages(); if( config.stroke_width >= SMALL && (config.style & BC_FONT_OUTLINE) ) { @@ -2604,11 +2605,19 @@ void TitleMain::save_data(KeyFrame *keyframe) output.tag.set_property("LOOP_PLAYBACK", config.loop_playback); output.append_tag(); output.append_newline(); - char text[BCTEXTLEN]; + char text[2*sizeof(config.wtext)]; int text_len = BC_Resources::encode( BC_Resources::wide_encoding, DEFAULT_ENCODING, (char*)config.wtext, config.wlen*sizeof(wchar_t), text, sizeof(text)); + int len = output.length(), avail = MESSAGESIZE-16 - len; + if( text_len >= avail ) { // back off last utf8 char + text_len = avail; + while( text_len > 0 && (text[text_len-1] & 0xc0) == 0x80 ) + text[--text_len] = 0; + if( text_len > 0 ) + text[--text_len] = 0; + } output.append_text(text, text_len); output.tag.set_title("/TITLE"); output.append_tag();