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
8e814833
Commit
8e814833
authored
Dec 23, 2015
by
Salah-Eddin Shaban
Committed by
Jean-Baptiste Kempf
Dec 23, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
freetype: handle carriage returns
Close #16186 Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
c725a2f1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
22 deletions
+27
-22
modules/text_renderer/freetype/text_layout.c
modules/text_renderer/freetype/text_layout.c
+27
-22
No files found.
modules/text_renderer/freetype/text_layout.c
View file @
8e814833
...
@@ -978,13 +978,25 @@ static int LoadGlyphs( filter_t *p_filter, paragraph_t *p_paragraph,
...
@@ -978,13 +978,25 @@ static int LoadGlyphs( filter_t *p_filter, paragraph_t *p_paragraph,
i_glyph_index
=
i_glyph_index
=
FT_Get_Char_Index
(
p_face
,
p_paragraph
->
p_code_points
[
j
]
);
FT_Get_Char_Index
(
p_face
,
p_paragraph
->
p_code_points
[
j
]
);
glyph_bitmaps_t
*
p_bitmaps
=
p_paragraph
->
p_glyph_bitmaps
+
j
;
#define SKIP_GLYPH( p_bitmaps ) \
{ \
p_bitmaps->p_glyph = 0; \
p_bitmaps->p_outline = 0; \
p_bitmaps->p_shadow = 0; \
p_bitmaps->i_x_advance = 0; \
p_bitmaps->i_y_advance = 0; \
continue; \
}
if
(
!
i_glyph_index
)
{
uni_char_t
codepoint
=
p_paragraph
->
p_code_points
[
j
];
/*
/*
* If the font has no support for special space characters, use regular
* If the font has no support for special space characters, use regular
* space glyphs instead of the .notdef glyph.
* space glyphs instead of the .notdef glyph.
*/
*/
if
(
!
i_glyph_index
)
{
uni_char_t
codepoint
=
p_paragraph
->
p_code_points
[
j
];
if
(
codepoint
==
0x0009
||
codepoint
==
0x00A0
if
(
codepoint
==
0x0009
||
codepoint
==
0x00A0
||
codepoint
==
0x1680
||
codepoint
==
0x3000
||
codepoint
==
0x1680
||
codepoint
==
0x3000
||
codepoint
==
0x202F
||
codepoint
==
0x205F
||
codepoint
==
0x202F
||
codepoint
==
0x205F
...
@@ -998,21 +1010,19 @@ static int LoadGlyphs( filter_t *p_filter, paragraph_t *p_paragraph,
...
@@ -998,21 +1010,19 @@ static int LoadGlyphs( filter_t *p_filter, paragraph_t *p_paragraph,
{
{
i_glyph_index
=
3
;
i_glyph_index
=
3
;
}
}
/* Skip carriage returns */
else
if
(
codepoint
==
0x0D
#ifdef HAVE_FRIBIDI
||
p_paragraph
->
p_types
[
j
]
==
FRIBIDI_TYPE_BS
#endif
)
SKIP_GLYPH
(
p_bitmaps
)
}
}
glyph_bitmaps_t
*
p_bitmaps
=
p_paragraph
->
p_glyph_bitmaps
+
j
;
if
(
FT_Load_Glyph
(
p_face
,
i_glyph_index
,
if
(
FT_Load_Glyph
(
p_face
,
i_glyph_index
,
FT_LOAD_NO_BITMAP
|
FT_LOAD_DEFAULT
)
FT_LOAD_NO_BITMAP
|
FT_LOAD_DEFAULT
)
&&
FT_Load_Glyph
(
p_face
,
i_glyph_index
,
FT_LOAD_DEFAULT
)
)
&&
FT_Load_Glyph
(
p_face
,
i_glyph_index
,
FT_LOAD_DEFAULT
)
)
{
SKIP_GLYPH
(
p_bitmaps
)
p_bitmaps
->
p_glyph
=
0
;
p_bitmaps
->
p_outline
=
0
;
p_bitmaps
->
p_shadow
=
0
;
p_bitmaps
->
i_x_advance
=
0
;
p_bitmaps
->
i_y_advance
=
0
;
continue
;
}
if
(
(
p_style
->
i_style_flags
&
STYLE_BOLD
)
if
(
(
p_style
->
i_style_flags
&
STYLE_BOLD
)
&&
!
(
p_face
->
style_flags
&
FT_STYLE_FLAG_BOLD
)
)
&&
!
(
p_face
->
style_flags
&
FT_STYLE_FLAG_BOLD
)
)
...
@@ -1022,14 +1032,9 @@ static int LoadGlyphs( filter_t *p_filter, paragraph_t *p_paragraph,
...
@@ -1022,14 +1032,9 @@ static int LoadGlyphs( filter_t *p_filter, paragraph_t *p_paragraph,
FT_GlyphSlot_Oblique
(
p_face
->
glyph
);
FT_GlyphSlot_Oblique
(
p_face
->
glyph
);
if
(
FT_Get_Glyph
(
p_face
->
glyph
,
&
p_bitmaps
->
p_glyph
)
)
if
(
FT_Get_Glyph
(
p_face
->
glyph
,
&
p_bitmaps
->
p_glyph
)
)
{
SKIP_GLYPH
(
p_bitmaps
)
p_bitmaps
->
p_glyph
=
0
;
p_bitmaps
->
p_outline
=
0
;
#undef SKIP_GLYPH
p_bitmaps
->
p_shadow
=
0
;
p_bitmaps
->
i_x_advance
=
0
;
p_bitmaps
->
i_y_advance
=
0
;
continue
;
}
if
(
p_filter
->
p_sys
->
p_stroker
&&
(
p_style
->
i_style_flags
&
STYLE_OUTLINE
)
)
if
(
p_filter
->
p_sys
->
p_stroker
&&
(
p_style
->
i_style_flags
&
STYLE_OUTLINE
)
)
{
{
...
...
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