Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-1.1
Commits
89ecd70e
Commit
89ecd70e
authored
Mar 09, 2005
by
Sigmund Augdal Helberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
all: correctly align multiline strings when not left-aligned
parent
63ebc6fa
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
6 deletions
+18
-6
include/vlc_video.h
include/vlc_video.h
+1
-3
modules/misc/freetype.c
modules/misc/freetype.c
+16
-3
src/video_output/vout_subpictures.c
src/video_output/vout_subpictures.c
+1
-0
No files found.
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
Markdown
is supported
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