Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
200a61d9
Commit
200a61d9
authored
Jul 20, 2003
by
Gildas Bazin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* modules/misc/freetype.c: set default font on win32. Fixed small memleak as well.
parent
4da83b8c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
3 deletions
+18
-3
modules/misc/freetype.c
modules/misc/freetype.c
+18
-3
No files found.
modules/misc/freetype.c
View file @
200a61d9
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* freetype.c : Put text on the video, using freetype2
* freetype.c : Put text on the video, using freetype2
*****************************************************************************
*****************************************************************************
* Copyright (C) 2002, 2003 VideoLAN
* Copyright (C) 2002, 2003 VideoLAN
* $Id: freetype.c,v 1.
7 2003/07/20 23:05:24 sigmunau
Exp $
* $Id: freetype.c,v 1.
8 2003/07/20 23:46:46 gbazin
Exp $
*
*
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
*
*
...
@@ -136,6 +136,16 @@ static int Create( vlc_object_t *p_this )
...
@@ -136,6 +136,16 @@ static int Create( vlc_object_t *p_this )
/* Look what method was requested */
/* Look what method was requested */
psz_fontfile
=
config_GetPsz
(
p_vout
,
"freetype-font"
);
psz_fontfile
=
config_GetPsz
(
p_vout
,
"freetype-font"
);
#ifdef WIN32
if
(
!
psz_fontfile
||
!*
psz_fontfile
)
{
if
(
psz_fontfile
)
free
(
psz_fontfile
);
psz_fontfile
=
(
char
*
)
malloc
(
MAX_PATH
+
1
);
GetWindowsDirectory
(
psz_fontfile
,
MAX_PATH
+
1
);
strcat
(
psz_fontfile
,
"
\\
fonts
\\
arial.ttf"
);
}
#endif
i_error
=
FT_Init_FreeType
(
&
p_vout
->
p_text_renderer_data
->
p_library
);
i_error
=
FT_Init_FreeType
(
&
p_vout
->
p_text_renderer_data
->
p_library
);
if
(
i_error
)
if
(
i_error
)
{
{
...
@@ -143,23 +153,28 @@ static int Create( vlc_object_t *p_this )
...
@@ -143,23 +153,28 @@ static int Create( vlc_object_t *p_this )
free
(
p_vout
->
p_text_renderer_data
);
free
(
p_vout
->
p_text_renderer_data
);
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
i_error
=
FT_New_Face
(
p_vout
->
p_text_renderer_data
->
p_library
,
i_error
=
FT_New_Face
(
p_vout
->
p_text_renderer_data
->
p_library
,
psz_fontfile
,
0
,
psz_fontfile
?
psz_fontfile
:
""
,
0
,
&
p_vout
->
p_text_renderer_data
->
p_face
);
&
p_vout
->
p_text_renderer_data
->
p_face
);
if
(
i_error
==
FT_Err_Unknown_File_Format
)
if
(
i_error
==
FT_Err_Unknown_File_Format
)
{
{
msg_Err
(
p_vout
,
"file %s have unknown format"
,
psz_fontfile
);
msg_Err
(
p_vout
,
"file %s have unknown format"
,
psz_fontfile
);
FT_Done_FreeType
(
p_vout
->
p_text_renderer_data
->
p_library
);
FT_Done_FreeType
(
p_vout
->
p_text_renderer_data
->
p_library
);
free
(
p_vout
->
p_text_renderer_data
);
free
(
p_vout
->
p_text_renderer_data
);
if
(
psz_fontfile
)
free
(
psz_fontfile
);
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
else
if
(
i_error
)
else
if
(
i_error
)
{
{
msg_Err
(
p_vout
,
"failed to load font file
"
);
msg_Err
(
p_vout
,
"failed to load font file
%s"
,
psz_fontfile
);
FT_Done_FreeType
(
p_vout
->
p_text_renderer_data
->
p_library
);
FT_Done_FreeType
(
p_vout
->
p_text_renderer_data
->
p_library
);
free
(
p_vout
->
p_text_renderer_data
);
free
(
p_vout
->
p_text_renderer_data
);
if
(
psz_fontfile
)
free
(
psz_fontfile
);
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
if
(
psz_fontfile
)
free
(
psz_fontfile
);
i_error
=
FT_Select_Charmap
(
p_vout
->
p_text_renderer_data
->
p_face
,
i_error
=
FT_Select_Charmap
(
p_vout
->
p_text_renderer_data
->
p_face
,
ft_encoding_unicode
);
ft_encoding_unicode
);
if
(
i_error
)
if
(
i_error
)
...
...
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