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
9288acda
Commit
9288acda
authored
Jul 16, 2012
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Jul 18, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: GdipGetFontHeight should convert height from font to device units.
parent
ed8a3304
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
8 deletions
+42
-8
font.c
dlls/gdiplus/font.c
+17
-6
gdiplus.c
dlls/gdiplus/gdiplus.c
+24
-0
gdiplus_private.h
dlls/gdiplus/gdiplus_private.h
+1
-0
graphics.c
dlls/gdiplus/tests/graphics.c
+0
-2
No files found.
dlls/gdiplus/font.c
View file @
9288acda
...
...
@@ -523,18 +523,29 @@ GpStatus WINGDIPAPI GdipGetFontHeight(GDIPCONST GpFont *font,
{
REAL
dpi
;
GpStatus
stat
;
REAL
font_height
;
TRACE
(
"%p %p %p
\n
"
,
font
,
graphics
,
height
);
if
(
graphics
)
stat
=
GdipGetFontHeightGivenDPI
(
font
,
font
->
family
->
dpi
,
&
font_height
);
if
(
stat
!=
Ok
)
return
stat
;
if
(
!
graphics
)
{
stat
=
GdipGetDpiY
((
GpGraphics
*
)
graphics
,
&
dpi
);
if
(
stat
!=
Ok
)
return
stat
;
*
height
=
font_height
;
TRACE
(
"%s,%d => %f
\n
"
,
debugstr_w
(
font
->
family
->
FamilyName
),
font
->
otm
.
otmTextMetrics
.
tmHeight
,
*
height
);
return
Ok
;
}
else
dpi
=
font
->
family
->
dpi
;
return
GdipGetFontHeightGivenDPI
(
font
,
dpi
,
height
);
stat
=
GdipGetDpiY
((
GpGraphics
*
)
graphics
,
&
dpi
);
if
(
stat
!=
Ok
)
return
stat
;
*
height
=
pixels_to_units
(
font_height
,
graphics
->
unit
,
dpi
);
TRACE
(
"%s,%d(unit %d) => %f
\n
"
,
debugstr_w
(
font
->
family
->
FamilyName
),
font
->
otm
.
otmTextMetrics
.
tmHeight
,
graphics
->
unit
,
*
height
);
return
Ok
;
}
/*******************************************************************************
...
...
dlls/gdiplus/gdiplus.c
View file @
9288acda
...
...
@@ -366,6 +366,30 @@ REAL units_to_pixels(REAL units, GpUnit unit, REAL dpi)
}
}
/* converts value in pixels to a given unit */
REAL
pixels_to_units
(
REAL
pixels
,
GpUnit
unit
,
REAL
dpi
)
{
switch
(
unit
)
{
case
UnitPixel
:
case
UnitWorld
:
case
UnitDisplay
:
return
pixels
;
case
UnitPoint
:
return
pixels
/
dpi
/
inch_per_point
;
case
UnitInch
:
return
pixels
/
dpi
;
break
;
case
UnitDocument
:
return
pixels
*
300
.
0
/
dpi
;
case
UnitMillimeter
:
return
pixels
*
mm_per_inch
/
dpi
;
default:
FIXME
(
"Unhandled unit type: %d
\n
"
,
unit
);
return
0
;
}
}
/* Calculates Bezier points from cardinal spline points. */
void
calc_curve_bezier
(
CONST
GpPointF
*
pts
,
REAL
tension
,
REAL
*
x1
,
REAL
*
y1
,
REAL
*
x2
,
REAL
*
y2
)
...
...
dlls/gdiplus/gdiplus_private.h
View file @
9288acda
...
...
@@ -50,6 +50,7 @@ extern REAL gdiplus_atan2(REAL dy, REAL dx) DECLSPEC_HIDDEN;
extern
GpStatus
hresult_to_status
(
HRESULT
res
)
DECLSPEC_HIDDEN
;
extern
REAL
convert_unit
(
REAL
logpixels
,
GpUnit
unit
)
DECLSPEC_HIDDEN
;
extern
REAL
units_to_pixels
(
REAL
units
,
GpUnit
unit
,
REAL
dpi
)
DECLSPEC_HIDDEN
;
extern
REAL
pixels_to_units
(
REAL
pixels
,
GpUnit
unit
,
REAL
dpi
)
DECLSPEC_HIDDEN
;
extern
GpStatus
graphics_from_image
(
GpImage
*
image
,
GpGraphics
**
graphics
)
DECLSPEC_HIDDEN
;
...
...
dlls/gdiplus/tests/graphics.c
View file @
9288acda
...
...
@@ -3363,7 +3363,6 @@ todo_wine
status
=
GdipGetFontHeight
(
font
,
graphics
,
&
rval
);
expect
(
Ok
,
status
);
todo_wine
expectf
(
21
.
726563
,
rval
);
status
=
GdipGetFontSize
(
font
,
&
rval
);
expect
(
Ok
,
status
);
...
...
@@ -3383,7 +3382,6 @@ todo_wine
status
=
GdipGetFontHeight
(
font
,
graphics
,
&
rval
);
expect
(
Ok
,
status
);
todo_wine
expectf
(
7
.
664648
,
rval
);
status
=
GdipGetFontSize
(
font
,
&
rval
);
expect
(
Ok
,
status
);
...
...
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