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
0401f6c0
Commit
0401f6c0
authored
Aug 12, 2010
by
Aric Stewart
Committed by
Alexandre Julliard
Aug 16, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
usp10: Add contextual shaping proc to the script shaping data.
parent
2fb344c1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
21 deletions
+28
-21
shape.c
dlls/usp10/shape.c
+26
-19
usp10.c
dlls/usp10/usp10.c
+1
-1
usp10_internal.h
dlls/usp10/usp10_internal.h
+1
-1
No files found.
dlls/usp10/shape.c
View file @
0401f6c0
...
...
@@ -37,6 +37,11 @@ WINE_DEFAULT_DEBUG_CHANNEL(uniscribe);
#define FIRST_ARABIC_CHAR 0x0600
#define LAST_ARABIC_CHAR 0x06ff
typedef
VOID
(
*
ContextualShapingProc
)(
HDC
,
ScriptCache
*
,
SCRIPT_ANALYSIS
*
,
WCHAR
*
,
INT
,
WORD
*
,
INT
*
,
INT
);
static
void
ContextualShape_Arabic
(
HDC
hdc
,
ScriptCache
*
psc
,
SCRIPT_ANALYSIS
*
psa
,
WCHAR
*
pwcChars
,
INT
cChars
,
WORD
*
pwOutGlyphs
,
INT
*
pcGlyphs
,
INT
cMaxGlyphs
);
extern
const
unsigned
short
wine_shaping_table
[];
extern
const
unsigned
short
wine_shaping_forms
[
LAST_ARABIC_CHAR
-
FIRST_ARABIC_CHAR
+
1
][
4
];
...
...
@@ -274,22 +279,23 @@ static OPENTYPE_FEATURE_RECORD syriac_features[] =
typedef
struct
ScriptShapeDataTag
{
TEXTRANGE_PROPERTIES
defaultTextRange
;
CHAR
otTag
[
5
];
ContextualShapingProc
contextProc
;
}
ScriptShapeData
;
/* in order of scripts */
static
const
ScriptShapeData
ShapingData
[]
=
{
{{
standard_features
,
2
},
""
},
{{
standard_features
,
2
},
"latn"
},
{{
standard_features
,
2
},
"latn"
},
{{
standard_features
,
2
},
"latn"
},
{{
standard_features
,
2
},
""
},
{{
standard_features
,
2
},
"latn"
},
{{
arabic_features
,
6
},
"arab"
},
{{
arabic_features
,
6
},
"arab"
},
{{
hebrew_features
,
1
},
"hebr"
},
{{
syriac_features
,
4
},
"syrc"
},
{{
arabic_features
,
6
},
"arab"
},
{{
standard_features
,
2
},
""
,
NULL
},
{{
standard_features
,
2
},
"latn"
,
NULL
},
{{
standard_features
,
2
},
"latn"
,
NULL
},
{{
standard_features
,
2
},
"latn"
,
NULL
},
{{
standard_features
,
2
},
""
,
NULL
},
{{
standard_features
,
2
},
"latn"
,
NULL
},
{{
arabic_features
,
6
},
"arab"
,
ContextualShape_Arabic
},
{{
arabic_features
,
6
},
"arab"
,
ContextualShape_Arabic
},
{{
hebrew_features
,
1
},
"hebr"
,
NULL
},
{{
syriac_features
,
4
},
"syrc"
,
NULL
},
{{
arabic_features
,
6
},
"arab"
,
ContextualShape_Arabic
},
};
static
INT
GSUB_is_glyph_covered
(
LPCVOID
table
,
UINT
glyph
)
...
...
@@ -858,27 +864,22 @@ static inline BOOL left_join_causing(CHAR joining_type)
return
(
joining_type
==
jtR
||
joining_type
==
jtD
||
joining_type
==
jtC
);
}
/* SHAPE_ShapeArabicGlyphs
/*
* ContextualShape_Arabic
*/
void
SHAPE_ShapeArabicGlyphs
(
HDC
hdc
,
ScriptCache
*
psc
,
SCRIPT_ANALYSIS
*
psa
,
WCHAR
*
pwcChars
,
INT
cChars
,
WORD
*
pwOutGlyphs
,
INT
*
pcGlyphs
,
INT
cMaxGlyphs
)
static
void
ContextualShape_Arabic
(
HDC
hdc
,
ScriptCache
*
psc
,
SCRIPT_ANALYSIS
*
psa
,
WCHAR
*
pwcChars
,
INT
cChars
,
WORD
*
pwOutGlyphs
,
INT
*
pcGlyphs
,
INT
cMaxGlyphs
)
{
CHAR
*
context_type
;
INT
*
context_shape
;
INT
dirR
,
dirL
;
int
i
;
if
(
psa
->
eScript
!=
Script_Arabic
&&
psa
->
eScript
!=
Script_Persian
&&
psa
->
eScript
!=
Script_Arabic_Numeric
)
return
;
if
(
*
pcGlyphs
!=
cChars
)
{
ERR
(
"Number of Glyphs and Chars need to match at the beginning
\n
"
);
return
;
}
if
(
!
psa
->
fLogicalOrder
&&
psa
->
fRTL
)
{
dirR
=
1
;
...
...
@@ -948,6 +949,12 @@ void SHAPE_ShapeArabicGlyphs(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WC
HeapFree
(
GetProcessHeap
(),
0
,
context_type
);
}
void
SHAPE_ContextualShaping
(
HDC
hdc
,
ScriptCache
*
psc
,
SCRIPT_ANALYSIS
*
psa
,
WCHAR
*
pwcChars
,
INT
cChars
,
WORD
*
pwOutGlyphs
,
INT
*
pcGlyphs
,
INT
cMaxGlyphs
)
{
if
(
ShapingData
[
psa
->
eScript
].
contextProc
)
ShapingData
[
psa
->
eScript
].
contextProc
(
hdc
,
psc
,
psa
,
pwcChars
,
cChars
,
pwOutGlyphs
,
pcGlyphs
,
cMaxGlyphs
);
}
void
SHAPE_ApplyOpenTypeFeatures
(
HDC
hdc
,
ScriptCache
*
psc
,
SCRIPT_ANALYSIS
*
psa
,
WORD
*
pwOutGlyphs
,
INT
*
pcGlyphs
,
INT
cMaxGlyphs
,
const
TEXTRANGE_PROPERTIES
*
rpRangeProperties
)
{
int
i
;
...
...
dlls/usp10/usp10.c
View file @
0401f6c0
...
...
@@ -1198,7 +1198,7 @@ HRESULT WINAPI ScriptShape(HDC hdc, SCRIPT_CACHE *psc, const WCHAR *pwcChars,
}
rChars
[
i
]
=
chInput
;
}
SHAPE_
ShapeArabicGlyphs
(
hdc
,
(
ScriptCache
*
)
*
psc
,
psa
,
rChars
,
cChars
,
pwOutGlyphs
,
pcGlyphs
,
cMaxGlyphs
);
SHAPE_
ContextualShaping
(
hdc
,
(
ScriptCache
*
)
*
psc
,
psa
,
rChars
,
cChars
,
pwOutGlyphs
,
pcGlyphs
,
cMaxGlyphs
);
SHAPE_ApplyDefaultOpentypeFeatures
(
hdc
,
(
ScriptCache
*
)
*
psc
,
psa
,
pwOutGlyphs
,
pcGlyphs
,
cMaxGlyphs
);
heap_free
(
rChars
);
}
...
...
dlls/usp10/usp10_internal.h
View file @
0401f6c0
...
...
@@ -57,5 +57,5 @@ BOOL BIDI_DetermineLevels( LPCWSTR lpString, INT uCount, const SCRIPT_STATE *s,
INT
BIDI_ReorderV2lLevel
(
int
level
,
int
*
pIndexs
,
const
BYTE
*
plevel
,
int
cch
,
BOOL
fReverse
);
INT
BIDI_ReorderL2vLevel
(
int
level
,
int
*
pIndexs
,
const
BYTE
*
plevel
,
int
cch
,
BOOL
fReverse
);
void
SHAPE_
ShapeArabicGlyphs
(
HDC
hdc
,
ScriptCache
*
psc
,
SCRIPT_ANALYSIS
*
psa
,
WCHAR
*
pwcChars
,
INT
cChars
,
WORD
*
pwOutGlyphs
,
INT
*
pcGlyphs
,
INT
cMaxGlyphs
);
void
SHAPE_
ContextualShaping
(
HDC
hdc
,
ScriptCache
*
psc
,
SCRIPT_ANALYSIS
*
psa
,
WCHAR
*
pwcChars
,
INT
cChars
,
WORD
*
pwOutGlyphs
,
INT
*
pcGlyphs
,
INT
cMaxGlyphs
);
void
SHAPE_ApplyDefaultOpentypeFeatures
(
HDC
hdc
,
ScriptCache
*
psc
,
SCRIPT_ANALYSIS
*
psa
,
WORD
*
pwOutGlyphs
,
INT
*
pcGlyphs
,
INT
cMaxGlyphs
);
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