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
8487c2dd
Commit
8487c2dd
authored
Dec 02, 2007
by
Hans Leidekker
Committed by
Alexandre Julliard
Dec 03, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Implement GetTextExtentExPointI.
parent
7a4e3a10
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
57 additions
and
20 deletions
+57
-20
font.c
dlls/gdi32/font.c
+36
-10
freetype.c
dlls/gdi32/freetype.c
+19
-8
gdi32.spec
dlls/gdi32/gdi32.spec
+1
-1
gdi_private.h
dlls/gdi32/gdi_private.h
+1
-1
No files found.
dlls/gdi32/font.c
View file @
8487c2dd
...
...
@@ -1144,34 +1144,40 @@ BOOL WINAPI GetTextExtentPoint32W(
}
/***********************************************************************
* GetTextExtentPointI [GDI32.@]
* GetTextExtent
Ex
PointI [GDI32.@]
*
* Computes width and height of the array of glyph indices.
*
* PARAMS
* hdc [I] Handle of device context.
* indices [I] Glyph index array.
* count [I] Number of glyphs in array.
* max_ext [I] Maximum width in glyphs.
* nfit [O] Maximum number of characters.
* dxs [O] Partial string widths.
* size [O] Returned string size.
*
* RETURNS
* Success: TRUE
* Failure: FALSE
*/
BOOL
WINAPI
GetTextExtentPointI
(
HDC
hdc
,
/* [in] Handle of device context */
const
WORD
*
indices
,
/* [in] Address of glyph index array */
INT
count
,
/* [in] Number of glyphs in array */
LPSIZE
size
)
/* [out] Address of structure for string size */
BOOL
WINAPI
GetTextExtentExPointI
(
HDC
hdc
,
const
WORD
*
indices
,
INT
count
,
INT
max_ext
,
LPINT
nfit
,
LPINT
dxs
,
LPSIZE
size
)
{
BOOL
ret
=
FALSE
;
DC
*
dc
=
DC_GetDCPtr
(
hdc
);
if
(
!
dc
)
return
FALSE
;
if
(
dc
->
gdiFont
)
{
ret
=
WineEngGetTextExtent
PointI
(
dc
->
gdiFont
,
indices
,
count
,
size
);
size
->
cx
=
abs
(
INTERNAL_XDSTOWS
(
dc
,
size
->
cx
));
size
->
cy
=
abs
(
INTERNAL_YDSTOWS
(
dc
,
size
->
cy
));
ret
=
WineEngGetTextExtent
ExPointI
(
dc
->
gdiFont
,
indices
,
count
,
max_ext
,
nfit
,
dxs
,
size
);
size
->
cx
=
abs
(
INTERNAL_XDSTOWS
(
dc
,
size
->
cx
));
size
->
cy
=
abs
(
INTERNAL_YDSTOWS
(
dc
,
size
->
cy
));
size
->
cx
+=
count
*
dc
->
charExtra
;
}
else
if
(
dc
->
funcs
->
pGetTextExtentExPoint
)
{
FIXME
(
"calling GetTextExtentExPoint
\n
"
);
ret
=
dc
->
funcs
->
pGetTextExtentExPoint
(
dc
->
physDev
,
(
LPCWSTR
)
indices
,
count
,
0
,
NULL
,
NULL
,
size
);
count
,
max_ext
,
nfit
,
dxs
,
size
);
}
DC_ReleaseDCPtr
(
dc
);
...
...
@@ -1181,6 +1187,26 @@ BOOL WINAPI GetTextExtentPointI(
return
ret
;
}
/***********************************************************************
* GetTextExtentPointI [GDI32.@]
*
* Computes width and height of the array of glyph indices.
*
* PARAMS
* hdc [I] Handle of device context.
* indices [I] Glyph index array.
* count [I] Number of glyphs in array.
* size [O] Returned string size.
*
* RETURNS
* Success: TRUE
* Failure: FALSE
*/
BOOL
WINAPI
GetTextExtentPointI
(
HDC
hdc
,
const
WORD
*
indices
,
INT
count
,
LPSIZE
size
)
{
return
GetTextExtentExPointI
(
hdc
,
indices
,
count
,
0
,
NULL
,
NULL
,
size
);
}
/***********************************************************************
* GetTextExtentPointA (GDI32.@)
...
...
dlls/gdi32/freetype.c
View file @
8487c2dd
...
...
@@ -4580,17 +4580,18 @@ BOOL WineEngGetTextExtentExPoint(GdiFont *font, LPCWSTR wstr, INT count,
}
/*************************************************************
* WineEngGetTextExtentPointI
* WineEngGetTextExtent
Ex
PointI
*
*/
BOOL
WineEngGetTextExtentPointI
(
GdiFont
*
font
,
const
WORD
*
indices
,
INT
count
,
LPSIZE
size
)
BOOL
WineEngGetTextExtent
Ex
PointI
(
GdiFont
*
font
,
const
WORD
*
indices
,
INT
count
,
INT
max_ext
,
LPINT
pnfit
,
LPINT
dxs
,
LPSIZE
size
)
{
INT
idx
;
INT
nfit
=
0
,
ext
;
GLYPHMETRICS
gm
;
TEXTMETRICW
tm
;
TRACE
(
"%p, %p, %d, %
p
\n
"
,
font
,
indices
,
coun
t
,
size
);
TRACE
(
"%p, %p, %d, %
d, %p
\n
"
,
font
,
indices
,
count
,
max_ex
t
,
size
);
size
->
cx
=
0
;
WineEngGetTextMetrics
(
font
,
&
tm
);
...
...
@@ -4600,9 +4601,19 @@ BOOL WineEngGetTextExtentPointI(GdiFont *font, const WORD *indices, INT count,
WineEngGetGlyphOutline
(
font
,
indices
[
idx
],
GGO_METRICS
|
GGO_GLYPH_INDEX
,
&
gm
,
0
,
NULL
,
NULL
);
size
->
cx
+=
FONT_GM
(
font
,
indices
[
idx
])
->
adv
;
size
->
cx
+=
FONT_GM
(
font
,
indices
[
idx
])
->
adv
;
ext
=
size
->
cx
;
if
(
!
pnfit
||
ext
<=
max_ext
)
{
++
nfit
;
if
(
dxs
)
dxs
[
idx
]
=
ext
;
}
}
TRACE
(
"return %d,%d
\n
"
,
size
->
cx
,
size
->
cy
);
if
(
pnfit
)
*
pnfit
=
nfit
;
TRACE
(
"return %d, %d, %d
\n
"
,
size
->
cx
,
size
->
cy
,
nfit
);
return
TRUE
;
}
...
...
@@ -5129,8 +5140,8 @@ BOOL WineEngGetTextExtentExPoint(GdiFont *font, LPCWSTR wstr, INT count,
return
FALSE
;
}
BOOL
WineEngGetTextExtentPointI
(
GdiFont
*
font
,
const
WORD
*
indices
,
INT
count
,
LPSIZE
size
)
BOOL
WineEngGetTextExtent
Ex
PointI
(
GdiFont
*
font
,
const
WORD
*
indices
,
INT
count
,
INT
max_ext
,
LPINT
nfit
,
LPINT
dx
,
LPSIZE
size
)
{
ERR
(
"called but we don't have FreeType
\n
"
);
return
FALSE
;
...
...
dlls/gdi32/gdi32.spec
View file @
8487c2dd
...
...
@@ -332,7 +332,7 @@
@ stdcall GetTextCharsetInfo(long ptr long)
@ stdcall GetTextColor(long)
@ stdcall GetTextExtentExPointA(long str long long ptr ptr ptr)
# @ stub GetTextExtentExPointI
@ stdcall GetTextExtentExPointI(long ptr long long ptr ptr ptr)
@ stdcall GetTextExtentExPointW(long wstr long long ptr ptr ptr)
# @ stub GetTextExtentExPointWPri
@ stdcall GetTextExtentPoint32A(long str long ptr)
...
...
dlls/gdi32/gdi_private.h
View file @
8487c2dd
...
...
@@ -444,7 +444,7 @@ extern BOOL WineEngGetLinkedHFont(DC *dc, WCHAR c, HFONT *new_hfont, UINT *glyph
extern
UINT
WineEngGetOutlineTextMetrics
(
GdiFont
*
,
UINT
,
LPOUTLINETEXTMETRICW
)
DECLSPEC_HIDDEN
;
extern
UINT
WineEngGetTextCharsetInfo
(
GdiFont
*
font
,
LPFONTSIGNATURE
fs
,
DWORD
flags
)
DECLSPEC_HIDDEN
;
extern
BOOL
WineEngGetTextExtentExPoint
(
GdiFont
*
,
LPCWSTR
,
INT
,
INT
,
LPINT
,
LPINT
,
LPSIZE
)
DECLSPEC_HIDDEN
;
extern
BOOL
WineEngGetTextExtent
PointI
(
GdiFont
*
,
const
WORD
*
,
INT
,
LPSIZE
)
DECLSPEC_HIDDEN
;
extern
BOOL
WineEngGetTextExtent
ExPointI
(
GdiFont
*
,
const
WORD
*
,
INT
,
INT
,
LPINT
,
LP
INT
,
LPSIZE
)
DECLSPEC_HIDDEN
;
extern
INT
WineEngGetTextFace
(
GdiFont
*
,
INT
,
LPWSTR
)
DECLSPEC_HIDDEN
;
extern
BOOL
WineEngGetTextMetrics
(
GdiFont
*
,
LPTEXTMETRICW
)
DECLSPEC_HIDDEN
;
extern
BOOL
WineEngFontIsLinked
(
GdiFont
*
)
DECLSPEC_HIDDEN
;
...
...
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