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
ff2f88cf
Commit
ff2f88cf
authored
Feb 20, 2009
by
Huw Davies
Committed by
Alexandre Julliard
Feb 20, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Fix fractional scaling threshold.
parent
0c6e37bb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
freetype.c
dlls/gdi32/freetype.c
+4
-2
font.c
dlls/gdi32/tests/font.c
+5
-3
No files found.
dlls/gdi32/freetype.c
View file @
ff2f88cf
...
...
@@ -3627,8 +3627,10 @@ found:
scale
=
(
height
+
face
->
size
.
height
-
1
)
/
face
->
size
.
height
;
scaled_height
=
scale
*
face
->
size
.
height
;
/* XP allows not more than 10% deviation */
if
(
scale
>
1
&&
scaled_height
-
height
>
scaled_height
/
10
)
scale
--
;
/* Only jump to the next height if the difference <= 25% original height */
if
(
scale
>
2
&&
scaled_height
-
height
>
face
->
size
.
height
/
4
)
scale
--
;
/* The jump between unscaled and doubled is delayed by 1 */
else
if
(
scale
==
2
&&
scaled_height
-
height
>
(
face
->
size
.
height
/
4
-
1
))
scale
--
;
ret
->
scale_y
=
scale
;
width
=
face
->
size
.
x_ppem
>>
6
;
...
...
dlls/gdi32/tests/font.c
View file @
ff2f88cf
...
...
@@ -344,7 +344,7 @@ static void test_bitmap_font(void)
bitmap_lf
.
lfWidth
=
lfWidth
;
/* test fractional scaling */
for
(
i
=
1
;
i
<=
height_orig
*
3
;
i
++
)
for
(
i
=
1
;
i
<=
height_orig
*
6
;
i
++
)
{
INT
nearest_height
;
...
...
@@ -352,8 +352,10 @@ static void test_bitmap_font(void)
hfont
=
create_font
(
"fractional"
,
&
bitmap_lf
);
scale
=
(
i
+
height_orig
-
1
)
/
height_orig
;
nearest_height
=
scale
*
height_orig
;
/* XP allows not more than 10% deviation */
if
(
scale
>
1
&&
nearest_height
-
i
>
nearest_height
/
10
)
scale
--
;
/* Only jump to the next height if the difference <= 25% original height */
if
(
scale
>
2
&&
nearest_height
-
i
>
height_orig
/
4
)
scale
--
;
/* The jump between unscaled and doubled is delayed by 1 */
else
if
(
scale
==
2
&&
nearest_height
-
i
>
(
height_orig
/
4
-
1
))
scale
--
;
old_hfont
=
SelectObject
(
hdc
,
hfont
);
test_font_metrics
(
hdc
,
hfont
,
bitmap_lf
.
lfHeight
,
0
,
test_str
,
sizeof
(
test_str
),
&
tm_orig
,
&
size_orig
,
width_orig
,
1
,
scale
);
SelectObject
(
hdc
,
old_hfont
);
...
...
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