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
5a5a6bdd
Commit
5a5a6bdd
authored
Oct 27, 2014
by
Nikolay Sivov
Committed by
Alexandre Julliard
Oct 29, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Allow for a weight difference in GetFirstMatchingFont().
parent
6706ada9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
9 deletions
+13
-9
font.c
dlls/dwrite/font.c
+13
-9
No files found.
dlls/dwrite/font.c
View file @
5a5a6bdd
...
...
@@ -1233,17 +1233,21 @@ static HRESULT WINAPI dwritefontfamily_GetFirstMatchingFont(IDWriteFontFamily *i
}
else
{
int
i
;
for
(
i
=
0
;
i
<
This
->
data
->
font_count
;
i
++
)
{
if
(
style
==
This
->
data
->
fonts
[
i
]
->
style
&&
weight
==
This
->
data
->
fonts
[
i
]
->
weight
&&
stretch
==
This
->
data
->
fonts
[
i
]
->
stretch
)
{
return
create_font_from_data
(
This
->
data
->
fonts
[
i
],
iface
,
font
);
UINT32
min_weight_diff
=
~
0u
;
int
found
=
-
1
,
i
;
for
(
i
=
0
;
i
<
This
->
data
->
font_count
;
i
++
)
{
if
(
style
==
This
->
data
->
fonts
[
i
]
->
style
&&
stretch
==
This
->
data
->
fonts
[
i
]
->
stretch
)
{
DWRITE_FONT_WEIGHT
font_weight
=
This
->
data
->
fonts
[
i
]
->
weight
;
UINT32
weight_diff
=
abs
(
font_weight
-
weight
);
if
(
weight_diff
<
min_weight_diff
)
{
min_weight_diff
=
weight_diff
;
found
=
i
;
}
}
return
DWRITE_E_NOFONT
;
}
return
found
!=
-
1
?
create_font_from_data
(
This
->
data
->
fonts
[
found
],
iface
,
font
)
:
DWRITE_E_NOFONT
;
}
}
...
...
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