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
July 2012
----- 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
712 discussions
Start a n
N
ew thread
Erich Hoover : hhctrl.ocx: Implement HH_CLOSE_ALL.
by Alexandre Julliard
16 Jul '12
16 Jul '12
Module: wine Branch: master Commit: 97bcef997fdd53137ab250448ac15bb9d4b40ee3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=97bcef997fdd53137ab250448…
Author: Erich Hoover <ehoover(a)mines.edu> Date: Thu Jul 12 10:21:36 2012 -0600 hhctrl.ocx: Implement HH_CLOSE_ALL. --- dlls/hhctrl.ocx/chm.c | 6 ++++-- dlls/hhctrl.ocx/help.c | 5 +++++ dlls/hhctrl.ocx/hhctrl.c | 31 +++++++++++++++++++++++++------ dlls/hhctrl.ocx/hhctrl.h | 3 +++ 4 files changed, 37 insertions(+), 8 deletions(-) diff --git a/dlls/hhctrl.ocx/chm.c b/dlls/hhctrl.ocx/chm.c index cc92b89..82b8d9a 100644 --- a/dlls/hhctrl.ocx/chm.c +++ b/dlls/hhctrl.ocx/chm.c @@ -138,7 +138,8 @@ static BOOL ReadChmSystem(CHMInfo *chm) chm->codePage = CP_ACP; break; case 0x5: - TRACE("Default window is %s\n", debugstr_an(buf, entry.len)); + TRACE("Window name is %s\n", debugstr_an(buf, entry.len)); + chm->defWindow = strdupnAtoW(buf, entry.len); break; case 0x6: TRACE("Compiled file is %s\n", debugstr_an(buf, entry.len)); @@ -268,7 +269,7 @@ BOOL LoadWinTypeFromCHM(HHInfo *info) memset((void*)&(info->WinType), 0, sizeof(info->WinType)); info->WinType.cbStruct=sizeof(info->WinType); info->WinType.fUniCodeStrings=TRUE; - info->WinType.pszType=strdupW(defaultwinW); + info->WinType.pszType = strdupW(info->pCHMInfo->defWindow ? info->pCHMInfo->defWindow : defaultwinW); info->WinType.pszToc = strdupW(info->pCHMInfo->defToc ? info->pCHMInfo->defToc : null); info->WinType.pszIndex = strdupW(null); info->WinType.fsValidMembers=0; @@ -530,6 +531,7 @@ CHMInfo *CloseCHM(CHMInfo *chm) } heap_free(chm->strings); + heap_free(chm->defWindow); heap_free(chm->defTitle); heap_free(chm->defTopic); heap_free(chm->defToc); diff --git a/dlls/hhctrl.ocx/help.c b/dlls/hhctrl.ocx/help.c index 87ea94f..2f2fba1 100644 --- a/dlls/hhctrl.ocx/help.c +++ b/dlls/hhctrl.ocx/help.c @@ -48,6 +48,8 @@ static void ExpandContract(HHInfo *pHHInfo); #define TAB_MARGIN 8 #define EDIT_HEIGHT 20 +struct list window_list = LIST_INIT(window_list); + static const WCHAR szEmpty[] = {0}; struct html_encoded_symbol { @@ -1740,6 +1742,8 @@ void ReleaseHelpViewer(HHInfo *info) if (!info) return; + list_remove(&info->entry); + /* Free allocated strings */ heap_free(info->pszType); heap_free(info->pszCaption); @@ -1798,6 +1802,7 @@ HHInfo *CreateHelpViewer(LPCWSTR filename) return NULL; } + list_add_tail(&window_list, &info->entry); return info; } diff --git a/dlls/hhctrl.ocx/hhctrl.c b/dlls/hhctrl.ocx/hhctrl.c index 7647abb..a5e7e37 100644 --- a/dlls/hhctrl.ocx/hhctrl.c +++ b/dlls/hhctrl.ocx/hhctrl.c @@ -41,6 +41,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(htmlhelp); HINSTANCE hhctrl_hinstance; BOOL hh_process = FALSE; +extern struct list window_list; + BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD fdwReason, LPVOID lpvReserved) { TRACE("(%p,%d,%p)\n", hInstance, fdwReason, lpvReserved); @@ -98,7 +100,7 @@ static const char *command_to_string(UINT command) #undef X } -static BOOL resolve_filename(const WCHAR *filename, WCHAR *fullname, DWORD buflen, const WCHAR **index, const WCHAR **window) +static BOOL resolve_filename(const WCHAR *filename, WCHAR *fullname, DWORD buflen, WCHAR **index, WCHAR **window) { const WCHAR *extra; WCHAR chm_file[MAX_PATH]; @@ -164,14 +166,15 @@ HWND WINAPI HtmlHelpW(HWND caller, LPCWSTR filename, UINT command, DWORD_PTR dat HHInfo *info; BOOL res; NMHDR nmhdr; + WCHAR *window = NULL; const WCHAR *index = NULL; + WCHAR *default_index = NULL; int tab_index = TAB_CONTENTS; - const WCHAR *default_index = NULL; if (!filename) return NULL; - if (!resolve_filename(filename, fullname, MAX_PATH, &default_index, NULL)) + if (!resolve_filename(filename, fullname, MAX_PATH, &default_index, &window)) { WARN("can't find %s\n", debugstr_w(filename)); return 0; @@ -180,10 +183,18 @@ HWND WINAPI HtmlHelpW(HWND caller, LPCWSTR filename, UINT command, DWORD_PTR dat info = CreateHelpViewer(fullname); if(!info) + { + heap_free(default_index); + heap_free(window); return NULL; + } if(!index) index = info->WinType.pszFile; + if(!info->pszType) + info->WinType.pszType = info->pszType = window; + else + heap_free(window); /* called to load a specified topic */ switch(command) @@ -196,9 +207,7 @@ HWND WINAPI HtmlHelpW(HWND caller, LPCWSTR filename, UINT command, DWORD_PTR dat } res = NavigateToChm(info, info->pCHMInfo->szFile, index); - - if (default_index) - heap_free((WCHAR*)default_index); + heap_free(default_index); if(!res) { @@ -269,6 +278,16 @@ HWND WINAPI HtmlHelpW(HWND caller, LPCWSTR filename, UINT command, DWORD_PTR dat } return 0; } + case HH_CLOSE_ALL: { + HHInfo *info, *next; + + LIST_FOR_EACH_ENTRY_SAFE(info, next, &window_list, HHInfo, entry) + { + TRACE("Destroying window %s.\n", debugstr_w(info->WinType.pszType)); + ReleaseHelpViewer(info); + } + return 0; + } default: FIXME("HH case %s not handled.\n", command_to_string( command )); } diff --git a/dlls/hhctrl.ocx/hhctrl.h b/dlls/hhctrl.ocx/hhctrl.h index 8959748..f03d476 100644 --- a/dlls/hhctrl.ocx/hhctrl.h +++ b/dlls/hhctrl.ocx/hhctrl.h @@ -40,6 +40,7 @@ #include "wine/itss.h" #include "wine/unicode.h" +#include "wine/list.h" #define WB_GOBACK 0 #define WB_GOFORWARD 1 @@ -103,6 +104,7 @@ typedef struct CHMInfo DWORD strings_size; WCHAR *compiledFile; + WCHAR *defWindow; WCHAR *defTopic; WCHAR *defTitle; WCHAR *defToc; @@ -157,6 +159,7 @@ typedef struct { LPWSTR pszUrlJump2; LPWSTR pszCustomTabs; + struct list entry; CHMInfo *pCHMInfo; ContentItem *content; IndexItem *index;
1
0
0
0
Aric Stewart : usp10: Implement GPOS Pair Adjustment Positioning Subtable.
by Alexandre Julliard
16 Jul '12
16 Jul '12
Module: wine Branch: master Commit: 5a45e3474141536b02cfc4e924be3aacbd6ad2c5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5a45e3474141536b02cfc4e92…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Mon Jul 16 07:24:16 2012 -0500 usp10: Implement GPOS Pair Adjustment Positioning Subtable. --- dlls/usp10/opentype.c | 112 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 112 insertions(+), 0 deletions(-) diff --git a/dlls/usp10/opentype.c b/dlls/usp10/opentype.c index b3913bf..9ffdf28 100644 --- a/dlls/usp10/opentype.c +++ b/dlls/usp10/opentype.c @@ -334,6 +334,26 @@ typedef struct { typedef struct { WORD PosFormat; + WORD Coverage; + WORD ValueFormat1; + WORD ValueFormat2; + WORD PairSetCount; + WORD PairSetOffset[1]; +} GPOS_PairPosFormat1; + +typedef struct { + WORD SecondGlyph; + WORD Value1[1]; + WORD Value2[1]; +} GPOS_PairValueRecord; + +typedef struct { + WORD PairValueCount; + GPOS_PairValueRecord PairValueRecord[1]; +} GPOS_PairSet; + +typedef struct { + WORD PosFormat; WORD MarkCoverage; WORD BaseCoverage; WORD ClassCount; @@ -1083,6 +1103,67 @@ static VOID GPOS_apply_SingleAdjustment(const OT_LookupTable *look, const WORD * } } +static INT GPOS_apply_PairAdjustment(const OT_LookupTable *look, const WORD *glyphs, INT glyph_index, INT write_dir, INT glyph_count, INT ppem, LPPOINT ptAdjust, LPPOINT ptAdvance) +{ + int j; + + TRACE("Pair Adjustment Positioning Subtable\n"); + + for (j = 0; j < GET_BE_WORD(look->SubTableCount); j++) + { + const GPOS_PairPosFormat1 *ppf1; + WORD offset = GET_BE_WORD(look->SubTable[j]); + ppf1 = (const GPOS_PairPosFormat1*)((const BYTE*)look+offset); + if (GET_BE_WORD(ppf1->PosFormat) == 1) + { + offset = GET_BE_WORD(ppf1->Coverage); + if (GSUB_is_glyph_covered((const BYTE*)ppf1+offset, glyphs[glyph_index]) != -1) + { + int i; + int count = GET_BE_WORD(ppf1->PairSetCount); + for (i = 0; i < count; i++) + { + int k; + int pair_count; + const GPOS_PairSet *ps; + offset = GET_BE_WORD(ppf1->PairSetOffset[i]); + ps = (const GPOS_PairSet*)((const BYTE*)ppf1+offset); + pair_count = GET_BE_WORD(ps->PairValueCount); + for (k = 0; k < pair_count; k++) + { + if (glyphs[glyph_index+write_dir] == GET_BE_WORD(ps->PairValueRecord[k].SecondGlyph)) + { + GPOS_ValueRecord ValueRecord1 = {0,0,0,0,0,0,0,0}; + GPOS_ValueRecord ValueRecord2 = {0,0,0,0,0,0,0,0}; + WORD ValueFormat1 = GET_BE_WORD(ppf1->ValueFormat1); + WORD ValueFormat2 = GET_BE_WORD(ppf1->ValueFormat2); + + TRACE("Format 1: Found Pair %x,%x\n",glyphs[glyph_index],glyphs[glyph_index+write_dir]); + + offset = GPOS_get_value_record(ValueFormat1, ps->PairValueRecord[k].Value1, &ValueRecord1); + GPOS_get_value_record(ValueFormat2, (WORD*)((const BYTE*)(ps->PairValueRecord[k].Value2)+offset), &ValueRecord2); + if (ValueFormat1) + { + GPOS_get_value_record_offsets((const BYTE*)ppf1, &ValueRecord1, ValueFormat1, ppem, &ptAdjust[0], &ptAdvance[0]); + TRACE("Glyph 1 resulting cumulative offset is %i,%i design units\n",ptAdjust[0].x,ptAdjust[0].y); + } + if (ValueFormat2) + { + GPOS_get_value_record_offsets((const BYTE*)ppf1, &ValueRecord2, ValueFormat2, ppem, &ptAdjust[1], &ptAdvance[1]); + TRACE("Glyph 2 resulting cumulative offset is %i,%i design units\n",ptAdjust[1].x,ptAdjust[1].y); + return glyph_index+2; + } + } + } + } + } + } + else + FIXME("Pair Adjustment Positioning: Format %i Unhandled\n",GET_BE_WORD(ppf1->PosFormat)); + } + return glyph_index+1; +} + static VOID GPOS_apply_MarkToBase(const OT_LookupTable *look, const WORD *glyphs, INT glyph_index, INT write_dir, INT glyph_count, INT ppem, LPPOINT pt) { int j; @@ -1179,6 +1260,37 @@ static INT GPOS_apply_lookup(LPOUTLINETEXTMETRICW lpotm, LPLOGFONTW lplogfont, I FIXME("Unhandled adjustment to Y advancement\n"); } } + case 2: + { + POINT advance[2]= {{0,0},{0,0}}; + POINT adjust[2]= {{0,0},{0,0}}; + double devX, devY; + int index; + index = GPOS_apply_PairAdjustment(look, glyphs, glyph_index, write_dir, glyph_count, ppem, adjust, advance); + if (adjust[0].x || adjust[0].y) + { + GPOS_convert_design_units_to_device(lpotm, lplogfont, adjust[0].x, adjust[0].y, &devX, &devY); + pGoffset[glyph_index].du += (int)(devX+0.5); + pGoffset[glyph_index].dv += (int)(devY+0.5); + } + if (advance[0].x || advance[0].y) + { + GPOS_convert_design_units_to_device(lpotm, lplogfont, advance[0].x, advance[0].y, &devX, &devY); + piAdvance[glyph_index] += (int)(devX+0.5); + } + if (adjust[1].x || adjust[1].y) + { + GPOS_convert_design_units_to_device(lpotm, lplogfont, adjust[1].x, adjust[1].y, &devX, &devY); + pGoffset[glyph_index + write_dir].du += (int)(devX+0.5); + pGoffset[glyph_index + write_dir].dv += (int)(devY+0.5); + } + if (advance[1].x || advance[1].y) + { + GPOS_convert_design_units_to_device(lpotm, lplogfont, advance[1].x, advance[1].y, &devX, &devY); + piAdvance[glyph_index + write_dir] += (int)(devX+0.5); + } + return index; + } case 4: { double devX, devY;
1
0
0
0
Aric Stewart : usp10: Implement GPOS Single Adjustment Positioning.
by Alexandre Julliard
16 Jul '12
16 Jul '12
Module: wine Branch: master Commit: e3a98b437ba1aede1b6139a2f20c9519887d2801 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e3a98b437ba1aede1b6139a2f…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Mon Jul 16 07:24:13 2012 -0500 usp10: Implement GPOS Single Adjustment Positioning. --- dlls/usp10/opentype.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 55 insertions(+), 0 deletions(-) diff --git a/dlls/usp10/opentype.c b/dlls/usp10/opentype.c index 70d0da7..b3913bf 100644 --- a/dlls/usp10/opentype.c +++ b/dlls/usp10/opentype.c @@ -327,6 +327,13 @@ typedef struct { typedef struct { WORD PosFormat; + WORD Coverage; + WORD ValueFormat; + WORD Value[1]; +} GPOS_SinglePosFormat1; + +typedef struct { + WORD PosFormat; WORD MarkCoverage; WORD BaseCoverage; WORD ClassCount; @@ -1048,6 +1055,34 @@ static VOID GPOS_get_value_record_offsets(const BYTE* head, GPOS_ValueRecord *Va if (ValueFormat & 0xFF00) FIXME("Unhandled Value Format %x\n",ValueFormat&0xFF00); } +static VOID GPOS_apply_SingleAdjustment(const OT_LookupTable *look, const WORD *glyphs, INT glyph_index, INT write_dir, INT glyph_count, INT ppem, LPPOINT ptAdjust, LPPOINT ptAdvance) +{ + int j; + + TRACE("Single Adjustment Positioning Subtable\n"); + + for (j = 0; j < GET_BE_WORD(look->SubTableCount); j++) + { + const GPOS_SinglePosFormat1 *spf1; + WORD offset = GET_BE_WORD(look->SubTable[j]); + spf1 = (const GPOS_SinglePosFormat1*)((const BYTE*)look+offset); + if (GET_BE_WORD(spf1->PosFormat == 1)) + { + offset = GET_BE_WORD(spf1->Coverage); + if (GSUB_is_glyph_covered((const BYTE*)spf1+offset, glyphs[glyph_index]) != -1) + { + GPOS_ValueRecord ValueRecord = {0,0,0,0,0,0,0,0}; + WORD ValueFormat = GET_BE_WORD(spf1->ValueFormat); + GPOS_get_value_record(ValueFormat, spf1->Value, &ValueRecord); + GPOS_get_value_record_offsets((const BYTE*)spf1, &ValueRecord, ValueFormat, ppem, ptAdjust, ptAdvance); + TRACE("Glyph Adjusted by %i,%i\n",ValueRecord.XPlacement,ValueRecord.YPlacement); + } + } + else + FIXME("Single Adjustment Positioning: Format 2 Unhandled\n"); + } +} + static VOID GPOS_apply_MarkToBase(const OT_LookupTable *look, const WORD *glyphs, INT glyph_index, INT write_dir, INT glyph_count, INT ppem, LPPOINT pt) { int j; @@ -1124,6 +1159,26 @@ static INT GPOS_apply_lookup(LPOUTLINETEXTMETRICW lpotm, LPLOGFONTW lplogfont, I TRACE("type %i, flag %x, subtables %i\n",GET_BE_WORD(look->LookupType),GET_BE_WORD(look->LookupFlag),GET_BE_WORD(look->SubTableCount)); switch(GET_BE_WORD(look->LookupType)) { + case 1: + { + double devX, devY; + POINT adjust = {0,0}; + POINT advance = {0,0}; + GPOS_apply_SingleAdjustment(look, glyphs, glyph_index, write_dir, glyph_count, ppem, &adjust, &advance); + if (adjust.x || adjust.y) + { + GPOS_convert_design_units_to_device(lpotm, lplogfont, adjust.x, adjust.y, &devX, &devY); + pGoffset[glyph_index].du += (int)(devX+0.5); + pGoffset[glyph_index].dv += (int)(devY+0.5); + } + if (advance.x || advance.y) + { + GPOS_convert_design_units_to_device(lpotm, lplogfont, advance.x, advance.y, &devX, &devY); + piAdvance[glyph_index] += (int)(devX+0.5); + if (advance.y) + FIXME("Unhandled adjustment to Y advancement\n"); + } + } case 4: { double devX, devY;
1
0
0
0
Aric Stewart : usp10: Handle GPOS ValueRecords.
by Alexandre Julliard
16 Jul '12
16 Jul '12
Module: wine Branch: master Commit: 1dc148d7cc0a95815c350edbf026bfe3e5258989 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1dc148d7cc0a95815c350edbf…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Mon Jul 16 07:24:09 2012 -0500 usp10: Handle GPOS ValueRecords. --- dlls/usp10/opentype.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 files changed, 38 insertions(+), 0 deletions(-) diff --git a/dlls/usp10/opentype.c b/dlls/usp10/opentype.c index 093dab7..70d0da7 100644 --- a/dlls/usp10/opentype.c +++ b/dlls/usp10/opentype.c @@ -315,6 +315,17 @@ typedef struct { } GPOS_AnchorFormat3; typedef struct { + WORD XPlacement; + WORD YPlacement; + WORD XAdvance; + WORD YAdvance; + WORD XPlaDevice; + WORD YPlaDevice; + WORD XAdvDevice; + WORD YAdvDevice; +} GPOS_ValueRecord; + +typedef struct { WORD PosFormat; WORD MarkCoverage; WORD BaseCoverage; @@ -1010,6 +1021,33 @@ static void GPOS_convert_design_units_to_device(LPOUTLINETEXTMETRICW lpotm, LPLO FIXME("Font with lfWidth set no handled properly\n"); } +static INT GPOS_get_value_record(WORD ValueFormat, const WORD data[], GPOS_ValueRecord *record) +{ + INT offset = 0; + if (ValueFormat & 0x0001) record->XPlacement = GET_BE_WORD(data[offset++]); + if (ValueFormat & 0x0002) record->YPlacement = GET_BE_WORD(data[offset++]); + if (ValueFormat & 0x0004) record->XAdvance = GET_BE_WORD(data[offset++]); + if (ValueFormat & 0x0008) record->YAdvance = GET_BE_WORD(data[offset++]); + if (ValueFormat & 0x0010) record->XPlaDevice = GET_BE_WORD(data[offset++]); + if (ValueFormat & 0x0020) record->YPlaDevice = GET_BE_WORD(data[offset++]); + if (ValueFormat & 0x0040) record->XAdvDevice = GET_BE_WORD(data[offset++]); + if (ValueFormat & 0x0080) record->YAdvDevice = GET_BE_WORD(data[offset++]); + return offset; +} + +static VOID GPOS_get_value_record_offsets(const BYTE* head, GPOS_ValueRecord *ValueRecord, WORD ValueFormat, INT ppem, LPPOINT ptPlacement, LPPOINT ptAdvance) +{ + if (ValueFormat & 0x0001) ptPlacement->x += (short)ValueRecord->XPlacement; + if (ValueFormat & 0x0002) ptPlacement->y += (short)ValueRecord->YPlacement; + if (ValueFormat & 0x0004) ptAdvance->x += (short)ValueRecord->XAdvance; + if (ValueFormat & 0x0008) ptAdvance->y += (short)ValueRecord->YAdvance; + if (ValueFormat & 0x0010) ptPlacement->x += GPOS_get_device_table_value((const OT_DeviceTable*)(head + ValueRecord->XPlaDevice), ppem); + if (ValueFormat & 0x0020) ptPlacement->y += GPOS_get_device_table_value((const OT_DeviceTable*)(head + ValueRecord->YPlaDevice), ppem); + if (ValueFormat & 0x0040) ptAdvance->x += GPOS_get_device_table_value((const OT_DeviceTable*)(head + ValueRecord->XAdvDevice), ppem); + if (ValueFormat & 0x0080) ptAdvance->y += GPOS_get_device_table_value((const OT_DeviceTable*)(head + ValueRecord->YAdvDevice), ppem); + if (ValueFormat & 0xFF00) FIXME("Unhandled Value Format %x\n",ValueFormat&0xFF00); +} + static VOID GPOS_apply_MarkToBase(const OT_LookupTable *look, const WORD *glyphs, INT glyph_index, INT write_dir, INT glyph_count, INT ppem, LPPOINT pt) { int j;
1
0
0
0
Aric Stewart : usp10: Implement GPOS MarkToBase.
by Alexandre Julliard
16 Jul '12
16 Jul '12
Module: wine Branch: master Commit: 85c9984389ba17ee98f72265adc2d8aee6e0996d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=85c9984389ba17ee98f72265a…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Mon Jul 16 07:24:06 2012 -0500 usp10: Implement GPOS MarkToBase. --- dlls/usp10/opentype.c | 118 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 118 insertions(+), 0 deletions(-) diff --git a/dlls/usp10/opentype.c b/dlls/usp10/opentype.c index 8434789..093dab7 100644 --- a/dlls/usp10/opentype.c +++ b/dlls/usp10/opentype.c @@ -314,6 +314,34 @@ typedef struct { WORD YDeviceTable; } GPOS_AnchorFormat3; +typedef struct { + WORD PosFormat; + WORD MarkCoverage; + WORD BaseCoverage; + WORD ClassCount; + WORD MarkArray; + WORD BaseArray; +} GPOS_MarkBasePosFormat1; + +typedef struct { + WORD BaseAnchor[1]; +} GPOS_BaseRecord; + +typedef struct { + WORD BaseCount; + GPOS_BaseRecord BaseRecord[1]; +} GPOS_BaseArray; + +typedef struct { + WORD Class; + WORD MarkAnchor; +} GPOS_MarkRecord; + +typedef struct { + WORD MarkCount; + GPOS_MarkRecord MarkRecord[1]; +} GPOS_MarkArray; + /********** * CMAP **********/ @@ -971,16 +999,106 @@ static VOID GPOS_get_anchor_values(LPCVOID table, LPPOINT pt, WORD ppem) } } +static void GPOS_convert_design_units_to_device(LPOUTLINETEXTMETRICW lpotm, LPLOGFONTW lplogfont, int desX, int desY, double *devX, double *devY) +{ + int emHeight = lpotm->otmTextMetrics.tmAscent + lpotm->otmTextMetrics.tmDescent - lpotm->otmTextMetrics.tmInternalLeading; + + TRACE("emHeight %i lfWidth %i\n",emHeight, lplogfont->lfWidth); + *devX = (desX * emHeight) / (double)lpotm->otmEMSquare; + *devY = (desY * emHeight) / (double)lpotm->otmEMSquare; + if (lplogfont->lfWidth) + FIXME("Font with lfWidth set no handled properly\n"); +} + +static VOID GPOS_apply_MarkToBase(const OT_LookupTable *look, const WORD *glyphs, INT glyph_index, INT write_dir, INT glyph_count, INT ppem, LPPOINT pt) +{ + int j; + + TRACE("MarkToBase Attachment Positioning Subtable\n"); + + for (j = 0; j < GET_BE_WORD(look->SubTableCount); j++) + { + int offset; + const GPOS_MarkBasePosFormat1 *mbpf1; + offset = GET_BE_WORD(look->SubTable[j]); + mbpf1 = (const GPOS_MarkBasePosFormat1*)((const BYTE*)look+offset); + if (GET_BE_WORD(mbpf1->PosFormat) == 1) + { + int offset = GET_BE_WORD(mbpf1->MarkCoverage); + int mark_index; + mark_index = GSUB_is_glyph_covered((const BYTE*)mbpf1+offset, glyphs[glyph_index]); + if (mark_index != -1) + { + int base_index; + offset = GET_BE_WORD(mbpf1->BaseCoverage); + base_index = GSUB_is_glyph_covered((const BYTE*)mbpf1+offset, glyphs[glyph_index - write_dir]); + if (base_index != -1) + { + const GPOS_MarkArray *ma; + const GPOS_MarkRecord *mr; + const GPOS_BaseArray *ba; + const GPOS_BaseRecord *br; + int mark_class; + int class_count = GET_BE_WORD(mbpf1->ClassCount); + int baserecord_size; + POINT base_pt; + POINT mark_pt; + TRACE("Mark %x(%i) and base %x(%i)\n",glyphs[glyph_index], mark_index, glyphs[glyph_index - write_dir], base_index); + offset = GET_BE_WORD(mbpf1->MarkArray); + ma = (const GPOS_MarkArray*)((const BYTE*)mbpf1 + offset); + if (mark_index > GET_BE_WORD(ma->MarkCount)) + { + ERR("Mark index exeeded mark count\n"); + return; + } + mr = &ma->MarkRecord[mark_index]; + mark_class = GET_BE_WORD(mr->Class); + TRACE("Mark Class %i total classes %i\n",mark_class,class_count); + offset = GET_BE_WORD(mbpf1->BaseArray); + ba = (const GPOS_BaseArray*)((const BYTE*)mbpf1 + offset); + baserecord_size = class_count * sizeof(WORD); + br = (const GPOS_BaseRecord*)((const BYTE*)ba + sizeof(WORD) + (baserecord_size * base_index)); + offset = GET_BE_WORD(br->BaseAnchor[mark_class]); + GPOS_get_anchor_values((const BYTE*)ba + offset, &base_pt, ppem); + offset = GET_BE_WORD(mr->MarkAnchor); + GPOS_get_anchor_values((const BYTE*)ma + offset, &mark_pt, ppem); + TRACE("Offset on base is %i,%i design units\n",base_pt.x,base_pt.y); + TRACE("Offset on mark is %i,%i design units\n",mark_pt.x, mark_pt.y); + pt->x += base_pt.x - mark_pt.x; + pt->y += base_pt.y - mark_pt.y; + TRACE("Resulting cumulative offset is %i,%i design units\n",pt->x,pt->y); + } + } + } + else + FIXME("Unhandled Mark To Base Format %i\n",GET_BE_WORD(mbpf1->PosFormat)); + } +} + static INT GPOS_apply_lookup(LPOUTLINETEXTMETRICW lpotm, LPLOGFONTW lplogfont, INT* piAdvance, const OT_LookupList* lookup, INT lookup_index, const WORD *glyphs, INT glyph_index, INT write_dir, INT glyph_count, GOFFSET *pGoffset) { int offset; const OT_LookupTable *look; + int ppem = lpotm->otmTextMetrics.tmAscent + lpotm->otmTextMetrics.tmDescent - lpotm->otmTextMetrics.tmInternalLeading; offset = GET_BE_WORD(lookup->Lookup[lookup_index]); look = (const OT_LookupTable*)((const BYTE*)lookup + offset); TRACE("type %i, flag %x, subtables %i\n",GET_BE_WORD(look->LookupType),GET_BE_WORD(look->LookupFlag),GET_BE_WORD(look->SubTableCount)); switch(GET_BE_WORD(look->LookupType)) { + case 4: + { + double devX, devY; + POINT desU = {0,0}; + GPOS_apply_MarkToBase(look, glyphs, glyph_index, write_dir, glyph_count, ppem, &desU); + if (desU.x || desU.y) + { + GPOS_convert_design_units_to_device(lpotm, lplogfont, desU.x, desU.y, &devX, &devY); + pGoffset[glyph_index].du += ((int)(devX+0.5) - piAdvance[glyph_index-1]); + pGoffset[glyph_index].dv += (int)(devY+0.5); + } + break; + } default: FIXME("We do not handle SubType %i\n",GET_BE_WORD(look->LookupType)); }
1
0
0
0
Aric Stewart : usp10: In ScriptTextOut make use of piAdvance and pGoffset to position glyphs.
by Alexandre Julliard
16 Jul '12
16 Jul '12
Module: wine Branch: master Commit: b65d0b96ce31c0e9f1cfbbe34fa4c4a822e8d74f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b65d0b96ce31c0e9f1cfbbe34…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Mon Jul 16 07:24:02 2012 -0500 usp10: In ScriptTextOut make use of piAdvance and pGoffset to position glyphs. --- dlls/usp10/usp10.c | 47 +++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 45 insertions(+), 2 deletions(-) diff --git a/dlls/usp10/usp10.c b/dlls/usp10/usp10.c index 0b53599..9659e66 100644 --- a/dlls/usp10/usp10.c +++ b/dlls/usp10/usp10.c @@ -3176,6 +3176,8 @@ HRESULT WINAPI ScriptTextOut(const HDC hdc, SCRIPT_CACHE *psc, int x, int y, UIN const int *piJustify, const GOFFSET *pGoffset) { HRESULT hr = S_OK; + INT i; + INT *lpDx; TRACE("(%p, %p, %d, %d, %04x, %p, %p, %p, %d, %p, %d, %p, %p, %p)\n", hdc, psc, x, y, fuOptions, lprc, psa, pwcReserved, iReserved, pwGlyphs, cGlyphs, @@ -3189,6 +3191,45 @@ HRESULT WINAPI ScriptTextOut(const HDC hdc, SCRIPT_CACHE *psc, int x, int y, UIN if (!psa->fNoGlyphIndex) /* Have Glyphs? */ fuOptions |= ETO_GLYPH_INDEX; /* Say don't do translation to glyph */ + lpDx = heap_alloc(cGlyphs * sizeof(INT) * 2); + + if (pGoffset) + { + for (i = 0; i < cGlyphs; i++) + if (!(fuOptions&ETO_PDY) && pGoffset[i].dv) + fuOptions |= ETO_PDY; + } + for (i = 0; i < cGlyphs; i++) + { + int idx = i; + if (fuOptions&ETO_PDY) + { + idx *=2; + lpDx[idx+1] = 0; + } + lpDx[idx] = piAdvance[i]; + } + if (pGoffset) + { + for (i = 1; i < cGlyphs; i++) + { + int idx = i; + int prev_idx = i-1; + if (fuOptions&ETO_PDY) + { + idx*=2; + prev_idx = idx-2; + } + lpDx[prev_idx] += pGoffset[i].du; + lpDx[idx] -= pGoffset[i].du; + if (fuOptions&ETO_PDY) + { + lpDx[prev_idx+1] += pGoffset[i].dv; + lpDx[idx+1] -= pGoffset[i].dv; + } + } + } + if (psa->fRTL && psa->fLogicalOrder) { int i; @@ -3201,14 +3242,16 @@ HRESULT WINAPI ScriptTextOut(const HDC hdc, SCRIPT_CACHE *psc, int x, int y, UIN for (i = 0; i < cGlyphs; i++) rtlGlyphs[i] = pwGlyphs[cGlyphs-1-i]; - if (!ExtTextOutW(hdc, x, y, fuOptions, lprc, rtlGlyphs, cGlyphs, NULL)) + if (!ExtTextOutW(hdc, x, y, fuOptions, lprc, rtlGlyphs, cGlyphs, lpDx)) hr = S_FALSE; heap_free(rtlGlyphs); } else - if (!ExtTextOutW(hdc, x, y, fuOptions, lprc, pwGlyphs, cGlyphs, NULL)) + if (!ExtTextOutW(hdc, x, y, fuOptions, lprc, pwGlyphs, cGlyphs, lpDx)) hr = S_FALSE; + heap_free(lpDx); + return hr; }
1
0
0
0
Aric Stewart : usp10: Add GPOS features to scripts as defined by VOLT.
by Alexandre Julliard
16 Jul '12
16 Jul '12
Module: wine Branch: master Commit: f70864b827a96a1d0549958b927b3e553c51ec07 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f70864b827a96a1d0549958b9…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Mon Jul 16 07:23:57 2012 -0500 usp10: Add GPOS features to scripts as defined by VOLT. --- dlls/usp10/shape.c | 147 ++++++++++++++++++++++++++++++++++++---------------- 1 files changed, 102 insertions(+), 45 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=f70864b827a96a1d05499…
1
0
0
0
Aric Stewart : usp10: Implement GPOS Anchor formats.
by Alexandre Julliard
16 Jul '12
16 Jul '12
Module: wine Branch: master Commit: 69351a9cea4f48fe7e4f907bad89d5714094f6fc URL:
http://source.winehq.org/git/wine.git/?a=commit;h=69351a9cea4f48fe7e4f907ba…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Mon Jul 16 07:23:53 2012 -0500 usp10: Implement GPOS Anchor formats. --- dlls/usp10/opentype.c | 98 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 98 insertions(+), 0 deletions(-) diff --git a/dlls/usp10/opentype.c b/dlls/usp10/opentype.c index b875594..8434789 100644 --- a/dlls/usp10/opentype.c +++ b/dlls/usp10/opentype.c @@ -286,6 +286,34 @@ typedef struct { WORD LookupList; } GPOS_Header; +typedef struct { + WORD StartSize; + WORD EndSize; + WORD DeltaFormat; + WORD DeltaValue[1]; +} OT_DeviceTable; + +typedef struct { + WORD AnchorFormat; + WORD XCoordinate; + WORD YCoordinate; +} GPOS_AnchorFormat1; + +typedef struct { + WORD AnchorFormat; + WORD XCoordinate; + WORD YCoordinate; + WORD AnchorPoint; +} GPOS_AnchorFormat2; + +typedef struct { + WORD AnchorFormat; + WORD XCoordinate; + WORD YCoordinate; + WORD XDeviceTable; + WORD YDeviceTable; +} GPOS_AnchorFormat3; + /********** * CMAP **********/ @@ -872,6 +900,76 @@ INT OpenType_apply_GSUB_lookup(LPCVOID table, INT lookup_index, WORD *glyphs, IN /********** * GPOS **********/ +static INT GPOS_get_device_table_value(const OT_DeviceTable *DeviceTable, WORD ppem) +{ + static const WORD mask[3] = {3,0xf,0xff}; + if (DeviceTable && ppem >= GET_BE_WORD(DeviceTable->StartSize) && ppem <= GET_BE_WORD(DeviceTable->EndSize)) + { + int format = GET_BE_WORD(DeviceTable->DeltaFormat); + int index = ppem - GET_BE_WORD(DeviceTable->StartSize); + int value; + TRACE("device table, format %i, index %i\n",format, index); + index = index << format; + value = (DeviceTable->DeltaValue[index/sizeof(WORD)] << (index%sizeof(WORD)))&mask[format-1]; + TRACE("offset %i, value %i\n",index, value); + if (value > mask[format-1]/2) + value = -1 * ((mask[format-1]+1) - value); + return value; + } + return 0; +} + +static VOID GPOS_get_anchor_values(LPCVOID table, LPPOINT pt, WORD ppem) +{ + const GPOS_AnchorFormat1* anchor1 = (const GPOS_AnchorFormat1*)table; + + switch (GET_BE_WORD(anchor1->AnchorFormat)) + { + case 1: + { + TRACE("Anchor Format 1\n"); + pt->x = (short)GET_BE_WORD(anchor1->XCoordinate); + pt->y = (short)GET_BE_WORD(anchor1->YCoordinate); + break; + } + case 2: + { + const GPOS_AnchorFormat2* anchor2 = (const GPOS_AnchorFormat2*)table; + TRACE("Anchor Format 2\n"); + pt->x = (short)GET_BE_WORD(anchor2->XCoordinate); + pt->y = (short)GET_BE_WORD(anchor2->YCoordinate); + break; + } + case 3: + { + int offset; + const GPOS_AnchorFormat3* anchor3 = (const GPOS_AnchorFormat3*)table; + TRACE("Anchor Format 3\n"); + pt->x = (short)GET_BE_WORD(anchor3->XCoordinate); + pt->y = (short)GET_BE_WORD(anchor3->YCoordinate); + offset = GET_BE_WORD(anchor3->XDeviceTable); + TRACE("ppem %i\n",ppem); + if (offset) + { + const OT_DeviceTable* DeviceTableX = NULL; + DeviceTableX = (const OT_DeviceTable*)((const BYTE*)anchor3 + offset); + pt->x += GPOS_get_device_table_value(DeviceTableX, ppem); + } + offset = GET_BE_WORD(anchor3->YDeviceTable); + if (offset) + { + const OT_DeviceTable* DeviceTableY = NULL; + DeviceTableY = (const OT_DeviceTable*)((const BYTE*)anchor3 + offset); + pt->y += GPOS_get_device_table_value(DeviceTableY, ppem); + } + break; + } + default: + ERR("Unknown Anchor Format %i\n",GET_BE_WORD(anchor1->AnchorFormat)); + pt->x = 0; + pt->y = 0; + } +} static INT GPOS_apply_lookup(LPOUTLINETEXTMETRICW lpotm, LPLOGFONTW lplogfont, INT* piAdvance, const OT_LookupList* lookup, INT lookup_index, const WORD *glyphs, INT glyph_index, INT write_dir, INT glyph_count, GOFFSET *pGoffset) {
1
0
0
0
Aric Stewart : usp10: Implement SHAPE_ApplyOpenTypePositions using GPOS table.
by Alexandre Julliard
16 Jul '12
16 Jul '12
Module: wine Branch: master Commit: 940961fcf73fce9770f12ed314411d20238c1be1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=940961fcf73fce9770f12ed31…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Mon Jul 16 07:23:49 2012 -0500 usp10: Implement SHAPE_ApplyOpenTypePositions using GPOS table. --- dlls/usp10/opentype.c | 28 +++++ dlls/usp10/shape.c | 255 ++++++++++++++++++++++++++----------------- dlls/usp10/usp10.c | 2 + dlls/usp10/usp10_internal.h | 2 + 4 files changed, 189 insertions(+), 98 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=940961fcf73fce9770f12…
1
0
0
0
Aric Stewart : usp10: Change OpenType_GSUB_GetFontFeatureTags to OpenType_GetFontFeatureTags and load features from GPOS table .
by Alexandre Julliard
16 Jul '12
16 Jul '12
Module: wine Branch: master Commit: 84b8dbfa8a2364000df9c2ad174e697c1f3d3c62 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=84b8dbfa8a2364000df9c2ad1…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Mon Jul 16 07:23:46 2012 -0500 usp10: Change OpenType_GSUB_GetFontFeatureTags to OpenType_GetFontFeatureTags and load features from GPOS table. --- dlls/usp10/opentype.c | 78 ++++++++++++++++++++++++++++++++++++++++-- dlls/usp10/shape.c | 6 ++-- dlls/usp10/usp10_internal.h | 2 +- 3 files changed, 78 insertions(+), 8 deletions(-) diff --git a/dlls/usp10/opentype.c b/dlls/usp10/opentype.c index 369cfcc..fa160b7 100644 --- a/dlls/usp10/opentype.c +++ b/dlls/usp10/opentype.c @@ -1153,7 +1153,7 @@ static void GSUB_initialize_feature_cache(LPCVOID table, LoadedLanguage *languag { int i; - if (!language->feature_count && language->gsub_table) + if (language->gsub_table) { const OT_LangSys *lang = language->gsub_table; const GSUB_Header *header = (const GSUB_Header *)table; @@ -1186,7 +1186,77 @@ static void GSUB_initialize_feature_cache(LPCVOID table, LoadedLanguage *languag } } -HRESULT OpenType_GSUB_GetFontFeatureTags(ScriptCache *psc, OPENTYPE_TAG script_tag, OPENTYPE_TAG language_tag, BOOL filtered, OPENTYPE_TAG searchingFor, int cMaxTags, OPENTYPE_TAG *pFeatureTags, int *pcTags, LoadedFeature** feature) +static void GPOS_expand_feature_cache(LPCVOID table, LoadedLanguage *language) +{ + int i, count; + const OT_LangSys *lang = language->gpos_table; + const GPOS_Header *header = (const GPOS_Header *)table; + const OT_FeatureList *feature_list; + + if (!lang) + return; + + count = GET_BE_WORD(lang->FeatureCount); + feature_list = (const OT_FeatureList*)((const BYTE*)header + GET_BE_WORD(header->FeatureList)); + + TRACE("%i features\n",count); + if (!language->feature_count) + { + language->feature_count = count; + + if (language->feature_count) + { + language->features = HeapAlloc(GetProcessHeap(),0,sizeof(LoadedFeature)*language->feature_count); + + for (i = 0; i < language->feature_count; i++) + { + const OT_Feature *feature; + int j; + int index = GET_BE_WORD(lang->FeatureIndex[i]); + + language->features[i].tag = MS_MAKE_TAG(feature_list->FeatureRecord[index].FeatureTag[0], feature_list->FeatureRecord[index].FeatureTag[1], feature_list->FeatureRecord[index].FeatureTag[2], feature_list->FeatureRecord[index].FeatureTag[3]); + language->features[i].feature = ((const BYTE*)feature_list + GET_BE_WORD(feature_list->FeatureRecord[index].Feature)); + feature = (const OT_Feature*)language->features[i].feature; + language->features[i].lookup_count = GET_BE_WORD(feature->LookupCount); + language->features[i].lookups = HeapAlloc(GetProcessHeap(),0,sizeof(WORD) * language->features[i].lookup_count); + for (j = 0; j < language->features[i].lookup_count; j++) + language->features[i].lookups[j] = GET_BE_WORD(feature->LookupListIndex[j]); + } + } + } + else if (count) + { + language->features = HeapReAlloc(GetProcessHeap(),0,language->features, sizeof(LoadedFeature)*(language->feature_count + count)); + + for (i = 0; i < count; i++) + { + const OT_Feature *feature; + int j; + int index = GET_BE_WORD(lang->FeatureIndex[i]); + int idx = language->feature_count + i; + + language->features[idx].tag = MS_MAKE_TAG(feature_list->FeatureRecord[index].FeatureTag[0], feature_list->FeatureRecord[index].FeatureTag[1], feature_list->FeatureRecord[index].FeatureTag[2], feature_list->FeatureRecord[index].FeatureTag[3]); + language->features[idx].feature = ((const BYTE*)feature_list + GET_BE_WORD(feature_list->FeatureRecord[index].Feature)); + feature = (const OT_Feature*)language->features[idx].feature; + language->features[idx].lookup_count = GET_BE_WORD(feature->LookupCount); + language->features[idx].lookups = HeapAlloc(GetProcessHeap(),0,sizeof(WORD) * language->features[idx].lookup_count); + for (j = 0; j < language->features[idx].lookup_count; j++) + language->features[idx].lookups[j] = GET_BE_WORD(feature->LookupListIndex[j]); + } + language->feature_count += count; + } +} + +static void _initialize_feature_cache(ScriptCache *psc, LoadedLanguage *language) +{ + if (!language->feature_count) + { + GSUB_initialize_feature_cache(psc->GSUB_Table, language); + GPOS_expand_feature_cache(psc->GPOS_Table, language); + } +} + +HRESULT OpenType_GetFontFeatureTags(ScriptCache *psc, OPENTYPE_TAG script_tag, OPENTYPE_TAG language_tag, BOOL filtered, OPENTYPE_TAG searchingFor, int cMaxTags, OPENTYPE_TAG *pFeatureTags, int *pcTags, LoadedFeature** feature) { int i; HRESULT rc = S_OK; @@ -1215,7 +1285,7 @@ HRESULT OpenType_GSUB_GetFontFeatureTags(ScriptCache *psc, OPENTYPE_TAG script_t _initialize_language_cache(script); - if (script->default_language.gsub_table && script->default_language.tag == language_tag) + if ((script->default_language.gsub_table || script->default_language.gpos_table) && script->default_language.tag == language_tag) language = &script->default_language; else { @@ -1235,7 +1305,7 @@ HRESULT OpenType_GSUB_GetFontFeatureTags(ScriptCache *psc, OPENTYPE_TAG script_t return S_OK; } - GSUB_initialize_feature_cache(psc->GSUB_Table, language); + _initialize_feature_cache(psc, language); *pcTags = language->feature_count; diff --git a/dlls/usp10/shape.c b/dlls/usp10/shape.c index 1655992..f9a0909 100644 --- a/dlls/usp10/shape.c +++ b/dlls/usp10/shape.c @@ -565,13 +565,13 @@ static LoadedFeature* load_GSUB_feature(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCac language = MS_MAKE_TAG('d','f','l','t'); attempt--; - OpenType_GSUB_GetFontFeatureTags(psc, script, language, FALSE, MS_MAKE_TAG(feat[0],feat[1],feat[2],feat[3]), 1, &tags, &cTags, &feature); + OpenType_GetFontFeatureTags(psc, script, language, FALSE, MS_MAKE_TAG(feat[0],feat[1],feat[2],feat[3]), 1, &tags, &cTags, &feature); } while(attempt && !feature); /* try in the default (latin) table */ if (!feature) - OpenType_GSUB_GetFontFeatureTags(psc, MS_MAKE_TAG('l','a','t','n'), MS_MAKE_TAG('d','f','l','t'), FALSE, MS_MAKE_TAG(feat[0],feat[1],feat[2],feat[3]), 1, &tags, &cTags, &feature); + OpenType_GetFontFeatureTags(psc, MS_MAKE_TAG('l','a','t','n'), MS_MAKE_TAG('d','f','l','t'), FALSE, MS_MAKE_TAG(feat[0],feat[1],feat[2],feat[3]), 1, &tags, &cTags, &feature); } TRACE("Feature %s located at %p\n",debugstr_an(feat,4),feature); @@ -3294,7 +3294,7 @@ HRESULT SHAPE_GetFontFeatureTags( HDC hdc, ScriptCache *psc, filter = TRUE; } - hr = OpenType_GSUB_GetFontFeatureTags(psc, tagScript, tagLangSys, filter, 0x00000000, cMaxTags, pFeatureTags, pcTags, NULL); + hr = OpenType_GetFontFeatureTags(psc, tagScript, tagLangSys, filter, 0x00000000, cMaxTags, pFeatureTags, pcTags, NULL); if (FAILED(hr)) *pcTags = 0; diff --git a/dlls/usp10/usp10_internal.h b/dlls/usp10/usp10_internal.h index 4077833..8cc8f14 100644 --- a/dlls/usp10/usp10_internal.h +++ b/dlls/usp10/usp10_internal.h @@ -238,4 +238,4 @@ void OpenType_GDEF_UpdateGlyphProps(HDC hdc, ScriptCache *psc, const WORD *pwGly INT OpenType_apply_GSUB_lookup(LPCVOID table, INT lookup_index, WORD *glyphs, INT glyph_index, INT write_dir, INT *glyph_count) DECLSPEC_HIDDEN; HRESULT OpenType_GetFontScriptTags(ScriptCache *psc, OPENTYPE_TAG searchingFor, int cMaxTags, OPENTYPE_TAG *pScriptTags, int *pcTags) DECLSPEC_HIDDEN; HRESULT OpenType_GetFontLanguageTags(ScriptCache *psc, OPENTYPE_TAG script_tag, OPENTYPE_TAG searchingFor, int cMaxTags, OPENTYPE_TAG *pLanguageTags, int *pcTags) DECLSPEC_HIDDEN; -HRESULT OpenType_GSUB_GetFontFeatureTags(ScriptCache *psc, OPENTYPE_TAG script_tag, OPENTYPE_TAG language_tag, BOOL filtered, OPENTYPE_TAG searchingFor, int cMaxTags, OPENTYPE_TAG *pFeatureTags, int *pcTags, LoadedFeature** feature) DECLSPEC_HIDDEN; +HRESULT OpenType_GetFontFeatureTags(ScriptCache *psc, OPENTYPE_TAG script_tag, OPENTYPE_TAG language_tag, BOOL filtered, OPENTYPE_TAG searchingFor, int cMaxTags, OPENTYPE_TAG *pFeatureTags, int *pcTags, LoadedFeature** feature) DECLSPEC_HIDDEN;
1
0
0
0
← Newer
1
...
37
38
39
40
41
42
43
...
72
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
Results per page:
10
25
50
100
200