Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
37040729
Commit
37040729
authored
Oct 05, 2014
by
Nikolay Sivov
Committed by
Alexandre Julliard
Oct 06, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Mirror characters in case of RTL direction.
parent
1843972e
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
25 additions
and
2 deletions
+25
-2
Makefile.in
dlls/dwrite/Makefile.in
+1
-0
analyzer.c
dlls/dwrite/analyzer.c
+1
-2
bidi.c
dlls/dwrite/bidi.c
+6
-0
dwrite_private.h
dlls/dwrite/dwrite_private.h
+1
-0
mirror.c
dlls/dwrite/mirror.c
+0
-0
analyzer.c
dlls/dwrite/tests/analyzer.c
+15
-0
make_unicode
tools/make_unicode
+1
-0
No files found.
dlls/dwrite/Makefile.in
View file @
37040729
...
...
@@ -11,6 +11,7 @@ C_SRCS = \
layout.c
\
linebreak.c
\
main.c
\
mirror.c
\
opentype.c
\
scripts.c
\
shape.c
dlls/dwrite/analyzer.c
View file @
37040729
...
...
@@ -897,8 +897,7 @@ static HRESULT WINAPI dwritetextanalyzer_GetGlyphs(IDWriteTextAnalyzer2 *iface,
if
(
!
update_cluster
)
{
codepoint
=
decode_surrogate_pair
(
text
,
i
,
length
);
if
(
!
codepoint
)
{
/* FIXME: mirror in RTL case */
codepoint
=
text
[
i
];
codepoint
=
is_rtl
?
bidi_get_mirrored_char
(
text
[
i
])
:
text
[
i
];
string
[
i
]
=
codepoint
;
}
else
{
...
...
dlls/dwrite/bidi.c
View file @
37040729
...
...
@@ -198,6 +198,12 @@ static void bidi_classify(const WCHAR *string, UINT8 *chartype, UINT32 count)
}
}
WCHAR
bidi_get_mirrored_char
(
WCHAR
ch
)
{
extern
const
WCHAR
wine_mirror_map
[];
return
ch
+
wine_mirror_map
[
wine_mirror_map
[
ch
>>
8
]
+
(
ch
&
0xff
)];
}
/* RESOLVE EXPLICIT */
static
inline
UINT8
get_greater_even_level
(
UINT8
level
)
...
...
dlls/dwrite/dwrite_private.h
View file @
37040729
...
...
@@ -112,6 +112,7 @@ extern VOID OpenType_CMAP_GetGlyphIndex(LPVOID data, DWORD utf32c, LPWORD pgi, D
extern
VOID
get_font_properties
(
LPCVOID
os2
,
LPCVOID
head
,
LPCVOID
post
,
DWRITE_FONT_METRICS
*
metrics
,
DWRITE_FONT_STRETCH
*
stretch
,
DWRITE_FONT_WEIGHT
*
weight
,
DWRITE_FONT_STYLE
*
style
)
DECLSPEC_HIDDEN
;
extern
HRESULT
bidi_computelevels
(
const
WCHAR
*
,
UINT32
,
UINT8
,
UINT8
*
,
UINT8
*
);
extern
WCHAR
bidi_get_mirrored_char
(
WCHAR
);
/* Glyph shaping */
enum
SCRIPT_JUSTIFY
...
...
dlls/dwrite/mirror.c
0 → 100644
View file @
37040729
This diff is collapsed.
Click to expand it.
dlls/dwrite/tests/analyzer.c
View file @
37040729
...
...
@@ -1149,6 +1149,21 @@ static void test_GetGlyphs(void)
ok
(
actual_count
==
4
,
"got %d
\n
"
,
actual_count
);
ok
(
glyphs1
[
2
]
!=
glyphs2
[
2
],
"got %d
\n
"
,
glyphs1
[
2
]);
/* check that mirroring works */
maxglyphcount
=
10
;
actual_count
=
0
;
hr
=
IDWriteTextAnalyzer_GetGlyphs
(
analyzer
,
test1W
,
lstrlenW
(
test1W
),
fontface
,
FALSE
,
FALSE
,
&
sa
,
NULL
,
NULL
,
NULL
,
NULL
,
0
,
maxglyphcount
,
clustermap
,
props
,
glyphs1
,
shapingprops
,
&
actual_count
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
actual_count
==
4
,
"got %d
\n
"
,
actual_count
);
actual_count
=
0
;
hr
=
IDWriteTextAnalyzer_GetGlyphs
(
analyzer
,
test1W
,
lstrlenW
(
test1W
),
fontface
,
FALSE
,
TRUE
,
&
sa
,
NULL
,
NULL
,
NULL
,
NULL
,
0
,
maxglyphcount
,
clustermap
,
props
,
glyphs2
,
shapingprops
,
&
actual_count
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
actual_count
==
4
,
"got %d
\n
"
,
actual_count
);
ok
(
glyphs1
[
0
]
!=
glyphs2
[
0
],
"got %d
\n
"
,
glyphs1
[
0
]);
IDWriteTextAnalyzer_Release
(
analyzer
);
IDWriteFontFace_Release
(
fontface
);
}
...
...
tools/make_unicode
View file @
37040729
...
...
@@ -2383,6 +2383,7 @@ DUMP_SORTKEYS( "libs/wine/collation.c", READ_SORTKEYS_FILE() );
DUMP_COMPOSE_TABLES
(
"libs/wine/compose.c"
);
DUMP_CTYPE_TABLES
(
"libs/wine/wctype.c"
);
dump_mirroring
(
"dlls/usp10/mirror.c"
);
dump_mirroring
(
"dlls/dwrite/mirror.c"
);
dump_bracket
(
"dlls/usp10/bracket.c"
);
dump_bracket
(
"dlls/dwrite/bracket.c"
);
dump_shaping
(
"dlls/usp10/shaping.c"
);
...
...
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