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
8656f6db
Commit
8656f6db
authored
Nov 28, 2008
by
Hans Leidekker
Committed by
Alexandre Julliard
Dec 01, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Better implementation of GdipGetFontHeightGivenDPI.
parent
aa5358fd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
1 deletion
+24
-1
font.c
dlls/gdiplus/font.c
+22
-1
gdiplus_private.h
dlls/gdiplus/gdiplus_private.h
+2
-0
No files found.
dlls/gdiplus/font.c
View file @
8656f6db
...
...
@@ -153,6 +153,8 @@ GpStatus WINGDIPAPI GdipCreateFont(GDIPCONST GpFontFamily *fontFamily,
(
*
font
)
->
unit
=
unit
;
(
*
font
)
->
emSize
=
emSize
;
(
*
font
)
->
height
=
tmw
->
ntmSizeEM
;
(
*
font
)
->
line_spacing
=
tmw
->
tmAscent
+
tmw
->
tmDescent
+
tmw
->
tmExternalLeading
;
return
Ok
;
}
...
...
@@ -194,6 +196,9 @@ GpStatus WINGDIPAPI GdipCreateFontFromLogfontW(HDC hdc,
(
*
font
)
->
lfw
.
lfHeight
=
-
textmet
.
tmHeight
;
(
*
font
)
->
lfw
.
lfWeight
=
textmet
.
tmWeight
;
(
*
font
)
->
height
=
1
;
/* FIXME: need NEWTEXTMETRIC.ntmSizeEM here */
(
*
font
)
->
line_spacing
=
textmet
.
tmAscent
+
textmet
.
tmDescent
+
textmet
.
tmExternalLeading
;
SelectObject
(
hdc
,
oldfont
);
DeleteObject
(
hfont
);
...
...
@@ -444,15 +449,31 @@ GpStatus WINGDIPAPI GdipGetFontHeight(GDIPCONST GpFont *font,
*/
GpStatus
WINGDIPAPI
GdipGetFontHeightGivenDPI
(
GDIPCONST
GpFont
*
font
,
REAL
dpi
,
REAL
*
height
)
{
REAL
font_height
;
TRACE
(
"%p (%s), %f, %p
\n
"
,
font
,
debugstr_w
(
font
->
lfw
.
lfFaceName
),
dpi
,
height
);
if
(
!
(
font
&&
height
))
return
InvalidParameter
;
font_height
=
font
->
line_spacing
*
(
font
->
emSize
/
font
->
height
);
switch
(
font
->
unit
)
{
case
UnitPixel
:
*
height
=
font
->
emSize
;
*
height
=
font_height
;
break
;
case
UnitPoint
:
*
height
=
font_height
*
dpi
*
inch_per_point
;
break
;
case
UnitInch
:
*
height
=
font_height
*
dpi
;
break
;
case
UnitDocument
:
*
height
=
font_height
*
(
dpi
/
300
.
0
);
break
;
case
UnitMillimeter
:
*
height
=
font_height
*
(
dpi
/
mm_per_inch
);
break
;
default:
FIXME
(
"Unhandled unit type: %d
\n
"
,
font
->
unit
);
...
...
dlls/gdiplus/gdiplus_private.h
View file @
8656f6db
...
...
@@ -209,6 +209,8 @@ struct GpImageAttributes{
struct
GpFont
{
LOGFONTW
lfw
;
REAL
emSize
;
UINT
height
;
LONG
line_spacing
;
Unit
unit
;
};
...
...
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