mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-30 03:12:08 +00:00
avfilter/vf_drawtext: fix text width measurement
This commit is contained in:
parent
da784b81a6
commit
aeff5bcba0
@ -1757,9 +1757,17 @@ continue_on_failed2:
|
|||||||
first_min_x64 = FFMIN(glyph->bbox.xMin, first_min_x64);
|
first_min_x64 = FFMIN(glyph->bbox.xMin, first_min_x64);
|
||||||
}
|
}
|
||||||
if (t == hb->glyph_count - 1) {
|
if (t == hb->glyph_count - 1) {
|
||||||
w64 += glyph->bbox.xMax;
|
// The following code measures the width of the line up to the last
|
||||||
last_max_x64 = FFMAX(glyph->bbox.xMax, last_max_x64);
|
// character's horizontal advance
|
||||||
cur_line->offset_right64 = glyph->bbox.xMax;
|
int last_char_width = hb->glyph_pos[t].x_advance;
|
||||||
|
|
||||||
|
// The following code measures the width of the line up to the rightmost
|
||||||
|
// visible pixel of the last character
|
||||||
|
// int last_char_width = glyph->bbox.xMax;
|
||||||
|
|
||||||
|
w64 += last_char_width;
|
||||||
|
last_max_x64 = FFMAX(last_char_width, last_max_x64);
|
||||||
|
cur_line->offset_right64 = last_char_width;
|
||||||
} else {
|
} else {
|
||||||
if (is_tab) {
|
if (is_tab) {
|
||||||
int size = s->blank_advance64 * s->tabsize;
|
int size = s->blank_advance64 * s->tabsize;
|
||||||
|
Loading…
Reference in New Issue
Block a user