Commit f6035080 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

dwrite: Implement AnalyzeLineBreakpoints() using Unicode breaking algorithm.

parent 1183a781
......@@ -7,5 +7,6 @@ C_SRCS = \
font.c \
gdiinterop.c \
layout.c \
linebreak.c \
main.c \
opentype.c
......@@ -834,13 +834,12 @@ struct linebreaks_test {
};
static struct linebreaks_test linebreaks_tests[] = {
{ {'A','-','B',' ',0xad,'C',0x58a,'D',0x2010,'E',0x2012,'F',0x2013,'\t',0},
{ {'A','-','B',' ','C',0x58a,'D',0x2010,'E',0x2012,'F',0x2013,'\t',0},
{
{ DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, FALSE, FALSE },
{ DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, DWRITE_BREAK_CONDITION_CAN_BREAK, FALSE, FALSE },
{ DWRITE_BREAK_CONDITION_CAN_BREAK, DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, FALSE, FALSE },
{ DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, DWRITE_BREAK_CONDITION_CAN_BREAK, TRUE, FALSE },
{ DWRITE_BREAK_CONDITION_CAN_BREAK, DWRITE_BREAK_CONDITION_CAN_BREAK, FALSE, TRUE },
{ DWRITE_BREAK_CONDITION_CAN_BREAK, DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, FALSE, FALSE },
{ DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, DWRITE_BREAK_CONDITION_CAN_BREAK, FALSE, FALSE },
{ DWRITE_BREAK_CONDITION_CAN_BREAK, DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, FALSE, FALSE },
......@@ -880,8 +879,9 @@ static void compare_breakpoints(const struct linebreaks_test *test, DWRITE_LINE_
}
}
static void test_SetLineBreakpoints(void)
static void test_AnalyzeLineBreakpoints(void)
{
static const WCHAR emptyW[] = {0};
const struct linebreaks_test *ptr = linebreaks_tests;
IDWriteTextAnalyzer *analyzer;
HRESULT hr;
......@@ -889,15 +889,17 @@ static void test_SetLineBreakpoints(void)
hr = IDWriteFactory_CreateTextAnalyzer(factory, &analyzer);
ok(hr == S_OK, "got 0x%08x\n", hr);
g_source = emptyW;
hr = IDWriteTextAnalyzer_AnalyzeLineBreakpoints(analyzer, &analysissource, 0, 0, &analysissink);
ok(hr == S_OK, "got 0x%08x\n", hr);
while (*ptr->text)
{
g_source = ptr->text;
memset(g_actual_bp, 0, sizeof(g_actual_bp));
hr = IDWriteTextAnalyzer_AnalyzeLineBreakpoints(analyzer, &analysissource, 0, lstrlenW(g_source), &analysissink);
todo_wine
ok(hr == S_OK, "got 0x%08x\n", hr);
if (hr == S_OK)
compare_breakpoints(ptr, g_actual_bp);
ptr++;
......@@ -922,7 +924,7 @@ START_TEST(analyzer)
init_call_sequences(expected_seq, 1);
test_AnalyzeScript();
test_SetLineBreakpoints();
test_AnalyzeLineBreakpoints();
IDWriteFactory_Release(factory);
}
......@@ -2274,6 +2274,7 @@ dump_mirroring( "dlls/usp10/mirror.c" );
dump_bracket( "dlls/usp10/bracket.c" );
dump_shaping( "dlls/usp10/shaping.c" );
dump_linebreak( "dlls/usp10/linebreak.c" );
dump_linebreak( "dlls/dwrite/linebreak.c" );
dump_indic( "dlls/usp10/indicsyllable.c" );
dump_intl_nls("loader/l_intl.nls");
dump_vertical( "dlls/gdi32/vertical.c" );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment