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
db516804
Commit
db516804
authored
Mar 30, 2021
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 30, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Build with msvcrt.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f4d84acf
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
87 additions
and
79 deletions
+87
-79
Makefile.in
dlls/dwrite/Makefile.in
+2
-0
analyzer.c
dlls/dwrite/analyzer.c
+5
-4
bidi.c
dlls/dwrite/bidi.c
+1
-1
dwrite_private.h
dlls/dwrite/dwrite_private.h
+2
-3
font.c
dlls/dwrite/font.c
+0
-0
freetype.c
dlls/dwrite/freetype.c
+4
-2
layout.c
dlls/dwrite/layout.c
+27
-24
main.c
dlls/dwrite/main.c
+20
-20
opentype.c
dlls/dwrite/opentype.c
+24
-23
shape.c
dlls/dwrite/shape.c
+2
-2
No files found.
dlls/dwrite/Makefile.in
View file @
db516804
...
...
@@ -3,6 +3,8 @@ IMPORTLIB = dwrite
IMPORTS
=
user32 gdi32 advapi32
EXTRAINCL
=
$(FREETYPE_CFLAGS)
EXTRADLLFLAGS
=
-mno-cygwin
C_SRCS
=
\
analyzer.c
\
bidi.c
\
...
...
dlls/dwrite/analyzer.c
View file @
db516804
...
...
@@ -467,7 +467,7 @@ static HRESULT analyze_linebreaks(const WCHAR *text, UINT32 count, DWRITE_LINE_B
breakpoints
[
i
].
breakConditionBefore
=
DWRITE_BREAK_CONDITION_NEUTRAL
;
breakpoints
[
i
].
breakConditionAfter
=
DWRITE_BREAK_CONDITION_NEUTRAL
;
breakpoints
[
i
].
isWhitespace
=
!!
is
spaceW
(
text
[
i
]);
breakpoints
[
i
].
isWhitespace
=
!!
is
wspace
(
text
[
i
]);
breakpoints
[
i
].
isSoftHyphen
=
text
[
i
]
==
0x00ad
/* Unicode Soft Hyphen */
;
breakpoints
[
i
].
padding
=
0
;
...
...
@@ -1107,8 +1107,9 @@ static void get_number_substitutes(IDWriteNumberSubstitution *substitution, BOOL
static
const
WCHAR
arabicW
[]
=
{
0x640
,
0x641
,
0x642
,
0x643
,
0x644
,
0x645
,
0x646
,
0x647
,
0x648
,
0x649
,
0
};
/* For some Arabic locales Latin digits are returned for SNATIVEDIGITS */
if
(
!
strcmpW
(
arW
,
isolang
))
{
strcpyW
(
digits
,
arabicW
);
if
(
!
wcscmp
(
arW
,
isolang
))
{
wcscpy
(
digits
,
arabicW
);
break
;
}
}
...
...
@@ -1978,7 +1979,7 @@ static ULONG WINAPI fontfallback_Release(IDWriteFontFallback1 *iface)
return
IDWriteFactory7_Release
(
fallback
->
factory
);
}
static
int
compare_mapping_range
(
const
void
*
a
,
const
void
*
b
)
static
int
__cdecl
compare_mapping_range
(
const
void
*
a
,
const
void
*
b
)
{
UINT32
ch
=
*
(
UINT32
*
)
a
;
DWRITE_UNICODE_RANGE
*
range
=
(
DWRITE_UNICODE_RANGE
*
)
b
;
...
...
dlls/dwrite/bidi.c
View file @
db516804
...
...
@@ -619,7 +619,7 @@ typedef struct tagBracketPair
int
end
;
}
BracketPair
;
static
int
bracketpair_compr
(
const
void
*
a
,
const
void
*
b
)
static
int
__cdecl
bracketpair_compr
(
const
void
*
a
,
const
void
*
b
)
{
return
((
BracketPair
*
)
a
)
->
start
-
((
BracketPair
*
)
b
)
->
start
;
}
...
...
dlls/dwrite/dwrite_private.h
View file @
db516804
...
...
@@ -18,11 +18,11 @@
#include "dwrite_3.h"
#include "d2d1.h"
#include "winternl.h"
#include "wine/debug.h"
#include "wine/heap.h"
#include "wine/list.h"
#include "wine/unicode.h"
#define MS_GSUB_TAG DWRITE_MAKE_OPENTYPE_TAG('G','S','U','B')
#define MS_GPOS_TAG DWRITE_MAKE_OPENTYPE_TAG('G','P','O','S')
...
...
@@ -41,7 +41,7 @@ static inline LPWSTR heap_strdupW(const WCHAR *str)
if
(
str
)
{
DWORD
size
;
size
=
(
strlenW
(
str
)
+
1
)
*
sizeof
(
WCHAR
);
size
=
(
lstrlenW
(
str
)
+
1
)
*
sizeof
(
WCHAR
);
ret
=
heap_alloc
(
size
);
if
(
ret
)
memcpy
(
ret
,
str
,
size
);
...
...
@@ -743,7 +743,6 @@ struct font_backend_funcs
UINT16
glyph
,
DWRITE_GLYPH_METRICS
*
metrics
);
};
extern
NTSTATUS
CDECL
init_font_lib
(
HMODULE
module
,
DWORD
reason
,
const
void
*
ptr_in
,
void
*
ptr_out
)
DECLSPEC_HIDDEN
;
extern
void
init_font_backend
(
void
)
DECLSPEC_HIDDEN
;
extern
void
release_font_backend
(
void
)
DECLSPEC_HIDDEN
;
...
...
dlls/dwrite/font.c
View file @
db516804
This diff is collapsed.
Click to expand it.
dlls/dwrite/freetype.c
View file @
db516804
...
...
@@ -18,7 +18,9 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define COBJMACROS
#if 0
#pragma makedep unix
#endif
#include "config.h"
#include "wine/port.h"
...
...
@@ -860,7 +862,7 @@ static NTSTATUS release_freetype_lib(void)
#endif
/* HAVE_FREETYPE */
NTSTATUS
CDECL
init_font
_lib
(
HMODULE
module
,
DWORD
reason
,
const
void
*
ptr_in
,
void
*
ptr_out
)
NTSTATUS
CDECL
__wine_init_unix
_lib
(
HMODULE
module
,
DWORD
reason
,
const
void
*
ptr_in
,
void
*
ptr_out
)
{
if
(
reason
==
DLL_PROCESS_ATTACH
)
return
init_freetype_lib
(
module
,
reason
,
ptr_in
,
ptr_out
);
...
...
dlls/dwrite/layout.c
View file @
db516804
...
...
@@ -1974,7 +1974,7 @@ static void init_u_splitting_params_from_erun(struct layout_effective_run *erun,
static
BOOL
is_same_u_splitting
(
struct
layout_underline_splitting_params
*
left
,
struct
layout_underline_splitting_params
*
right
)
{
return
left
->
effect
==
right
->
effect
&&
!
strcmpiW
(
left
->
locale
,
right
->
locale
);
return
left
->
effect
==
right
->
effect
&&
!
wcsicmp
(
left
->
locale
,
right
->
locale
);
}
static
HRESULT
layout_add_underline
(
struct
dwrite_textlayout
*
layout
,
struct
layout_effective_run
*
first
,
...
...
@@ -2432,9 +2432,9 @@ static BOOL is_same_layout_attrvalue(struct layout_range_header const *h, enum l
case
LAYOUT_RANGE_ATTR_FONTCOLL
:
return
range
->
collection
==
value
->
u
.
collection
;
case
LAYOUT_RANGE_ATTR_LOCALE
:
return
strcmpiW
(
range
->
locale
,
value
->
u
.
locale
)
==
0
;
return
!
wcsicmp
(
range
->
locale
,
value
->
u
.
locale
)
;
case
LAYOUT_RANGE_ATTR_FONTFAMILY
:
return
strcmpW
(
range
->
fontfamily
,
value
->
u
.
fontfamily
)
==
0
;
return
!
wcscmp
(
range
->
fontfamily
,
value
->
u
.
fontfamily
)
;
case
LAYOUT_RANGE_ATTR_SPACING
:
return
range_spacing
->
leading
==
value
->
u
.
spacing
.
leading
&&
range_spacing
->
trailing
==
value
->
u
.
spacing
.
trailing
&&
...
...
@@ -2463,8 +2463,8 @@ static inline BOOL is_same_layout_attributes(struct layout_range_header const *h
left
->
object
==
right
->
object
&&
left
->
pair_kerning
==
right
->
pair_kerning
&&
left
->
collection
==
right
->
collection
&&
!
strcmpiW
(
left
->
locale
,
right
->
locale
)
&&
!
strcmpW
(
left
->
fontfamily
,
right
->
fontfamily
);
!
wcsicmp
(
left
->
locale
,
right
->
locale
)
&&
!
wcscmp
(
left
->
fontfamily
,
right
->
fontfamily
);
}
case
LAYOUT_RANGE_UNDERLINE
:
case
LAYOUT_RANGE_STRIKETHROUGH
:
...
...
@@ -2529,7 +2529,7 @@ static struct layout_range_header *alloc_layout_range(struct dwrite_textlayout *
range
->
collection
=
layout
->
format
.
collection
;
if
(
range
->
collection
)
IDWriteFontCollection_AddRef
(
range
->
collection
);
strcpyW
(
range
->
locale
,
layout
->
format
.
locale
);
wcscpy
(
range
->
locale
,
layout
->
format
.
locale
);
h
=
&
range
->
h
;
break
;
...
...
@@ -2792,15 +2792,17 @@ static BOOL set_layout_range_attrval(struct layout_range_header *h, enum layout_
changed
=
set_layout_range_iface_attr
((
IUnknown
**
)
&
dest
->
collection
,
(
IUnknown
*
)
value
->
u
.
collection
);
break
;
case
LAYOUT_RANGE_ATTR_LOCALE
:
changed
=
strcmpiW
(
dest
->
locale
,
value
->
u
.
locale
)
!=
0
;
if
(
changed
)
{
strcpyW
(
dest
->
locale
,
value
->
u
.
locale
);
strlwrW
(
dest
->
locale
);
changed
=
!!
wcsicmp
(
dest
->
locale
,
value
->
u
.
locale
);
if
(
changed
)
{
wcscpy
(
dest
->
locale
,
value
->
u
.
locale
);
wcslwr
(
dest
->
locale
);
}
break
;
case
LAYOUT_RANGE_ATTR_FONTFAMILY
:
changed
=
strcmpW
(
dest
->
fontfamily
,
value
->
u
.
fontfamily
)
!=
0
;
if
(
changed
)
{
changed
=
!!
wcscmp
(
dest
->
fontfamily
,
value
->
u
.
fontfamily
);
if
(
changed
)
{
heap_free
(
dest
->
fontfamily
);
dest
->
fontfamily
=
heap_strdupW
(
value
->
u
.
fontfamily
);
}
...
...
@@ -3033,7 +3035,7 @@ static HRESULT get_string_attribute_length(struct dwrite_textlayout *layout, enu
}
str
=
get_string_attribute_ptr
(
range
,
kind
);
*
length
=
strlenW
(
str
);
*
length
=
wcslen
(
str
);
return
return_range
(
&
range
->
h
,
r
);
}
...
...
@@ -3052,10 +3054,10 @@ static HRESULT get_string_attribute_value(struct dwrite_textlayout *layout, enum
return
E_INVALIDARG
;
str
=
get_string_attribute_ptr
(
range
,
kind
);
if
(
length
<
strlenW
(
str
)
+
1
)
if
(
length
<
wcslen
(
str
)
+
1
)
return
E_NOT_SUFFICIENT_BUFFER
;
strcpyW
(
ret
,
str
);
wcscpy
(
ret
,
str
);
return
return_range
(
&
range
->
h
,
r
);
}
...
...
@@ -3488,7 +3490,7 @@ static HRESULT WINAPI dwritetextlayout_SetLocaleName(IDWriteTextLayout4 *iface,
TRACE
(
"%p, %s, %s.
\n
"
,
iface
,
debugstr_w
(
locale
),
debugstr_range
(
&
range
));
if
(
!
locale
||
strlenW
(
locale
)
>
LOCALE_NAME_MAX_LENGTH
-
1
)
if
(
!
locale
||
wcslen
(
locale
)
>
LOCALE_NAME_MAX_LENGTH
-
1
)
return
E_INVALIDARG
;
value
.
range
=
range
;
...
...
@@ -4816,7 +4818,7 @@ static HRESULT WINAPI dwritetextformat_layout_GetFontFamilyName(IDWriteTextForma
TRACE
(
"%p, %p, %u.
\n
"
,
iface
,
name
,
size
);
if
(
size
<=
layout
->
format
.
family_len
)
return
E_NOT_SUFFICIENT_BUFFER
;
strcpyW
(
name
,
layout
->
format
.
family_name
);
wcscpy
(
name
,
layout
->
format
.
family_name
);
return
S_OK
;
}
...
...
@@ -4872,7 +4874,7 @@ static HRESULT WINAPI dwritetextformat_layout_GetLocaleName(IDWriteTextFormat3 *
TRACE
(
"%p, %p, %u.
\n
"
,
iface
,
name
,
size
);
if
(
size
<=
layout
->
format
.
locale_len
)
return
E_NOT_SUFFICIENT_BUFFER
;
strcpyW
(
name
,
layout
->
format
.
locale
);
wcscpy
(
name
,
layout
->
format
.
locale
);
return
S_OK
;
}
...
...
@@ -5285,7 +5287,8 @@ static HRESULT WINAPI dwritetextlayout_source_GetLocaleName(IDWriteTextAnalysisS
*
text_len
=
range
->
h
.
range
.
length
-
position
;
next
=
LIST_ENTRY
(
list_next
(
&
layout
->
ranges
,
&
range
->
h
.
entry
),
struct
layout_range
,
h
.
entry
);
while
(
next
&&
next
->
h
.
range
.
startPosition
<
layout
->
len
&&
!
strcmpW
(
range
->
locale
,
next
->
locale
))
{
while
(
next
&&
next
->
h
.
range
.
startPosition
<
layout
->
len
&&
!
wcscmp
(
range
->
locale
,
next
->
locale
))
{
*
text_len
+=
next
->
h
.
range
.
length
;
next
=
LIST_ENTRY
(
list_next
(
&
layout
->
ranges
,
&
next
->
h
.
entry
),
struct
layout_range
,
h
.
entry
);
}
...
...
@@ -5939,7 +5942,7 @@ static HRESULT WINAPI dwritetextformat_GetFontFamilyName(IDWriteTextFormat3 *ifa
if
(
size
<=
format
->
format
.
family_len
)
return
E_NOT_SUFFICIENT_BUFFER
;
strcpyW
(
name
,
format
->
format
.
family_name
);
wcscpy
(
name
,
format
->
format
.
family_name
);
return
S_OK
;
}
...
...
@@ -5996,7 +5999,7 @@ static HRESULT WINAPI dwritetextformat_GetLocaleName(IDWriteTextFormat3 *iface,
if
(
size
<=
format
->
format
.
locale_len
)
return
E_NOT_SUFFICIENT_BUFFER
;
strcpyW
(
name
,
format
->
format
.
locale
);
wcscpy
(
name
,
format
->
format
.
locale
);
return
S_OK
;
}
...
...
@@ -6216,11 +6219,11 @@ HRESULT create_textformat(const WCHAR *family_name, IDWriteFontCollection *colle
object
->
IDWriteTextFormat3_iface
.
lpVtbl
=
&
dwritetextformatvtbl
;
object
->
refcount
=
1
;
object
->
format
.
family_name
=
heap_strdupW
(
family_name
);
object
->
format
.
family_len
=
strlenW
(
family_name
);
object
->
format
.
family_len
=
wcslen
(
family_name
);
object
->
format
.
locale
=
heap_strdupW
(
locale
);
object
->
format
.
locale_len
=
strlenW
(
locale
);
object
->
format
.
locale_len
=
wcslen
(
locale
);
/* Force locale name to lower case, layout will inherit this modified value. */
strlwrW
(
object
->
format
.
locale
);
wcslwr
(
object
->
format
.
locale
);
object
->
format
.
weight
=
weight
;
object
->
format
.
style
=
style
;
object
->
format
.
fontsize
=
size
;
...
...
dlls/dwrite/main.c
View file @
db516804
...
...
@@ -343,7 +343,7 @@ static HRESULT WINAPI localizedstrings_FindLocaleName(IDWriteLocalizedStrings *i
for
(
i
=
0
;
i
<
strings
->
count
;
++
i
)
{
if
(
!
strcmpiW
(
strings
->
data
[
i
].
locale
,
locale_name
))
if
(
!
wcsicmp
(
strings
->
data
[
i
].
locale
,
locale_name
))
{
*
exists
=
TRUE
;
*
index
=
i
;
...
...
@@ -366,7 +366,7 @@ static HRESULT WINAPI localizedstrings_GetLocaleNameLength(IDWriteLocalizedStrin
return
E_FAIL
;
}
*
length
=
strlenW
(
strings
->
data
[
index
].
locale
);
*
length
=
wcslen
(
strings
->
data
[
index
].
locale
);
return
S_OK
;
}
...
...
@@ -382,13 +382,13 @@ static HRESULT WINAPI localizedstrings_GetLocaleName(IDWriteLocalizedStrings *if
return
E_FAIL
;
}
if
(
size
<
strlenW
(
strings
->
data
[
index
].
locale
)
+
1
)
if
(
size
<
wcslen
(
strings
->
data
[
index
].
locale
)
+
1
)
{
if
(
buffer
)
*
buffer
=
0
;
return
E_NOT_SUFFICIENT_BUFFER
;
}
strcpyW
(
buffer
,
strings
->
data
[
index
].
locale
);
wcscpy
(
buffer
,
strings
->
data
[
index
].
locale
);
return
S_OK
;
}
...
...
@@ -404,7 +404,7 @@ static HRESULT WINAPI localizedstrings_GetStringLength(IDWriteLocalizedStrings *
return
E_FAIL
;
}
*
length
=
strlenW
(
strings
->
data
[
index
].
string
);
*
length
=
wcslen
(
strings
->
data
[
index
].
string
);
return
S_OK
;
}
...
...
@@ -420,13 +420,13 @@ static HRESULT WINAPI localizedstrings_GetString(IDWriteLocalizedStrings *iface,
return
E_FAIL
;
}
if
(
size
<
strlenW
(
strings
->
data
[
index
].
string
)
+
1
)
if
(
size
<
wcslen
(
strings
->
data
[
index
].
string
)
+
1
)
{
if
(
buffer
)
*
buffer
=
0
;
return
E_NOT_SUFFICIENT_BUFFER
;
}
strcpyW
(
buffer
,
strings
->
data
[
index
].
string
);
wcscpy
(
buffer
,
strings
->
data
[
index
].
string
);
return
S_OK
;
}
...
...
@@ -470,7 +470,7 @@ HRESULT add_localizedstring(IDWriteLocalizedStrings *iface, const WCHAR *locale,
if
(
*
locale
)
{
for
(
i
=
0
;
i
<
count
;
i
++
)
if
(
!
lstrcmpiW
(
strings
->
data
[
i
].
locale
,
locale
))
if
(
!
wcsicmp
(
strings
->
data
[
i
].
locale
,
locale
))
return
S_OK
;
}
...
...
@@ -485,7 +485,7 @@ HRESULT add_localizedstring(IDWriteLocalizedStrings *iface, const WCHAR *locale,
heap_free
(
strings
->
data
[
count
].
string
);
return
E_OUTOFMEMORY
;
}
strlwrW
(
strings
->
data
[
count
].
locale
);
wcslwr
(
strings
->
data
[
count
].
locale
);
strings
->
count
++
;
...
...
@@ -537,7 +537,7 @@ void set_en_localizedstring(IDWriteLocalizedStrings *iface, const WCHAR *string)
for
(
i
=
0
;
i
<
strings
->
count
;
i
++
)
{
if
(
!
strcmpiW
(
strings
->
data
[
i
].
locale
,
enusW
))
if
(
!
wcsicmp
(
strings
->
data
[
i
].
locale
,
enusW
))
{
heap_free
(
strings
->
data
[
i
].
string
);
strings
->
data
[
i
].
string
=
heap_strdupW
(
string
);
...
...
@@ -546,11 +546,11 @@ void set_en_localizedstring(IDWriteLocalizedStrings *iface, const WCHAR *string)
}
}
static
int
localizedstrings_sorting_compare
(
const
void
*
left
,
const
void
*
right
)
static
int
__cdecl
localizedstrings_sorting_compare
(
const
void
*
left
,
const
void
*
right
)
{
const
struct
localizedpair
*
_l
=
left
,
*
_r
=
right
;
return
strcmpW
(
_l
->
locale
,
_r
->
locale
);
return
wcscmp
(
_l
->
locale
,
_r
->
locale
);
};
void
sort_localizedstrings
(
IDWriteLocalizedStrings
*
iface
)
...
...
@@ -573,7 +573,7 @@ BOOL localizedstrings_contains(IDWriteLocalizedStrings *iface, const WCHAR *str)
for
(
i
=
0
;
i
<
strings
->
count
;
++
i
)
{
if
(
!
lstrcmpiW
(
strings
->
data
[
i
].
string
,
str
))
return
TRUE
;
if
(
!
wcsicmp
(
strings
->
data
[
i
].
string
,
str
))
return
TRUE
;
}
return
FALSE
;
...
...
@@ -1571,15 +1571,15 @@ static HRESULT create_system_path_list(WCHAR ***ret, unsigned int *ret_count)
{
if
(
dwrite_array_reserve
((
void
**
)
&
paths
,
&
capacity
,
count
+
1
,
sizeof
(
*
paths
)))
{
if
(
!
strchrW
(
value
,
'\\'
))
if
(
!
wcschr
(
value
,
'\\'
))
{
static
const
WCHAR
fontsW
[]
=
{
'\\'
,
'f'
,
'o'
,
'n'
,
't'
,
's'
,
'\\'
,
0
};
WCHAR
*
ptrW
;
ptrW
=
heap_alloc
((
MAX_PATH
+
lstrlenW
(
value
))
*
sizeof
(
WCHAR
));
ptrW
=
heap_alloc
((
MAX_PATH
+
wcslen
(
value
))
*
sizeof
(
WCHAR
));
GetWindowsDirectoryW
(
ptrW
,
MAX_PATH
);
lstrcatW
(
ptrW
,
fontsW
);
lstrcatW
(
ptrW
,
value
);
wcscat
(
ptrW
,
fontsW
);
wcscat
(
ptrW
,
value
);
heap_free
(
value
);
value
=
ptrW
;
...
...
@@ -1602,10 +1602,10 @@ static HRESULT create_system_path_list(WCHAR ***ret, unsigned int *ret_count)
return
S_OK
;
}
static
int
create_system_fontset_compare
(
const
void
*
left
,
const
void
*
right
)
static
int
__cdecl
create_system_fontset_compare
(
const
void
*
left
,
const
void
*
right
)
{
const
WCHAR
*
_l
=
*
(
WCHAR
**
)
left
,
*
_r
=
*
(
WCHAR
**
)
right
;
return
lstrcmpiW
(
_l
,
_r
);
return
wcsicmp
(
_l
,
_r
);
};
static
HRESULT
create_system_fontset
(
IDWriteFactory7
*
factory
,
REFIID
riid
,
void
**
obj
)
...
...
@@ -1628,7 +1628,7 @@ static HRESULT create_system_fontset(IDWriteFactory7 *factory, REFIID riid, void
for
(
i
=
0
,
j
=
0
;
i
<
count
;
++
i
)
{
if
(
i
!=
j
&&
!
lstrcmpiW
(
paths
[
i
],
paths
[
j
]))
continue
;
if
(
i
!=
j
&&
!
wcsicmp
(
paths
[
i
],
paths
[
j
]))
continue
;
if
(
FAILED
(
hr
=
IDWriteFontSetBuilder2_AddFontFile
(
builder
,
paths
[
i
]))
&&
hr
!=
DWRITE_E_FILEFORMAT
)
WARN
(
"Failed to add font file, hr %#x, path %s.
\n
"
,
hr
,
debugstr_w
(
paths
[
i
]));
...
...
dlls/dwrite/opentype.c
View file @
db516804
...
...
@@ -21,9 +21,7 @@
#define COBJMACROS
#define NONAMELESSUNION
#include "config.h"
#include "dwrite_private.h"
#include "winternl.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
dwrite
);
...
...
@@ -1574,7 +1572,7 @@ struct cmap_format4_compare_context
unsigned
int
ch
;
};
static
int
cmap_format4_compare_range
(
const
void
*
a
,
const
void
*
b
)
static
int
__cdecl
cmap_format4_compare_range
(
const
void
*
a
,
const
void
*
b
)
{
const
struct
cmap_format4_compare_context
*
key
=
a
;
const
UINT16
*
end
=
b
;
...
...
@@ -1659,7 +1657,7 @@ static unsigned int opentype_cmap_format6_10_get_ranges(const struct dwrite_cmap
return
1
;
}
static
int
cmap_format12_13_compare_group
(
const
void
*
a
,
const
void
*
b
)
static
int
__cdecl
cmap_format12_13_compare_group
(
const
void
*
a
,
const
void
*
b
)
{
const
unsigned
int
*
ch
=
a
;
const
UINT32
*
group
=
b
;
...
...
@@ -1737,7 +1735,7 @@ UINT16 opentype_cmap_get_glyph(const struct dwrite_cmap *cmap, unsigned int ch)
return
glyph
;
}
static
int
cmap_header_compare
(
const
void
*
a
,
const
void
*
b
)
static
int
__cdecl
cmap_header_compare
(
const
void
*
a
,
const
void
*
b
)
{
const
UINT16
*
key
=
a
;
const
UINT16
*
record
=
b
;
...
...
@@ -2271,17 +2269,18 @@ static void get_name_record_locale(enum OPENTYPE_PLATFORM_ID platform, USHORT la
if
(
locale_name
)
MultiByteToWideChar
(
CP_ACP
,
0
,
name_mac_langid_to_locale
[
lang_id
],
-
1
,
locale
,
locale_len
);
else
strcpyW
(
locale
,
enusW
);
wcscpy
(
locale
,
enusW
);
break
;
}
case
OPENTYPE_PLATFORM_WIN
:
if
(
!
LCIDToLocaleName
(
MAKELCID
(
lang_id
,
SORT_DEFAULT
),
locale
,
locale_len
,
0
))
{
if
(
!
LCIDToLocaleName
(
MAKELCID
(
lang_id
,
SORT_DEFAULT
),
locale
,
locale_len
,
0
))
{
FIXME
(
"failed to get locale name for lcid=0x%08x
\n
"
,
MAKELCID
(
lang_id
,
SORT_DEFAULT
));
strcpyW
(
locale
,
enusW
);
wcscpy
(
locale
,
enusW
);
}
break
;
case
OPENTYPE_PLATFORM_UNICODE
:
strcpyW
(
locale
,
enusW
);
wcscpy
(
locale
,
enusW
);
break
;
default:
FIXME
(
"unknown platform %d
\n
"
,
platform
);
...
...
@@ -2351,7 +2350,7 @@ static BOOL opentype_decode_namerecord(const struct dwrite_fonttable *table, uns
add_localizedstring
(
strings
,
locale
,
name_string
);
heap_free
(
name_string
);
ret
=
!
lstrcmpW
(
locale
,
enusW
);
ret
=
!
wcscmp
(
locale
,
enusW
);
}
else
FIXME
(
"handle NAME format 1
\n
"
);
...
...
@@ -2448,10 +2447,10 @@ static WCHAR *meta_get_lng_name(WCHAR *str, WCHAR **ctx)
WCHAR
*
ret
;
if
(
!
str
)
str
=
*
ctx
;
while
(
*
str
&&
strchrW
(
delimW
,
*
str
))
str
++
;
while
(
*
str
&&
wcschr
(
delimW
,
*
str
))
str
++
;
if
(
!*
str
)
return
NULL
;
ret
=
str
++
;
while
(
*
str
&&
!
strchrW
(
delimW
,
*
str
))
str
++
;
while
(
*
str
&&
!
wcschr
(
delimW
,
*
str
))
str
++
;
if
(
*
str
)
*
str
++
=
0
;
*
ctx
=
str
;
...
...
@@ -2651,10 +2650,12 @@ HRESULT opentype_get_font_facename(struct file_stream_desc *stream_desc, WCHAR *
IDWriteLocalizedStrings_GetStringLength
(
lfnames
,
index
,
&
length
);
nameW
=
heap_alloc
((
length
+
1
)
*
sizeof
(
WCHAR
));
if
(
nameW
)
{
if
(
nameW
)
{
*
nameW
=
0
;
IDWriteLocalizedStrings_GetString
(
lfnames
,
index
,
nameW
,
length
+
1
);
lstrcpynW
(
lfname
,
nameW
,
LF_FACESIZE
);
wcsncpy
(
lfname
,
nameW
,
LF_FACESIZE
);
lfname
[
LF_FACESIZE
-
1
]
=
0
;
heap_free
(
nameW
);
}
}
...
...
@@ -2901,7 +2902,7 @@ HRESULT opentype_get_cpal_entries(const struct dwrite_fonttable *cpal, unsigned
return
S_OK
;
}
static
int
colr_compare_gid
(
const
void
*
g
,
const
void
*
r
)
static
int
__cdecl
colr_compare_gid
(
const
void
*
g
,
const
void
*
r
)
{
const
struct
colr_baseglyph_record
*
record
=
r
;
UINT16
glyph
=
*
(
UINT16
*
)
g
,
GID
=
GET_BE_WORD
(
record
->
glyph
);
...
...
@@ -3259,7 +3260,7 @@ unsigned int opentype_layout_find_language(const struct scriptshaping_cache *cac
return
0
;
}
static
int
gdef_class_compare_format2
(
const
void
*
g
,
const
void
*
r
)
static
int
__cdecl
gdef_class_compare_format2
(
const
void
*
g
,
const
void
*
r
)
{
const
struct
ot_gdef_class_range
*
range
=
r
;
UINT16
glyph
=
*
(
UINT16
*
)
g
;
...
...
@@ -3368,7 +3369,7 @@ struct coverage_compare_format1_context
unsigned
int
*
coverage_index
;
};
static
int
coverage_compare_format1
(
const
void
*
left
,
const
void
*
right
)
static
int
__cdecl
coverage_compare_format1
(
const
void
*
left
,
const
void
*
right
)
{
const
struct
coverage_compare_format1_context
*
context
=
left
;
UINT16
glyph
=
GET_BE_WORD
(
*
(
UINT16
*
)
right
);
...
...
@@ -3381,7 +3382,7 @@ static int coverage_compare_format1(const void *left, const void *right)
return
ret
;
}
static
int
coverage_compare_format2
(
const
void
*
g
,
const
void
*
r
)
static
int
__cdecl
coverage_compare_format2
(
const
void
*
g
,
const
void
*
r
)
{
const
struct
ot_coverage_range
*
range
=
r
;
UINT16
glyph
=
*
(
UINT16
*
)
g
;
...
...
@@ -3440,7 +3441,7 @@ static unsigned int opentype_layout_is_glyph_covered(const struct dwrite_fonttab
static
inline
unsigned
int
dwrite_popcount
(
unsigned
int
x
)
{
#if
def HAVE___BUILTIN_POPCOUNT
#if
defined(__GNUC__) && (__GNUC__ >= 4)
return
__builtin_popcount
(
x
);
#else
x
-=
x
>>
1
&
0x55555555
;
...
...
@@ -3866,7 +3867,7 @@ static BOOL opentype_layout_apply_gpos_single_adjustment(struct scriptshaping_co
return
TRUE
;
}
static
int
gpos_pair_adjustment_compare_format1
(
const
void
*
g
,
const
void
*
r
)
static
int
__cdecl
gpos_pair_adjustment_compare_format1
(
const
void
*
g
,
const
void
*
r
)
{
const
struct
ot_gpos_pairvalue
*
pairvalue
=
r
;
UINT16
second_glyph
=
GET_BE_WORD
(
pairvalue
->
second_glyph
);
...
...
@@ -4456,7 +4457,7 @@ struct lookups
size_t
count
;
};
static
int
lookups_sorting_compare
(
const
void
*
a
,
const
void
*
b
)
static
int
__cdecl
lookups_sorting_compare
(
const
void
*
a
,
const
void
*
b
)
{
const
struct
lookup
*
left
=
(
const
struct
lookup
*
)
a
;
const
struct
lookup
*
right
=
(
const
struct
lookup
*
)
b
;
...
...
@@ -4715,7 +4716,7 @@ static void opentype_layout_collect_lookups(struct scriptshaping_context *contex
}
}
static
int
feature_search_compare
(
const
void
*
a
,
const
void
*
b
)
static
int
__cdecl
feature_search_compare
(
const
void
*
a
,
const
void
*
b
)
{
unsigned
int
tag
=
*
(
unsigned
int
*
)
a
;
const
struct
shaping_feature
*
feature
=
b
;
...
...
@@ -6525,7 +6526,7 @@ struct kern_format0_compare_key
UINT16
right
;
};
static
int
kern_format0_compare
(
const
void
*
a
,
const
void
*
b
)
static
int
__cdecl
kern_format0_compare
(
const
void
*
a
,
const
void
*
b
)
{
const
struct
kern_format0_compare_key
*
key
=
a
;
const
WORD
*
data
=
b
;
...
...
dlls/dwrite/shape.c
View file @
db516804
...
...
@@ -148,7 +148,7 @@ void shape_start_next_stage(struct shaping_features *features, stage_func func)
features
->
stage
++
;
}
static
int
features_sorting_compare
(
const
void
*
a
,
const
void
*
b
)
static
int
__cdecl
features_sorting_compare
(
const
void
*
a
,
const
void
*
b
)
{
const
struct
shaping_feature
*
left
=
a
,
*
right
=
b
;
return
left
->
tag
!=
right
->
tag
?
(
left
->
tag
<
right
->
tag
?
-
1
:
1
)
:
0
;
...
...
@@ -352,7 +352,7 @@ HRESULT shape_get_glyphs(struct scriptshaping_context *context, const unsigned i
return
(
context
->
glyph_count
<=
context
->
u
.
subst
.
max_glyph_count
)
?
S_OK
:
E_NOT_SUFFICIENT_BUFFER
;
}
static
int
tag_array_sorting_compare
(
const
void
*
a
,
const
void
*
b
)
static
int
__cdecl
tag_array_sorting_compare
(
const
void
*
a
,
const
void
*
b
)
{
unsigned
int
left
=
GET_BE_DWORD
(
*
(
unsigned
int
*
)
a
),
right
=
GET_BE_DWORD
(
*
(
unsigned
int
*
)
b
);
return
left
!=
right
?
(
left
<
right
?
-
1
:
1
)
:
0
;
...
...
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