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
22267186
Commit
22267186
authored
Jan 06, 2015
by
Salah-Eddin Shaban
Committed by
Jean-Baptiste Kempf
Jan 06, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
freetype: render Arabic diacritics properly
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
23f43118
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
2 deletions
+25
-2
modules/text_renderer/freetype.c
modules/text_renderer/freetype.c
+25
-2
No files found.
modules/text_renderer/freetype.c
View file @
22267186
...
...
@@ -1361,6 +1361,10 @@ static int ProcessLines( filter_t *p_filter,
/* Render the part */
bool
b_break_line
=
false
;
int
i_glyph_last
=
0
;
FT_Vector
advance
=
{
.
x
=
0
,
.
y
=
0
,
};
while
(
i_part_length
>
0
)
{
const
text_style_t
*
p_glyph_style
=
pp_styles
[
i_index
];
...
...
@@ -1373,6 +1377,16 @@ static int ProcessLines( filter_t *p_filter,
if
(
i_glyph_index
==
0
&&
character
==
0xFEFF
)
goto
next
;
/* These are the most common Arabic diacritics */
#define DIACRITIC( a ) ( a >= 0x064B && a <= 0x0653 )
/* Diacritics should be rendered over the preceding base glyph */
if
(
DIACRITIC
(
character
)
)
{
pen
.
x
-=
advance
.
x
;
pen
.
y
-=
advance
.
y
;
}
/* Get kerning vector */
FT_Vector
kerning
=
{
.
x
=
0
,
.
y
=
0
};
if
(
FT_HAS_KERNING
(
p_current_face
)
&&
i_glyph_last
!=
0
&&
i_glyph_index
!=
0
)
...
...
@@ -1516,8 +1530,17 @@ static int ProcessLines( filter_t *p_filter,
.
i_line_thickness
=
i_line_thickness
,
};
pen
.
x
=
pen_new
.
x
+
p_current_face
->
glyph
->
advance
.
x
;
pen
.
y
=
pen_new
.
y
+
p_current_face
->
glyph
->
advance
.
y
;
/* Diacritics do not determine advance values. We use */
/* the advance values from the last encountered base glyph, */
/* since multiple diacritics may follow a single base glyph. */
if
(
!
DIACRITIC
(
character
)
)
{
advance
.
x
=
p_current_face
->
glyph
->
advance
.
x
;
advance
.
y
=
p_current_face
->
glyph
->
advance
.
y
;
}
pen
.
x
=
pen_new
.
x
+
advance
.
x
;
pen
.
y
=
pen_new
.
y
+
advance
.
y
;
line_bbox
=
line_bbox_new
;
next:
i_glyph_last
=
i_glyph_index
;
...
...
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