Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
b12d4270
Commit
b12d4270
authored
Nov 26, 2011
by
KO Myung-Hun
Committed by
Jean-Baptiste Kempf
Nov 26, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add OS/2 support to freetype module
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
ce5c0949
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
12 deletions
+27
-12
modules/text_renderer/freetype.c
modules/text_renderer/freetype.c
+27
-12
No files found.
modules/text_renderer/freetype.c
View file @
b12d4270
...
...
@@ -51,6 +51,9 @@
#elif defined( WIN32 )
# define DEFAULT_FONT_FILE "arial.ttf"
/* Default path font found at run-time */
# define DEFAULT_FAMILY "Arial"
#elif defined( __OS2__ )
# define DEFAULT_FONT_FILE "/psfonts/tnrwt_k.ttf"
# define DEFAULT_FAMILY "Times New Roman WT K"
#elif defined( HAVE_MAEMO )
# define DEFAULT_FONT_FILE "/usr/share/fonts/nokia/nosnb.ttf"
# define DEFAULT_FAMILY "Nokia Sans Bold"
...
...
@@ -92,6 +95,18 @@
#include <assert.h>
#ifdef __OS2__
typedef
uint16_t
uni_char_t
;
# define FREETYPE_TO_UCS "UCS-2LE"
#else
typedef
uint32_t
uni_char_t
;
# if defined(WORDS_BIGENDIAN)
# define FREETYPE_TO_UCS "UCS-4BE"
# else
# define FREETYPE_TO_UCS "UCS-4LE"
# endif
#endif
/*****************************************************************************
* Module descriptor
*****************************************************************************/
...
...
@@ -434,6 +449,10 @@ static void FontConfig_BuildCache( filter_t *p_filter )
mtime_t
t1
,
t2
;
t1
=
mdate
();
#ifdef __OS2__
FcInit
();
#endif
#if defined( WIN32 ) || defined( __APPLE__ )
dialog_progress_bar_t
*
p_dialog
=
NULL
;
FcConfig
*
fcConfig
=
FcInitLoadConfig
();
...
...
@@ -1422,7 +1441,7 @@ static text_style_t *GetStyleFromFontStack( filter_sys_t *p_sys,
}
static
unsigned
SetupText
(
filter_t
*
p_filter
,
u
int32
_t
*
psz_text_out
,
u
ni_char
_t
*
psz_text_out
,
text_style_t
**
pp_styles
,
uint32_t
*
pi_k_dates
,
...
...
@@ -1433,15 +1452,11 @@ static unsigned SetupText( filter_t *p_filter,
size_t
i_string_length
;
size_t
i_string_bytes
;
#if defined(WORDS_BIGENDIAN)
uint32_t
*
psz_tmp
=
ToCharset
(
"UCS-4BE"
,
psz_text_in
,
&
i_string_bytes
);
#else
uint32_t
*
psz_tmp
=
ToCharset
(
"UCS-4LE"
,
psz_text_in
,
&
i_string_bytes
);
#endif
uni_char_t
*
psz_tmp
=
ToCharset
(
FREETYPE_TO_UCS
,
psz_text_in
,
&
i_string_bytes
);
if
(
psz_tmp
)
{
memcpy
(
psz_text_out
,
psz_tmp
,
i_string_bytes
);
i_string_length
=
i_string_bytes
/
4
;
i_string_length
=
i_string_bytes
/
sizeof
(
*
psz_tmp
)
;
free
(
psz_tmp
);
}
else
...
...
@@ -1468,7 +1483,7 @@ static unsigned SetupText( filter_t *p_filter,
}
static
int
ProcessNodes
(
filter_t
*
p_filter
,
u
int32
_t
*
psz_text
,
u
ni_char
_t
*
psz_text
,
text_style_t
**
pp_styles
,
uint32_t
*
pi_k_dates
,
int
*
pi_len
,
...
...
@@ -1865,13 +1880,13 @@ static int ProcessLines( filter_t *p_filter,
FT_BBox
*
p_bbox
,
int
*
pi_max_face_height
,
u
int32
_t
*
psz_text
,
u
ni_char
_t
*
psz_text
,
text_style_t
**
pp_styles
,
uint32_t
*
pi_k_dates
,
int
i_len
)
{
filter_sys_t
*
p_sys
=
p_filter
->
p_sys
;
u
int32_t
*
p_fribidi_string
=
NULL
;
u
ni_char_t
*
p_fribidi_string
=
NULL
;
text_style_t
**
pp_fribidi_styles
=
NULL
;
int
*
p_new_positions
=
NULL
;
...
...
@@ -2067,7 +2082,7 @@ static int ProcessLines( filter_t *p_filter,
while
(
i_part_length
>
0
)
{
const
text_style_t
*
p_glyph_style
=
pp_styles
[
i_index
];
u
int32
_t
character
=
psz_text
[
i_index
];
u
ni_char
_t
character
=
psz_text
[
i_index
];
int
i_glyph_index
=
FT_Get_Char_Index
(
p_current_face
,
character
);
/* Get kerning vector */
...
...
@@ -2300,7 +2315,7 @@ static int RenderCommon( filter_t *p_filter, subpicture_region_t *p_region_out,
const
size_t
i_text_max
=
strlen
(
b_html
?
p_region_in
->
psz_html
:
p_region_in
->
psz_text
);
u
int32
_t
*
psz_text
=
calloc
(
i_text_max
,
sizeof
(
*
psz_text
)
);
u
ni_char
_t
*
psz_text
=
calloc
(
i_text_max
,
sizeof
(
*
psz_text
)
);
text_style_t
**
pp_styles
=
calloc
(
i_text_max
,
sizeof
(
*
pp_styles
)
);
if
(
!
psz_text
||
!
pp_styles
)
{
...
...
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