Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Steve Lhomme
VLC
Commits
89ecd70e
Commit
89ecd70e
authored
Mar 09, 2005
by
sigmunau
Browse files
all: correctly align multiline strings when not left-aligned
parent
63ebc6fa
Changes
3
Hide whitespace changes
Inline
Side-by-side
include/vlc_video.h
View file @
89ecd70e
...
...
@@ -199,8 +199,6 @@ struct picture_heap_t
*/
struct
subpicture_region_t
{
/** \name Region properties */
/**@{*/
video_format_t
fmt
;
/**< format of the picture */
picture_t
picture
;
/**< picture comprising this region */
...
...
@@ -211,10 +209,10 @@ struct subpicture_region_t
int
i_text_color
;
/**< text color (RGB native endianess) */
int
i_text_alpha
;
/**< text transparency */
int
i_text_size
;
/**< text size */
int
i_text_align
;
/**< horizontal alignment hint for */
subpicture_region_t
*
p_next
;
/**< next region in the list */
subpicture_region_t
*
p_cache
;
/**< modified version of this region */
/**@}*/
};
/**
...
...
modules/misc/freetype.c
View file @
89ecd70e
...
...
@@ -358,20 +358,32 @@ static int Render( filter_t *p_filter, subpicture_region_t *p_region,
for
(
;
p_line
!=
NULL
;
p_line
=
p_line
->
p_next
)
{
int
i_glyph_tmax
=
0
;
int
i_bitmap_offset
,
i_offset
;
int
i_bitmap_offset
,
i_offset
,
i_align_offset
=
0
;
for
(
i
=
0
;
p_line
->
pp_glyphs
[
i
]
!=
NULL
;
i
++
)
{
FT_BitmapGlyph
p_glyph
=
p_line
->
pp_glyphs
[
i
];
i_glyph_tmax
=
__MAX
(
i_glyph_tmax
,
p_glyph
->
top
);
}
if
(
p_line
->
i_width
<
i_width
)
{
if
(
p_region
->
i_text_align
==
SUBPICTURE_ALIGN_RIGHT
)
{
i_align_offset
=
i_width
-
p_line
->
i_width
;
}
else
if
(
p_region
->
i_text_align
!=
SUBPICTURE_ALIGN_LEFT
)
{
i_align_offset
=
(
i_width
-
p_line
->
i_width
)
/
2
;
}
}
for
(
i
=
0
;
p_line
->
pp_glyphs
[
i
]
!=
NULL
;
i
++
)
{
FT_BitmapGlyph
p_glyph
=
p_line
->
pp_glyphs
[
i
];
i_offset
=
(
p_line
->
p_glyph_pos
[
i
].
y
+
i_glyph_tmax
-
p_glyph
->
top
+
1
)
*
i_pitch
+
p_line
->
p_glyph_pos
[
i
].
x
+
p_glyph
->
left
+
1
;
i_pitch
+
p_line
->
p_glyph_pos
[
i
].
x
+
p_glyph
->
left
+
1
+
i_align_offset
;
for
(
y
=
0
,
i_bitmap_offset
=
0
;
y
<
p_glyph
->
bitmap
.
rows
;
y
++
)
{
...
...
@@ -399,7 +411,8 @@ static int Render( filter_t *p_filter, subpicture_region_t *p_region,
i_offset
=
(
p_line
->
p_glyph_pos
[
i
].
y
+
i_glyph_tmax
-
p_glyph
->
top
+
1
)
*
i_pitch
+
p_line
->
p_glyph_pos
[
i
].
x
+
p_glyph
->
left
+
1
;
i_pitch
+
p_line
->
p_glyph_pos
[
i
].
x
+
p_glyph
->
left
+
1
+
i_align_offset
;
for
(
y
=
0
,
i_bitmap_offset
=
0
;
y
<
p_glyph
->
bitmap
.
rows
;
y
++
)
{
...
...
src/video_output/vout_subpictures.c
View file @
89ecd70e
...
...
@@ -589,6 +589,7 @@ void spu_RenderSubpictures( spu_t *p_spu, video_format_t *p_fmt,
if
(
p_spu
->
p_text
&&
p_spu
->
p_text
->
p_module
&&
p_spu
->
p_text
->
pf_render_text
)
{
p_region
->
i_text_align
=
p_subpic
->
i_flags
&
0x3
;
p_spu
->
p_text
->
pf_render_text
(
p_spu
->
p_text
,
p_region
,
p_region
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment