Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
d2c52a32
Commit
d2c52a32
authored
Jul 20, 2003
by
Olivier Teulière
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* modules/misc/freetype.c: compilation fix for windows
parent
e9e2c245
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
117 additions
and
117 deletions
+117
-117
modules/misc/freetype.c
modules/misc/freetype.c
+117
-117
No files found.
modules/misc/freetype.c
View file @
d2c52a32
...
...
@@ -2,7 +2,7 @@
* freetype.c : Put text on the video, using freetype2
*****************************************************************************
* Copyright (C) 2002, 2003 VideoLAN
* $Id: freetype.c,v 1.
4 2003/07/20 16:26:33 sigmunau
Exp $
* $Id: freetype.c,v 1.
5 2003/07/20 16:56:58 ipkiss
Exp $
*
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
*
...
...
@@ -36,8 +36,6 @@
#include FT_FREETYPE_H
#include FT_GLYPH_H
#define FT_RENDER_MODE_NORMAL 0
/* Why do we have to do that ? */
/*****************************************************************************
* Local prototypes
*****************************************************************************/
...
...
@@ -161,7 +159,7 @@ static int Create( vlc_object_t *p_this )
return
VLC_EGENERIC
;
}
i_error
=
FT_Select_Charmap
(
p_vout
->
p_text_renderer_data
->
p_face
,
FT_ENCODING_UNICODE
);
ft_encoding_unicode
);
if
(
i_error
)
{
msg_Err
(
p_vout
,
"Font has no unicode translation table"
);
...
...
@@ -171,7 +169,8 @@ static int Create( vlc_object_t *p_this )
return
VLC_EGENERIC
;
}
p_vout
->
p_text_renderer_data
->
i_use_kerning
=
FT_HAS_KERNING
(
p_vout
->
p_text_renderer_data
->
p_face
);
p_vout
->
p_text_renderer_data
->
i_use_kerning
=
FT_HAS_KERNING
(
p_vout
->
p_text_renderer_data
->
p_face
);
i_error
=
FT_Set_Pixel_Sizes
(
p_vout
->
p_text_renderer_data
->
p_face
,
0
,
config_GetInt
(
p_vout
,
"freetype-fontsize"
)
);
...
...
@@ -323,7 +322,7 @@ static void RenderI420( vout_thread_t *p_vout, picture_t *p_pic,
FT_BitmapGlyph
p_glyph
=
p_string
->
pp_glyphs
[
i
];
#define alpha p_vout->p_text_renderer_data->pi_gamma[ p_glyph->bitmap.buffer[ ( x + y * p_glyph->bitmap.width ) ] ]
#define pixel p_in[ ( (p_string->p_glyph_pos[ i ].y>>1) + pen_y + (y>>1) - ( p_glyph->top >> 1 ) ) * i_pitch + ( x >> 1 ) + pen_x + ( p_string->p_glyph_pos[ i ].x >> 1 ) + ( p_glyph->left >>1) ]
for
(
y
=
0
;
y
<
p_glyph
->
bitmap
.
rows
;
y
+=
2
)
for
(
y
=
0
;
y
<
p_glyph
->
bitmap
.
rows
;
y
+=
2
)
{
for
(
x
=
0
;
x
<
p_glyph
->
bitmap
.
width
;
x
+=
2
)
{
...
...
@@ -462,7 +461,7 @@ static int AddText ( vout_thread_t *p_vout, byte_t *psz_string,
}
FT_Glyph_Get_CBox
(
tmp_glyph
,
ft_glyph_bbox_pixels
,
&
glyph_size
);
i_error
=
FT_Glyph_To_Bitmap
(
&
tmp_glyph
,
FT_RENDER_MODE_NORMAL
,
ft_render_mode_normal
,
&
p_string
->
p_glyph_pos
[
i
],
1
);
if
(
i_error
)
continue
;
...
...
@@ -482,7 +481,8 @@ static int AddText ( vout_thread_t *p_vout, byte_t *psz_string,
result
.
y
+=
line
.
yMax
-
line
.
yMin
;
p_string
->
i_height
=
result
.
y
;
p_string
->
i_width
=
result
.
x
;
msg_Dbg
(
p_vout
,
"string height is %d, width is %d"
,
p_string
->
i_height
,
p_string
->
i_width
);
msg_Dbg
(
p_vout
,
"string height is %d, width is %d"
,
p_string
->
i_height
,
p_string
->
i_width
);
msg_Dbg
(
p_vout
,
"adding string
\"
%s
\"
at (%d,%d) start_date "
I64Fd
" end_date"
I64Fd
,
p_string
->
psz_text
,
p_string
->
i_x_margin
,
p_string
->
i_y_margin
,
i_start
,
i_stop
);
...
...
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