winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
December 2011
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
810 discussions
Start a n
N
ew thread
Jacek Caban : jscript: Use compiler for handling expression statements.
by Alexandre Julliard
19 Dec '11
19 Dec '11
Module: wine Branch: master Commit: ccba279b89bcf76973adf9f7b251cffa1919b7e2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ccba279b89bcf76973adf9f7b…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Dec 19 14:59:34 2011 +0100 jscript: Use compiler for handling expression statements. --- dlls/jscript/compile.c | 19 +++++++ dlls/jscript/engine.c | 136 ++++++++++++++++++++++-------------------------- dlls/jscript/engine.h | 3 +- dlls/jscript/parser.y | 2 +- 4 files changed, 83 insertions(+), 77 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=ccba279b89bcf76973adf…
1
0
0
0
Jacek Caban : jscript: Use bytecode for execution main code block in exec_source.
by Alexandre Julliard
19 Dec '11
19 Dec '11
Module: wine Branch: master Commit: 2f3e27f09a9810fc32a9f8cf14f6ee11a3c3c284 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2f3e27f09a9810fc32a9f8cf1…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Dec 19 14:59:12 2011 +0100 jscript: Use bytecode for execution main code block in exec_source. --- dlls/jscript/compile.c | 7 +++++-- dlls/jscript/engine.c | 19 +++++++------------ dlls/jscript/engine.h | 2 +- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/dlls/jscript/compile.c b/dlls/jscript/compile.c index 0c9ce64..5306f8b 100644 --- a/dlls/jscript/compile.c +++ b/dlls/jscript/compile.c @@ -931,7 +931,7 @@ HRESULT compile_subscript(parser_ctx_t *parser, expression_t *expr, BOOL do_ret, return push_instr(parser->compiler, OP_ret) == -1 ? E_OUTOFMEMORY : S_OK; } -HRESULT compile_subscript_stat(parser_ctx_t *parser, statement_t *stat, unsigned *ret_off) +HRESULT compile_subscript_stat(parser_ctx_t *parser, statement_t *stat, BOOL compile_block, unsigned *ret_off) { HRESULT hres; @@ -942,7 +942,10 @@ HRESULT compile_subscript_stat(parser_ctx_t *parser, statement_t *stat, unsigned return hres; *ret_off = parser->compiler->code_off; - hres = compile_statement(parser->compiler, stat); + if(compile_block && stat->next) + hres = compile_block_statement(parser->compiler, stat); + else + hres = compile_statement(parser->compiler, stat); if(FAILED(hres)) return hres; diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index 2311ea0..61ed5c5 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -513,8 +513,7 @@ HRESULT exec_source(exec_ctx_t *ctx, parser_ctx_t *parser, source_elements_t *so function_declaration_t *func; parser_ctx_t *prev_parser; var_list_t *var; - VARIANT val, tmp; - statement_t *stat; + VARIANT val; exec_ctx_t *prev_ctx; return_type_t rt; HRESULT hres = S_OK; @@ -560,15 +559,11 @@ HRESULT exec_source(exec_ctx_t *ctx, parser_ctx_t *parser, source_elements_t *so memset(&rt, 0, sizeof(rt)); rt.type = RT_NORMAL; - for(stat = source->statement; stat; stat = stat->next) { - hres = stat_eval(script, stat, &rt, &tmp); - if(FAILED(hres)) - break; - - VariantClear(&val); - val = tmp; - if(rt.type != RT_NORMAL) - break; + if(source->statement) { + if(source->statement->instr_off == -1) + hres = compile_subscript_stat(ctx->parser, source->statement, TRUE, &source->statement->instr_off); + if(SUCCEEDED(hres)) + hres = compiled_statement_eval(script, source->statement, &rt, &val); } script->exec_ctx = prev_ctx; @@ -3005,7 +3000,7 @@ HRESULT compiled_statement_eval(script_ctx_t *ctx, statement_t *stat, return_typ TRACE("\n"); if(stat->instr_off == -1) { - hres = compile_subscript_stat(exec_ctx->parser, stat, &stat->instr_off); + hres = compile_subscript_stat(exec_ctx->parser, stat, FALSE, &stat->instr_off); if(FAILED(hres)) return hres; } diff --git a/dlls/jscript/engine.h b/dlls/jscript/engine.h index bcba203..93ab007 100644 --- a/dlls/jscript/engine.h +++ b/dlls/jscript/engine.h @@ -590,4 +590,4 @@ typedef struct { } property_value_expression_t; HRESULT compile_subscript(parser_ctx_t*,expression_t*,BOOL,unsigned*) DECLSPEC_HIDDEN; -HRESULT compile_subscript_stat(parser_ctx_t*,statement_t*,unsigned*) DECLSPEC_HIDDEN; +HRESULT compile_subscript_stat(parser_ctx_t*,statement_t*,BOOL,unsigned*) DECLSPEC_HIDDEN;
1
0
0
0
Jacek Caban : jscript: Use bytecode for block statement implementation.
by Alexandre Julliard
19 Dec '11
19 Dec '11
Module: wine Branch: master Commit: f6023c428aa82381323a1c05c9ad980387c3e66c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f6023c428aa82381323a1c05c…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Dec 19 14:58:42 2011 +0100 jscript: Use bytecode for block statement implementation. --- dlls/jscript/compile.c | 76 ++++++++++++++++++++++++++++++++++++++---- dlls/jscript/engine.c | 80 ++++++++++++++++++++++++++----------------- dlls/jscript/engine.h | 19 ++++++---- dlls/jscript/parser.y | 3 +- dlls/jscript/tests/lang.js | 4 ++ 5 files changed, 134 insertions(+), 48 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=f6023c428aa82381323a1…
1
0
0
0
Jacek Caban : jscript: Store type information in statement nodes.
by Alexandre Julliard
19 Dec '11
19 Dec '11
Module: wine Branch: master Commit: 42aefd424d79698305c65403ffaeb9cf53bff36a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=42aefd424d79698305c65403f…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Dec 19 14:58:19 2011 +0100 jscript: Store type information in statement nodes. --- dlls/jscript/engine.h | 20 ++++++ dlls/jscript/parser.y | 170 ++++++++++++++++++++++++++++++++----------------- 2 files changed, 132 insertions(+), 58 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=42aefd424d79698305c65…
1
0
0
0
Aric Stewart : usp10: Add Mathematical Alphanumeric Symbols script.
by Alexandre Julliard
19 Dec '11
19 Dec '11
Module: wine Branch: master Commit: 00588673c6d0861ac9f5db7d9d66e88f2b47db54 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=00588673c6d0861ac9f5db7d9…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Mon Dec 19 07:25:17 2011 -0600 usp10: Add Mathematical Alphanumeric Symbols script. --- dlls/usp10/shape.c | 1 + dlls/usp10/tests/usp10.c | 10 ++++++++++ dlls/usp10/usp10.c | 9 ++++++++- dlls/usp10/usp10_internal.h | 2 ++ 4 files changed, 21 insertions(+), 1 deletions(-) diff --git a/dlls/usp10/shape.c b/dlls/usp10/shape.c index b234b11..c238d09 100644 --- a/dlls/usp10/shape.c +++ b/dlls/usp10/shape.c @@ -714,6 +714,7 @@ static const ScriptShapeData ShapingData[] = {{ no_features, 0}, NULL, "dsrt", "", NULL, NULL}, {{ no_features, 0}, NULL, "osma", "", NULL, NULL}, {{ no_features, 0}, NULL, "osma", "", NULL, NULL}, + {{ no_features, 0}, NULL, "math", "", NULL, NULL}, }; static INT GSUB_is_glyph_covered(LPCVOID table , UINT glyph) diff --git a/dlls/usp10/tests/usp10.c b/dlls/usp10/tests/usp10.c index 69083b3..2e05f48 100644 --- a/dlls/usp10/tests/usp10.c +++ b/dlls/usp10/tests/usp10.c @@ -170,6 +170,7 @@ static inline void _test_items_ok(LPCWSTR string, DWORD cchString, #define brai_tag MS_MAKE_TAG('b','r','a','i') #define dsrt_tag MS_MAKE_TAG('d','s','r','t') #define osma_tag MS_MAKE_TAG('o','s','m','a') +#define math_tag MS_MAKE_TAG('m','a','t','h') static void test_ScriptItemize( void ) { @@ -446,6 +447,11 @@ static void test_ScriptItemize( void ) static const itemTest t461[2] = {{{0,0,0,0,0},0,0,0,0,osma_tag,TRUE,{-1,-1,-1,-1,0x0}},{{0,0,0,0,0},16,0,0,0,-1,FALSE}}; static const itemTest t462[2] = {{{0,0,0,0,0},0,0,0,2,osma_tag,TRUE,{-1,1,1,1,0x0}},{{0,0,0,0,0},16,0,0,0,-1,FALSE}}; + /* Mathematical Alphanumeric Symbols */ + static const WCHAR test47[] = {0xd835,0xdc00,0xd835,0xdc35,0xd835,0xdc6a,0xd835,0xdc9f,0xd835,0xdcd4,0xd835,0xdd09,0xd835,0xdd3e,0xd835,0xdd73,0xd835,0xdda8,0xd835,0xdddd,0xd835,0xde12,0xd835,0xde47,0xd835,0xde7c}; + static const itemTest t471[2] = {{{0,0,0,0,0},0,0,0,0,math_tag,TRUE,{-1,-1,-1,-1,0x0}},{{0,0,0,0,0},26,0,0,0,-1,FALSE}}; + static const itemTest t472[2] = {{{0,0,0,0,0},0,0,0,2,math_tag,TRUE,{-1,1,1,1,0x0}},{{0,0,0,0,0},26,0,0,0,-1,FALSE}}; + SCRIPT_ITEM items[15]; SCRIPT_CONTROL Control; SCRIPT_STATE State; @@ -525,6 +531,7 @@ static void test_ScriptItemize( void ) test_items_ok(test44,4,NULL,NULL,2,t441,FALSE,0); test_items_ok(test45,24,NULL,NULL,1,t451,FALSE,0); test_items_ok(test46,16,NULL,NULL,1,t461,FALSE,0); + test_items_ok(test47,26,NULL,NULL,1,t471,FALSE,0); State.uBidiLevel = 0; test_items_ok(test1,4,&Control,&State,1,t11,FALSE,0); @@ -578,6 +585,7 @@ static void test_ScriptItemize( void ) test_items_ok(test44,4,&Control,&State,2,t441,FALSE,0); test_items_ok(test45,24,&Control,&State,1,t451,FALSE,0); test_items_ok(test46,16,&Control,&State,1,t461,FALSE,0); + test_items_ok(test47,26,&Control,&State,1,t471,FALSE,0); State.uBidiLevel = 1; test_items_ok(test1,4,&Control,&State,1,t12,FALSE,0); @@ -631,6 +639,7 @@ static void test_ScriptItemize( void ) test_items_ok(test44,4,&Control,&State,2,t442,FALSE,0); test_items_ok(test45,24,&Control,&State,1,t452,FALSE,0); test_items_ok(test46,16,&Control,&State,1,t462,FALSE,0); + test_items_ok(test47,26,&Control,&State,1,t472,FALSE,0); State.uBidiLevel = 1; Control.fMergeNeutralItems = TRUE; @@ -685,6 +694,7 @@ static void test_ScriptItemize( void ) test_items_ok(test44,4,&Control,&State,2,t442,FALSE,0); test_items_ok(test45,24,&Control,&State,1,t452,FALSE,0); test_items_ok(test46,16,&Control,&State,1,t462,FALSE,0); + test_items_ok(test47,26,&Control,&State,1,t472,FALSE,0); } static inline void _test_shape_ok(int valid, HDC hdc, LPCWSTR string, diff --git a/dlls/usp10/usp10.c b/dlls/usp10/usp10.c index 2a5cb1c..4f532f5 100644 --- a/dlls/usp10/usp10.c +++ b/dlls/usp10/usp10.c @@ -292,6 +292,8 @@ static const scriptRange scriptRanges[] = { { Script_Deseret, 0x10400, 0x1044F, 0, 0}, /* Osmanya: U+10480–U+104AF */ { Script_Osmanya, 0x10480, 0x104AF, Script_Osmanya_Numeric, 0}, + /* Mathematical Alphanumeric Symbols: U+1D400–U+1D7FF */ + { Script_MathAlpha, 0x1D400, 0x1D7FF, 0, 0}, /* END */ { SCRIPT_UNDEFINED, 0, 0, 0} }; @@ -618,6 +620,10 @@ static const scriptData scriptInformation[] = { {0, 1, 1, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 0, 0, 0, 0, 0, 0}, MS_MAKE_TAG('o','s','m','a'), {'E','b','r','i','m','a'}}, + {{Script_MathAlpha, 0, 0, 0, 0, 0, 0, { 0,0,0,0,0,0,0,0,0,0,0}}, + {0, 0, 1, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + MS_MAKE_TAG('m','a','t','h'), + {'C','a','m','b','r','i','a',' ','M','a','t','h'}}, }; static const SCRIPT_PROPERTIES *script_props[] = @@ -660,7 +666,8 @@ static const SCRIPT_PROPERTIES *script_props[] = &scriptInformation[70].props, &scriptInformation[71].props, &scriptInformation[72].props, &scriptInformation[73].props, &scriptInformation[74].props, &scriptInformation[75].props, - &scriptInformation[76].props, &scriptInformation[77].props + &scriptInformation[76].props, &scriptInformation[77].props, + &scriptInformation[78].props }; typedef struct { diff --git a/dlls/usp10/usp10_internal.h b/dlls/usp10/usp10_internal.h index 6c93ba6..ea04324 100644 --- a/dlls/usp10/usp10_internal.h +++ b/dlls/usp10/usp10_internal.h @@ -113,6 +113,8 @@ #define Script_Deseret 75 #define Script_Osmanya 76 #define Script_Osmanya_Numeric 77 +/* Unicode Chapter 15 : Plane 1 */ +#define Script_MathAlpha 78 #define GLYPH_BLOCK_SHIFT 8 #define GLYPH_BLOCK_SIZE (1UL << GLYPH_BLOCK_SHIFT)
1
0
0
0
Aric Stewart : usp10: Add Osmanya script.
by Alexandre Julliard
19 Dec '11
19 Dec '11
Module: wine Branch: master Commit: 88c6b7ef003dd93738c7a5245e9d57b09496a4fb URL:
http://source.winehq.org/git/wine.git/?a=commit;h=88c6b7ef003dd93738c7a5245…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Sat Dec 17 21:27:15 2011 -0600 usp10: Add Osmanya script. --- dlls/usp10/shape.c | 2 ++ dlls/usp10/tests/usp10.c | 10 ++++++++++ dlls/usp10/usp10.c | 13 ++++++++++++- dlls/usp10/usp10_internal.h | 2 ++ 4 files changed, 26 insertions(+), 1 deletions(-) diff --git a/dlls/usp10/shape.c b/dlls/usp10/shape.c index fcbf92c..b234b11 100644 --- a/dlls/usp10/shape.c +++ b/dlls/usp10/shape.c @@ -712,6 +712,8 @@ static const ScriptShapeData ShapingData[] = {{ no_features, 0}, NULL, "", "", NULL, NULL}, {{ no_features, 0}, NULL, "", "", NULL, NULL}, {{ no_features, 0}, NULL, "dsrt", "", NULL, NULL}, + {{ no_features, 0}, NULL, "osma", "", NULL, NULL}, + {{ no_features, 0}, NULL, "osma", "", NULL, NULL}, }; static INT GSUB_is_glyph_covered(LPCVOID table , UINT glyph) diff --git a/dlls/usp10/tests/usp10.c b/dlls/usp10/tests/usp10.c index 9651000..69083b3 100644 --- a/dlls/usp10/tests/usp10.c +++ b/dlls/usp10/tests/usp10.c @@ -169,6 +169,7 @@ static inline void _test_items_ok(LPCWSTR string, DWORD cchString, #define runr_tag MS_MAKE_TAG('r','u','n','r') #define brai_tag MS_MAKE_TAG('b','r','a','i') #define dsrt_tag MS_MAKE_TAG('d','s','r','t') +#define osma_tag MS_MAKE_TAG('o','s','m','a') static void test_ScriptItemize( void ) { @@ -440,6 +441,11 @@ static void test_ScriptItemize( void ) static const itemTest t451[2] = {{{0,0,0,0,0},0,0,0,0,dsrt_tag,TRUE,{-1,-1,-1,-1,0x0}},{{0,0,0,0,0},24,0,0,0,-1,FALSE}}; static const itemTest t452[2] = {{{0,0,0,0,0},0,0,0,2,dsrt_tag,TRUE,{-1,1,1,1,0x0}},{{0,0,0,0,0},24,0,0,0,-1,FALSE}}; + /* Osmanya */ + static const WCHAR test46[] = {0xd801,0xdc8b,0xd801,0xdc98,0xd801,0xdc88,0xd801,0xdc91,0xd801,0xdc9b,0xd801,0xdc92,0xd801,0xdc95,0xd801,0xdc80}; + static const itemTest t461[2] = {{{0,0,0,0,0},0,0,0,0,osma_tag,TRUE,{-1,-1,-1,-1,0x0}},{{0,0,0,0,0},16,0,0,0,-1,FALSE}}; + static const itemTest t462[2] = {{{0,0,0,0,0},0,0,0,2,osma_tag,TRUE,{-1,1,1,1,0x0}},{{0,0,0,0,0},16,0,0,0,-1,FALSE}}; + SCRIPT_ITEM items[15]; SCRIPT_CONTROL Control; SCRIPT_STATE State; @@ -518,6 +524,7 @@ static void test_ScriptItemize( void ) test_items_ok(test43,7,NULL,NULL,1,t431,FALSE,0); test_items_ok(test44,4,NULL,NULL,2,t441,FALSE,0); test_items_ok(test45,24,NULL,NULL,1,t451,FALSE,0); + test_items_ok(test46,16,NULL,NULL,1,t461,FALSE,0); State.uBidiLevel = 0; test_items_ok(test1,4,&Control,&State,1,t11,FALSE,0); @@ -570,6 +577,7 @@ static void test_ScriptItemize( void ) test_items_ok(test43,7,&Control,&State,1,t431,FALSE,0); test_items_ok(test44,4,&Control,&State,2,t441,FALSE,0); test_items_ok(test45,24,&Control,&State,1,t451,FALSE,0); + test_items_ok(test46,16,&Control,&State,1,t461,FALSE,0); State.uBidiLevel = 1; test_items_ok(test1,4,&Control,&State,1,t12,FALSE,0); @@ -622,6 +630,7 @@ static void test_ScriptItemize( void ) test_items_ok(test43,7,&Control,&State,1,t432,FALSE,0); test_items_ok(test44,4,&Control,&State,2,t442,FALSE,0); test_items_ok(test45,24,&Control,&State,1,t452,FALSE,0); + test_items_ok(test46,16,&Control,&State,1,t462,FALSE,0); State.uBidiLevel = 1; Control.fMergeNeutralItems = TRUE; @@ -675,6 +684,7 @@ static void test_ScriptItemize( void ) test_items_ok(test43,7,&Control,&State,1,t432,FALSE,0); test_items_ok(test44,4,&Control,&State,2,t442,FALSE,0); test_items_ok(test45,24,&Control,&State,1,t452,FALSE,0); + test_items_ok(test46,16,&Control,&State,1,t462,FALSE,0); } static inline void _test_shape_ok(int valid, HDC hdc, LPCWSTR string, diff --git a/dlls/usp10/usp10.c b/dlls/usp10/usp10.c index a05f7b6..2a5cb1c 100644 --- a/dlls/usp10/usp10.c +++ b/dlls/usp10/usp10.c @@ -290,6 +290,8 @@ static const scriptRange scriptRanges[] = { /* Plane - 1 */ /* Deseret: U+10400–U+1044F */ { Script_Deseret, 0x10400, 0x1044F, 0, 0}, + /* Osmanya: U+10480–U+104AF */ + { Script_Osmanya, 0x10480, 0x104AF, Script_Osmanya_Numeric, 0}, /* END */ { SCRIPT_UNDEFINED, 0, 0, 0} }; @@ -608,6 +610,14 @@ static const scriptData scriptInformation[] = { {0, 0, 1, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 0, 0, 0, 0, 0, 0}, MS_MAKE_TAG('d','s','r','t'), {'S','e','g','o','e',' ','U','I',' ','S','y','m','b','o','l'}}, + {{Script_Osmanya, 0, 0, 0, 0, 0, 0, { 0,0,0,0,0,0,0,0,0,0,0}}, + {0, 0, 1, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + MS_MAKE_TAG('o','s','m','a'), + {'E','b','r','i','m','a'}}, + {{Script_Osmanya_Numeric, 0, 0, 0, 0, 0, 0, { 0,0,0,0,0,0,0,0,0,0,0}}, + {0, 1, 1, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + MS_MAKE_TAG('o','s','m','a'), + {'E','b','r','i','m','a'}}, }; static const SCRIPT_PROPERTIES *script_props[] = @@ -649,7 +659,8 @@ static const SCRIPT_PROPERTIES *script_props[] = &scriptInformation[68].props, &scriptInformation[69].props, &scriptInformation[70].props, &scriptInformation[71].props, &scriptInformation[72].props, &scriptInformation[73].props, - &scriptInformation[74].props, &scriptInformation[75].props + &scriptInformation[74].props, &scriptInformation[75].props, + &scriptInformation[76].props, &scriptInformation[77].props }; typedef struct { diff --git a/dlls/usp10/usp10_internal.h b/dlls/usp10/usp10_internal.h index 1d88ee1..6c93ba6 100644 --- a/dlls/usp10/usp10_internal.h +++ b/dlls/usp10/usp10_internal.h @@ -111,6 +111,8 @@ #define Script_Private 74 /* Unicode Chapter 13 : Plane 1 */ #define Script_Deseret 75 +#define Script_Osmanya 76 +#define Script_Osmanya_Numeric 77 #define GLYPH_BLOCK_SHIFT 8 #define GLYPH_BLOCK_SIZE (1UL << GLYPH_BLOCK_SHIFT)
1
0
0
0
Aric Stewart : usp10: Add Deseret script.
by Alexandre Julliard
19 Dec '11
19 Dec '11
Module: wine Branch: master Commit: 095276073c5fe8b24fc0369e2ab549ef30bd452a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=095276073c5fe8b24fc0369e2…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Sat Dec 17 21:27:02 2011 -0600 usp10: Add Deseret script. --- dlls/usp10/shape.c | 1 + dlls/usp10/tests/usp10.c | 10 ++++++++++ dlls/usp10/usp10.c | 9 ++++++++- dlls/usp10/usp10_internal.h | 2 ++ 4 files changed, 21 insertions(+), 1 deletions(-) diff --git a/dlls/usp10/shape.c b/dlls/usp10/shape.c index e889ba8..fcbf92c 100644 --- a/dlls/usp10/shape.c +++ b/dlls/usp10/shape.c @@ -711,6 +711,7 @@ static const ScriptShapeData ShapingData[] = {{ no_features, 0}, NULL, "brai", "", NULL, NULL}, {{ no_features, 0}, NULL, "", "", NULL, NULL}, {{ no_features, 0}, NULL, "", "", NULL, NULL}, + {{ no_features, 0}, NULL, "dsrt", "", NULL, NULL}, }; static INT GSUB_is_glyph_covered(LPCVOID table , UINT glyph) diff --git a/dlls/usp10/tests/usp10.c b/dlls/usp10/tests/usp10.c index 64cbb30..9651000 100644 --- a/dlls/usp10/tests/usp10.c +++ b/dlls/usp10/tests/usp10.c @@ -168,6 +168,7 @@ static inline void _test_items_ok(LPCWSTR string, DWORD cchString, #define ogam_tag MS_MAKE_TAG('o','g','a','m') #define runr_tag MS_MAKE_TAG('r','u','n','r') #define brai_tag MS_MAKE_TAG('b','r','a','i') +#define dsrt_tag MS_MAKE_TAG('d','s','r','t') static void test_ScriptItemize( void ) { @@ -434,6 +435,11 @@ static void test_ScriptItemize( void ) static const itemTest t441[3] = {{{0,0,0,0,0},0,0,0,0,0,FALSE},{{0,0,0,0,0},2,0,0,0,0,FALSE},{{0,0,0,0,0},4,0,0,0,-1,FALSE}}; static const itemTest t442[4] = {{{0,0,0,0,0},0,0,0,2,0,TRUE,{-1,1,1,1,-1}},{{0,0,0,0,0},2,0,0,2,0,TRUE,{-1,1,1,1,-1}},{{0,0,0,0,0},4,0,0,0,-1,FALSE}}; + /* Deseret */ + static const WCHAR test45[] = {0xd801,0xdc19,0xd801,0xdc32,0xd801,0xdc4c,0xd801,0xdc3c,0xd801,0xdc32,0xd801,0xdc4b,0xd801,0xdc2f,0xd801,0xdc4c,0xd801,0xdc3b,0xd801,0xdc32,0xd801,0xdc4a,0xd801,0xdc28}; + static const itemTest t451[2] = {{{0,0,0,0,0},0,0,0,0,dsrt_tag,TRUE,{-1,-1,-1,-1,0x0}},{{0,0,0,0,0},24,0,0,0,-1,FALSE}}; + static const itemTest t452[2] = {{{0,0,0,0,0},0,0,0,2,dsrt_tag,TRUE,{-1,1,1,1,0x0}},{{0,0,0,0,0},24,0,0,0,-1,FALSE}}; + SCRIPT_ITEM items[15]; SCRIPT_CONTROL Control; SCRIPT_STATE State; @@ -511,6 +517,7 @@ static void test_ScriptItemize( void ) test_items_ok(test42,6,NULL,NULL,1,t421,FALSE,0); test_items_ok(test43,7,NULL,NULL,1,t431,FALSE,0); test_items_ok(test44,4,NULL,NULL,2,t441,FALSE,0); + test_items_ok(test45,24,NULL,NULL,1,t451,FALSE,0); State.uBidiLevel = 0; test_items_ok(test1,4,&Control,&State,1,t11,FALSE,0); @@ -562,6 +569,7 @@ static void test_ScriptItemize( void ) test_items_ok(test42,6,&Control,&State,1,t421,FALSE,0); test_items_ok(test43,7,&Control,&State,1,t431,FALSE,0); test_items_ok(test44,4,&Control,&State,2,t441,FALSE,0); + test_items_ok(test45,24,&Control,&State,1,t451,FALSE,0); State.uBidiLevel = 1; test_items_ok(test1,4,&Control,&State,1,t12,FALSE,0); @@ -613,6 +621,7 @@ static void test_ScriptItemize( void ) test_items_ok(test42,6,&Control,&State,1,t422,FALSE,0); test_items_ok(test43,7,&Control,&State,1,t432,FALSE,0); test_items_ok(test44,4,&Control,&State,2,t442,FALSE,0); + test_items_ok(test45,24,&Control,&State,1,t452,FALSE,0); State.uBidiLevel = 1; Control.fMergeNeutralItems = TRUE; @@ -665,6 +674,7 @@ static void test_ScriptItemize( void ) test_items_ok(test42,6,&Control,&State,1,t422,FALSE,0); test_items_ok(test43,7,&Control,&State,1,t432,FALSE,0); test_items_ok(test44,4,&Control,&State,2,t442,FALSE,0); + test_items_ok(test45,24,&Control,&State,1,t452,FALSE,0); } static inline void _test_shape_ok(int valid, HDC hdc, LPCWSTR string, diff --git a/dlls/usp10/usp10.c b/dlls/usp10/usp10.c index 7a32937..a05f7b6 100644 --- a/dlls/usp10/usp10.c +++ b/dlls/usp10/usp10.c @@ -287,6 +287,9 @@ static const scriptRange scriptRanges[] = { { Script_Kana ,0xff65, 0xff9f, 0, 0}, { Script_Hangul ,0xffa0, 0xffdf, 0, 0}, { Script_Ideograph ,0xffe0, 0xffef, 0, 0}, + /* Plane - 1 */ + /* Deseret: U+10400–U+1044F */ + { Script_Deseret, 0x10400, 0x1044F, 0, 0}, /* END */ { SCRIPT_UNDEFINED, 0, 0, 0} }; @@ -601,6 +604,10 @@ static const scriptData scriptInformation[] = { {0, 0, 0, 0, 0, DEFAULT_CHARSET, 0, 1, 0, 0, 0, 0, 1, 0, 0}, 0x00000000, {0}}, + {{Script_Deseret, 0, 0, 0, 0, 0, 0, { 0,0,0,0,0,0,0,0,0,0,0}}, + {0, 0, 1, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + MS_MAKE_TAG('d','s','r','t'), + {'S','e','g','o','e',' ','U','I',' ','S','y','m','b','o','l'}}, }; static const SCRIPT_PROPERTIES *script_props[] = @@ -642,7 +649,7 @@ static const SCRIPT_PROPERTIES *script_props[] = &scriptInformation[68].props, &scriptInformation[69].props, &scriptInformation[70].props, &scriptInformation[71].props, &scriptInformation[72].props, &scriptInformation[73].props, - &scriptInformation[74].props + &scriptInformation[74].props, &scriptInformation[75].props }; typedef struct { diff --git a/dlls/usp10/usp10_internal.h b/dlls/usp10/usp10_internal.h index f310011..1d88ee1 100644 --- a/dlls/usp10/usp10_internal.h +++ b/dlls/usp10/usp10_internal.h @@ -109,6 +109,8 @@ /* Unicode Chapter 16 */ #define Script_Surrogates 73 #define Script_Private 74 +/* Unicode Chapter 13 : Plane 1 */ +#define Script_Deseret 75 #define GLYPH_BLOCK_SHIFT 8 #define GLYPH_BLOCK_SIZE (1UL << GLYPH_BLOCK_SHIFT)
1
0
0
0
Aric Stewart : usp10: Handle surrogate pairs when shaping.
by Alexandre Julliard
19 Dec '11
19 Dec '11
Module: wine Branch: master Commit: 4fbb6fd66d82667a5e678d6c37868a425c93f403 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4fbb6fd66d82667a5e678d6c3…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Fri Dec 16 13:15:47 2011 -0600 usp10: Handle surrogate pairs when shaping. --- dlls/usp10/usp10.c | 67 +++++++++++++++++++++++++++++++++++---------------- 1 files changed, 46 insertions(+), 21 deletions(-) diff --git a/dlls/usp10/usp10.c b/dlls/usp10/usp10.c index 5f1ac5c..7a32937 100644 --- a/dlls/usp10/usp10.c +++ b/dlls/usp10/usp10.c @@ -708,7 +708,7 @@ static inline BYTE get_cache_pitch_family(SCRIPT_CACHE *psc) return ((ScriptCache *)*psc)->tm.tmPitchAndFamily; } -static inline WORD get_cache_glyph(SCRIPT_CACHE *psc, WCHAR c) +static inline WORD get_cache_glyph(SCRIPT_CACHE *psc, DWORD c) { WORD *block = ((ScriptCache *)*psc)->glyphs[c >> GLYPH_BLOCK_SHIFT]; @@ -2631,8 +2631,9 @@ HRESULT WINAPI ScriptShapeOpenType( HDC hdc, SCRIPT_CACHE *psc, SCRIPT_GLYPHPROP *pOutGlyphProps, int *pcGlyphs) { HRESULT hr; - unsigned int i; + unsigned int i,g; BOOL rtl; + int cluster; TRACE("(%p, %p, %p, %s, %s, %p, %p, %d, %s, %d, %d, %p, %p, %p, %p, %p )\n", hdc, psc, psa, @@ -2688,35 +2689,59 @@ HRESULT WINAPI ScriptShapeOpenType( HDC hdc, SCRIPT_CACHE *psc, rChars = heap_alloc(sizeof(WCHAR) * cChars); if (!rChars) return E_OUTOFMEMORY; - for (i = 0; i < cChars; i++) + for (i = 0, g = 0, cluster = 0; i < cChars; i++) { int idx = i; - WCHAR chInput; + DWORD chInput; + if (rtl) idx = cChars - 1 - i; - if (psa->fRTL) - chInput = mirror_char(pwcChars[idx]); - else - chInput = pwcChars[idx]; - /* special case for tabs */ - if (chInput == 0x0009) - chInput = 0x0020; - if (!(pwOutGlyphs[i] = get_cache_glyph(psc, chInput))) + if (!cluster) { - WORD glyph; - if (!hdc) + chInput = decode_surrogate_pair(pwcChars, idx, cChars); + if (!chInput) { - heap_free(rChars); - return E_PENDING; + if (psa->fRTL) + chInput = mirror_char(pwcChars[idx]); + else + chInput = pwcChars[idx]; + /* special case for tabs */ + if (chInput == 0x0009) + chInput = 0x0020; + rChars[i] = chInput; } - if (GetGlyphIndicesW(hdc, &chInput, 1, &glyph, 0) == GDI_ERROR) + else { - heap_free(rChars); - return S_FALSE; + rChars[i] = pwcChars[idx]; + rChars[i+1] = pwcChars[(rtl)?idx-1:idx+1]; + cluster = 1; } - pwOutGlyphs[i] = set_cache_glyph(psc, chInput, glyph); + if (!(pwOutGlyphs[g] = get_cache_glyph(psc, chInput))) + { + WORD glyph; + if (!hdc) + { + heap_free(rChars); + return E_PENDING; + } + if (CMAP_GetGlyphIndex(hdc, (ScriptCache *)*psc, chInput, &glyph, 0) == GDI_ERROR) + { + heap_free(rChars); + return S_FALSE; + } + pwOutGlyphs[g] = set_cache_glyph(psc, chInput, glyph); + } + g++; + } + else + { + int k; + cluster--; + pwLogClust[idx] = (rtl)?pwLogClust[idx+1]:pwLogClust[idx-1]; + for (k = (rtl)?idx-1:idx+1; k >= 0 && k < cChars; (rtl)?k--:k++) + pwLogClust[k]--; } - rChars[i] = chInput; } + *pcGlyphs = g; SHAPE_ContextualShaping(hdc, (ScriptCache *)*psc, psa, rChars, cChars, pwOutGlyphs, pcGlyphs, cMaxGlyphs, pwLogClust); SHAPE_ApplyDefaultOpentypeFeatures(hdc, (ScriptCache *)*psc, psa, pwOutGlyphs, pcGlyphs, cMaxGlyphs, cChars, pwLogClust);
1
0
0
0
Aric Stewart : usp10: Decode surrogate pairs in get_char_script and handle ranges beyond the BMP .
by Alexandre Julliard
19 Dec '11
19 Dec '11
Module: wine Branch: master Commit: 0404d68999c6daa1a28e10300664d3314fa03c44 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0404d68999c6daa1a28e10300…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Fri Dec 16 13:15:43 2011 -0600 usp10: Decode surrogate pairs in get_char_script and handle ranges beyond the BMP. --- dlls/usp10/usp10.c | 53 ++++++++++++++++++++++++++++++++++++++++++--------- 1 files changed, 43 insertions(+), 10 deletions(-) diff --git a/dlls/usp10/usp10.c b/dlls/usp10/usp10.c index a0e143e..5f1ac5c 100644 --- a/dlls/usp10/usp10.c +++ b/dlls/usp10/usp10.c @@ -44,8 +44,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(uniscribe); typedef struct _scriptRange { WORD script; - WORD rangeFirst; - WORD rangeLast; + DWORD rangeFirst; + DWORD rangeLast; WORD numericScript; WORD punctScript; } scriptRange; @@ -774,24 +774,38 @@ static WCHAR mirror_char( WCHAR ch ) return ch + wine_mirror_map[wine_mirror_map[ch >> 8] + (ch & 0xff)]; } -static WORD get_char_script( WCHAR ch) +static inline DWORD decode_surrogate_pair(LPCWSTR str, INT index, INT end) +{ + if (index < end-1 && IS_SURROGATE_PAIR(str[index],str[index+1])) + { + DWORD ch = 0x10000 + ((str[index] - 0xd800) << 10) + (str[index+1] - 0xdc00); + TRACE("Surrogate Pair %x %x => %x\n",str[index], str[index+1], ch); + return ch; + } + return 0; +} + +static WORD get_char_script( LPCWSTR str, INT index, INT end, INT *consumed) { static const WCHAR latin_punc[] = {'#','$','&','\'',',',';','<','>','?','@','\\','^','_','`','{','|','}','~', 0x00a0, 0}; WORD type = 0; + DWORD ch; int i; - if (ch == 0xc || ch == 0x20 || ch == 0x202f) + *consumed = 1; + + if (str[index] == 0xc || str[index] == 0x20 || str[index] == 0x202f) return Script_CR; /* These punctuation are separated out as Latin punctuation */ - if (strchrW(latin_punc,ch)) + if (strchrW(latin_punc,str[index])) return Script_Punctuation2; /* These chars are itemized as Punctuation by Windows */ - if (ch == 0x2212 || ch == 0x2044) + if (str[index] == 0x2212 || str[index] == 0x2044) return Script_Punctuation; - GetStringTypeW(CT_CTYPE1, &ch, 1, &type); + GetStringTypeW(CT_CTYPE1, &str[index], 1, &type); if (type == 0) return SCRIPT_UNDEFINED; @@ -799,6 +813,12 @@ static WORD get_char_script( WCHAR ch) if (type & C1_CNTRL) return Script_Control; + ch = decode_surrogate_pair(str, index, end); + if (ch) + *consumed = 2; + else + ch = str[index]; + i = 0; do { @@ -1114,6 +1134,7 @@ HRESULT WINAPI ScriptItemizeOpenType(const WCHAR *pwcInChars, int cInChars, int WORD last_indic = -1; WORD layoutRTL = 0; BOOL forceLevels = FALSE; + INT consumed = 0; TRACE("%s,%d,%d,%p,%p,%p,%p\n", debugstr_wn(pwcInChars, cInChars), cInChars, cMaxItems, psControl, psState, pItems, pcItems); @@ -1127,7 +1148,16 @@ HRESULT WINAPI ScriptItemizeOpenType(const WCHAR *pwcInChars, int cInChars, int for (i = 0; i < cInChars; i++) { - scripts[i] = get_char_script(pwcInChars[i]); + if (consumed <= 0) + { + scripts[i] = get_char_script(pwcInChars,i,cInChars,&consumed); + consumed --; + } + else + { + scripts[i] = scripts[i-1]; + consumed --; + } /* Devanagari danda (U+0964) and double danda (U+0965) are used for all Indic scripts */ if ((pwcInChars[i] == 0x964 || pwcInChars[i] ==0x965) && last_indic > 0) @@ -2543,17 +2573,20 @@ HRESULT WINAPI ScriptBreak(const WCHAR *chars, int count, const SCRIPT_ANALYSIS HRESULT WINAPI ScriptIsComplex(const WCHAR *chars, int len, DWORD flag) { int i; + INT consumed = 0; TRACE("(%s,%d,0x%x)\n", debugstr_wn(chars, len), len, flag); - for (i = 0; i < len; i++) + for (i = 0; i < len; i+=consumed) { int script; + if (i >= len) + break; if ((flag & SIC_ASCIIDIGIT) && chars[i] >= 0x30 && chars[i] <= 0x39) return S_OK; - script = get_char_script(chars[i]); + script = get_char_script(chars,i,len, &consumed); if ((scriptInformation[script].props.fComplex && (flag & SIC_COMPLEX))|| (!scriptInformation[script].props.fComplex && (flag & SIC_NEUTRAL))) return S_OK;
1
0
0
0
Aric Stewart : usp10: Code for the cmap format 12 table for unicode code points beyond the BMP.
by Alexandre Julliard
19 Dec '11
19 Dec '11
Module: wine Branch: master Commit: 10ec7dacde5df4698f43feee97cb72e9a64a3025 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=10ec7dacde5df4698f43feee9…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Mon Dec 19 07:25:00 2011 -0600 usp10: Code for the cmap format 12 table for unicode code points beyond the BMP. --- dlls/usp10/shape.c | 117 +++++++++++++++++++++++++++++++++++++++++++ dlls/usp10/usp10.c | 1 + dlls/usp10/usp10_internal.h | 4 ++ 3 files changed, 122 insertions(+), 0 deletions(-) diff --git a/dlls/usp10/shape.c b/dlls/usp10/shape.c index d0ab0b2..e889ba8 100644 --- a/dlls/usp10/shape.c +++ b/dlls/usp10/shape.c @@ -19,6 +19,7 @@ * */ #include <stdarg.h> +#include <stdlib.h> #include "windef.h" #include "winbase.h" @@ -101,8 +102,10 @@ enum joined_forms { #ifdef WORDS_BIGENDIAN #define GET_BE_WORD(x) (x) +#define GET_BE_DWORD(x) (x) #else #define GET_BE_WORD(x) RtlUshortByteSwap(x) +#define GET_BE_DWORD(x) RtlUlongByteSwap(x) #endif /* These are all structures needed for the GSUB table */ @@ -312,6 +315,37 @@ typedef struct { GDEF_ClassRangeRecord ClassRangeRecord[1]; } GDEF_ClassDefFormat2; + +/* These are all structures needed for the cmap format 12 table */ +#define CMAP_TAG MS_MAKE_TAG('c', 'm', 'a', 'p') + +typedef struct { + WORD platformID; + WORD encodingID; + DWORD offset; +} CMAP_EncodingRecord; + +typedef struct { + WORD version; + WORD numTables; + CMAP_EncodingRecord tables[1]; +} CMAP_Header; + +typedef struct { + DWORD startCharCode; + DWORD endCharCode; + DWORD startGlyphID; +} CMAP_SegmentedCoverage_group; + +typedef struct { + WORD format; + WORD reserved; + DWORD length; + DWORD language; + DWORD nGroups; + CMAP_SegmentedCoverage_group groups[1]; +} CMAP_SegmentedCoverage; + static INT GSUB_apply_lookup(const GSUB_LookupList* lookup, INT lookup_index, WORD *glyphs, INT glyph_index, INT write_dir, INT *glyph_count); typedef struct tagVowelComponents @@ -3654,3 +3688,86 @@ HRESULT SHAPE_CheckFontForRequiredFeatures(HDC hdc, ScriptCache *psc, SCRIPT_ANA return USP_E_SCRIPT_NOT_IN_FONT; } + +static VOID *load_CMAP_format12_table(HDC hdc, ScriptCache *psc) +{ + CMAP_Header *CMAP_Table = NULL; + int length; + int i; + + if (!psc->CMAP_Table) + { + length = GetFontData(hdc, CMAP_TAG , 0, NULL, 0); + if (length != GDI_ERROR) + { + psc->CMAP_Table = HeapAlloc(GetProcessHeap(),0,length); + GetFontData(hdc, CMAP_TAG , 0, psc->CMAP_Table, length); + TRACE("Loaded cmap table of %i bytes\n",length); + } + else + return NULL; + } + + CMAP_Table = psc->CMAP_Table; + + for (i = 0; i < GET_BE_WORD(CMAP_Table->numTables); i++) + { + if ( (GET_BE_WORD(CMAP_Table->tables[i].platformID) == 3) && + (GET_BE_WORD(CMAP_Table->tables[i].encodingID) == 10) ) + { + CMAP_SegmentedCoverage *format = (CMAP_SegmentedCoverage*)(((BYTE*)CMAP_Table) + GET_BE_DWORD(CMAP_Table->tables[i].offset)); + if (GET_BE_WORD(format->format) == 12) + return format; + } + } + return NULL; +} + +static int compare_group(const void *a, const void* b) +{ + const DWORD *chr = a; + const CMAP_SegmentedCoverage_group *group = b; + + if (*chr < GET_BE_DWORD(group->startCharCode)) + return -1; + if (*chr > GET_BE_DWORD(group->endCharCode)) + return 1; + return 0; +} + +DWORD CMAP_GetGlyphIndex(HDC hdc, ScriptCache *psc, DWORD utf32c, LPWORD pgi, DWORD flags) +{ + /* BMP: use gdi32 for ease */ + if (utf32c < 0x10000) + { + WCHAR ch = utf32c; + return GetGlyphIndicesW(hdc,&ch, 1, pgi, flags); + } + + if (!psc->CMAP_format12_Table) + psc->CMAP_format12_Table = load_CMAP_format12_table(hdc, psc); + + if (flags & GGI_MARK_NONEXISTING_GLYPHS) + *pgi = 0xffff; + else + *pgi = 0; + + if (psc->CMAP_format12_Table) + { + CMAP_SegmentedCoverage *format = NULL; + CMAP_SegmentedCoverage_group *group = NULL; + + format = (CMAP_SegmentedCoverage *)psc->CMAP_format12_Table; + + group = bsearch(&utf32c, format->groups, GET_BE_DWORD(format->nGroups), + sizeof(CMAP_SegmentedCoverage_group), compare_group); + + if (group) + { + DWORD offset = utf32c - GET_BE_DWORD(group->startCharCode); + *pgi = GET_BE_DWORD(group->startGlyphID) + offset; + return 0; + } + } + return 0; +} diff --git a/dlls/usp10/usp10.c b/dlls/usp10/usp10.c index ad1764a..a0e143e 100644 --- a/dlls/usp10/usp10.c +++ b/dlls/usp10/usp10.c @@ -862,6 +862,7 @@ HRESULT WINAPI ScriptFreeCache(SCRIPT_CACHE *psc) } heap_free(((ScriptCache *)*psc)->GSUB_Table); heap_free(((ScriptCache *)*psc)->GDEF_Table); + heap_free(((ScriptCache *)*psc)->CMAP_Table); heap_free(((ScriptCache *)*psc)->features); heap_free(*psc); *psc = NULL; diff --git a/dlls/usp10/usp10_internal.h b/dlls/usp10/usp10_internal.h index 1692b60..f310011 100644 --- a/dlls/usp10/usp10_internal.h +++ b/dlls/usp10/usp10_internal.h @@ -129,6 +129,8 @@ typedef struct { ABC *widths[GLYPH_MAX / GLYPH_BLOCK_SIZE]; LPVOID GSUB_Table; LPVOID GDEF_Table; + LPVOID CMAP_Table; + LPVOID CMAP_format12_Table; INT feature_count; LoadedFeature *features; @@ -181,3 +183,5 @@ void Indic_ReorderCharacters( HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache* psc, L void Indic_ParseSyllables( HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache* psc, LPCWSTR input, const int cChar, IndicSyllable **syllables, int *syllable_count, lexical_function lex, BOOL modern); void BREAK_line(const WCHAR *chars, int count, const SCRIPT_ANALYSIS *sa, SCRIPT_LOGATTR *la) DECLSPEC_HIDDEN; + +DWORD CMAP_GetGlyphIndex(HDC hdc, ScriptCache *psc, DWORD utf32c, LPWORD pgi, DWORD flags) DECLSPEC_HIDDEN;
1
0
0
0
← Newer
1
...
28
29
30
31
32
33
34
...
81
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
Results per page:
10
25
50
100
200