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
72272d00
Commit
72272d00
authored
Oct 28, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Move part of the GetCharWidthInfo() implementation out of freetype.c.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
37494499
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
16 deletions
+16
-16
font.c
dlls/gdi32/font.c
+7
-1
freetype.c
dlls/gdi32/freetype.c
+8
-14
gdi_private.h
dlls/gdi32/gdi_private.h
+1
-1
No files found.
dlls/gdi32/font.c
View file @
72272d00
...
...
@@ -1053,13 +1053,19 @@ static BOOL CDECL font_GetCharWidth( PHYSDEV dev, UINT first, UINT last, INT *bu
static
BOOL
CDECL
font_GetCharWidthInfo
(
PHYSDEV
dev
,
void
*
ptr
)
{
struct
font_physdev
*
physdev
=
get_font_dev
(
dev
);
struct
char_width_info
*
info
=
ptr
;
if
(
!
physdev
->
font
)
{
dev
=
GET_NEXT_PHYSDEV
(
dev
,
pGetCharWidthInfo
);
return
dev
->
funcs
->
pGetCharWidthInfo
(
dev
,
ptr
);
}
return
font_funcs
->
pGetCharWidthInfo
(
physdev
->
font
,
ptr
);
info
->
unk
=
0
;
if
(
!
physdev
->
font
->
scalable
||
!
font_funcs
->
get_char_width_info
(
physdev
->
font
,
info
))
info
->
lsb
=
info
->
rsb
=
0
;
return
TRUE
;
}
...
...
dlls/gdi32/freetype.c
View file @
72272d00
...
...
@@ -6654,29 +6654,23 @@ done:
}
/*************************************************************
* freetype_
GetCharWidthI
nfo
* freetype_
get_char_width_i
nfo
*/
static
BOOL
CDECL
freetype_
GetCharWidthInfo
(
struct
gdi_font
*
gdi_
font
,
struct
char_width_info
*
info
)
static
BOOL
CDECL
freetype_
get_char_width_info
(
struct
gdi_font
*
font
,
struct
char_width_info
*
info
)
{
GdiFont
*
font
=
get_font_ptr
(
gdi_font
)
;
FT_Face
face
=
get_font_ptr
(
font
)
->
ft_face
;
TT_HoriHeader
*
pHori
;
TRACE
(
"%p, %p
\n
"
,
font
,
info
);
if
(
gdi_font
->
scalable
&&
(
pHori
=
pFT_Get_Sfnt_Table
(
font
->
ft_face
,
ft_sfnt_hhea
)))
if
((
pHori
=
pFT_Get_Sfnt_Table
(
face
,
ft_sfnt_hhea
)))
{
FT_Fixed
em_scale
;
em_scale
=
MulDiv
(
gdi_font
->
ppem
,
1
<<
16
,
font
->
ft_face
->
units_per_EM
);
FT_Fixed
em_scale
=
MulDiv
(
font
->
ppem
,
1
<<
16
,
face
->
units_per_EM
);
info
->
lsb
=
(
SHORT
)
pFT_MulFix
(
pHori
->
min_Left_Side_Bearing
,
em_scale
);
info
->
rsb
=
(
SHORT
)
pFT_MulFix
(
pHori
->
min_Right_Side_Bearing
,
em_scale
);
return
TRUE
;
}
else
info
->
lsb
=
info
->
rsb
=
0
;
info
->
unk
=
0
;
return
TRUE
;
return
FALSE
;
}
...
...
@@ -6973,7 +6967,6 @@ static const struct font_backend_funcs font_funcs =
{
freetype_EnumFonts
,
freetype_FontIsLinked
,
freetype_GetCharWidthInfo
,
freetype_SelectFont
,
freetype_add_font
,
freetype_add_mem_font
,
...
...
@@ -6984,6 +6977,7 @@ static const struct font_backend_funcs font_funcs =
freetype_get_default_glyph
,
freetype_get_glyph_outline
,
freetype_get_unicode_ranges
,
freetype_get_char_width_info
,
freetype_set_outline_text_metrics
,
freetype_set_bitmap_text_metrics
,
freetype_get_kerning_pairs
,
...
...
dlls/gdi32/gdi_private.h
View file @
72272d00
...
...
@@ -366,7 +366,6 @@ struct font_backend_funcs
{
BOOL
(
CDECL
*
pEnumFonts
)(
LOGFONTW
*
lf
,
FONTENUMPROCW
proc
,
LPARAM
lparam
);
BOOL
(
CDECL
*
pFontIsLinked
)(
struct
gdi_font
*
font
);
BOOL
(
CDECL
*
pGetCharWidthInfo
)(
struct
gdi_font
*
font
,
struct
char_width_info
*
info
);
struct
gdi_font
*
(
CDECL
*
pSelectFont
)(
DC
*
dc
,
HFONT
hfont
,
UINT
*
aa_flags
,
UINT
default_aa_flags
);
INT
(
CDECL
*
add_font
)(
const
WCHAR
*
file
,
DWORD
flags
);
...
...
@@ -381,6 +380,7 @@ struct font_backend_funcs
DWORD
(
CDECL
*
get_glyph_outline
)(
struct
gdi_font
*
font
,
UINT
glyph
,
UINT
format
,
GLYPHMETRICS
*
gm
,
ABC
*
abc
,
DWORD
buflen
,
void
*
buf
,
const
MAT2
*
mat
);
DWORD
(
CDECL
*
get_unicode_ranges
)(
struct
gdi_font
*
font
,
GLYPHSET
*
gs
);
BOOL
(
CDECL
*
get_char_width_info
)(
struct
gdi_font
*
font
,
struct
char_width_info
*
info
);
BOOL
(
CDECL
*
set_outline_text_metrics
)(
struct
gdi_font
*
font
);
BOOL
(
CDECL
*
set_bitmap_text_metrics
)(
struct
gdi_font
*
font
);
DWORD
(
CDECL
*
get_kerning_pairs
)(
struct
gdi_font
*
gdi_font
,
KERNINGPAIR
**
kern_pair
);
...
...
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