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
6c94c0b0
Commit
6c94c0b0
authored
Oct 21, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Move the font charset information out of freetype.c.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ecba0d2b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
34 deletions
+26
-34
font.c
dlls/gdi32/font.c
+2
-1
freetype.c
dlls/gdi32/freetype.c
+21
-32
gdi_private.h
dlls/gdi32/gdi_private.h
+3
-1
No files found.
dlls/gdi32/font.c
View file @
6c94c0b0
...
...
@@ -1047,7 +1047,8 @@ static UINT CDECL font_GetTextCharsetInfo( PHYSDEV dev, FONTSIGNATURE *fs, DWORD
dev
=
GET_NEXT_PHYSDEV
(
dev
,
pGetTextCharsetInfo
);
return
dev
->
funcs
->
pGetTextCharsetInfo
(
dev
,
fs
,
flags
);
}
return
font_funcs
->
pGetTextCharsetInfo
(
physdev
->
font
,
fs
,
flags
);
if
(
fs
)
*
fs
=
physdev
->
font
->
fs
;
return
physdev
->
font
->
charset
;
}
...
...
dlls/gdi32/freetype.c
View file @
6c94c0b0
...
...
@@ -330,8 +330,6 @@ struct tagGdiFont {
/* the following members can be accessed without locking, they are never modified after creation */
FT_Face
ft_face
;
struct
font_mapping
*
mapping
;
int
charset
;
int
codepage
;
BOOL
fake_italic
;
BOOL
fake_bold
;
BYTE
underline
;
...
...
@@ -344,7 +342,6 @@ struct tagGdiFont {
DWORD
ntmFlags
;
DWORD
aa_flags
;
UINT
ntmCellHeight
,
ntmAvgWidth
;
FONTSIGNATURE
fs
;
GdiFont
*
base_font
;
VOID
*
GSUB_Table
;
const
VOID
*
vert_feature
;
...
...
@@ -4032,7 +4029,7 @@ static FT_Face OpenFontFace(GdiFont *font, Face *face, LONG width, LONG height)
}
static
int
get_nearest_charset
(
const
WCHAR
*
family_name
,
Face
*
face
,
int
*
cp
)
static
UINT
get_nearest_charset
(
const
WCHAR
*
family_name
,
Face
*
face
,
UINT
*
cp
)
{
/* Only get here if lfCharSet == DEFAULT_CHARSET or we couldn't find
a single face with the requested charset. The idea is to check if
...
...
@@ -4407,8 +4404,8 @@ static BOOL create_child_font_list(GdiFont *font)
* if not SYMBOL or OEM then we also get all the fonts for Microsoft
* Sans Serif. This is how asian windows get default fallbacks for fonts
*/
if
(
is_dbcs_ansi_cp
(
GetACP
())
&&
font
->
charset
!=
SYMBOL_CHARSET
&&
font
->
charset
!=
OEM_CHARSET
&&
if
(
is_dbcs_ansi_cp
(
GetACP
())
&&
gdi_
font
->
charset
!=
SYMBOL_CHARSET
&&
gdi_
font
->
charset
!=
OEM_CHARSET
&&
strcmpiW
(
font_name
,
szDefaultFallbackLink
)
!=
0
)
{
font_link
=
find_font_link
(
szDefaultFallbackLink
);
...
...
@@ -4702,7 +4699,7 @@ static const GSUB_Feature * GSUB_get_feature(const GSUB_Header *header, const GS
return
NULL
;
}
static
const
char
*
get_opentype_script
(
const
GdiF
ont
*
font
)
static
const
char
*
get_opentype_script
(
const
struct
gdi_f
ont
*
font
)
{
/*
* I am not sure if this is the correct way to generate our script tag
...
...
@@ -4741,7 +4738,7 @@ static const VOID * get_GSUB_vert_feature(const GdiFont *font)
header
=
font
->
GSUB_Table
;
script
=
GSUB_get_script_table
(
header
,
get_opentype_script
(
font
));
script
=
GSUB_get_script_table
(
header
,
get_opentype_script
(
font
->
gdi_font
));
if
(
!
script
)
{
TRACE
(
"Script not found
\n
"
);
...
...
@@ -5094,14 +5091,14 @@ found:
found_face:
height
=
lf
.
lfHeight
;
re
t
->
fs
=
face
->
fs
;
gdi_fon
t
->
fs
=
face
->
fs
;
if
(
csi
.
fs
.
fsCsb
[
0
])
{
re
t
->
charset
=
lf
.
lfCharSet
;
re
t
->
codepage
=
csi
.
ciACP
;
gdi_fon
t
->
charset
=
lf
.
lfCharSet
;
gdi_fon
t
->
codepage
=
csi
.
ciACP
;
}
else
ret
->
charset
=
get_nearest_charset
(
family
->
family_name
,
face
,
&
re
t
->
codepage
);
gdi_font
->
charset
=
get_nearest_charset
(
family
->
family_name
,
face
,
&
gdi_fon
t
->
codepage
);
TRACE
(
"Chosen: %s (%s/%p:%ld)
\n
"
,
debugstr_w
(
face
->
full_name
),
debugstr_w
(
face
->
file
),
face
->
font_data_ptr
,
face
->
face_index
);
...
...
@@ -5159,7 +5156,7 @@ found_face:
set_gdi_font_file_info
(
gdi_font
,
face
->
file
,
face
->
font_data_size
);
ret
->
ntmFlags
=
face
->
ntmFlags
;
pick_charmap
(
ret
->
ft_face
,
re
t
->
charset
);
pick_charmap
(
ret
->
ft_face
,
gdi_fon
t
->
charset
);
ret
->
orientation
=
FT_IS_SCALABLE
(
ret
->
ft_face
)
?
lf
.
lfOrientation
:
0
;
set_gdi_font_name
(
gdi_font
,
psub
?
psub
->
from
.
name
:
family
->
family_name
);
...
...
@@ -5728,6 +5725,7 @@ static FT_UInt get_glyph_index_symbol(const GdiFont *font, UINT glyph)
static
FT_UInt
get_glyph_index
(
const
GdiFont
*
font
,
UINT
glyph
)
{
struct
gdi_font
*
gdi_font
=
font
->
gdi_font
;
FT_UInt
ret
;
WCHAR
wc
;
char
buf
;
...
...
@@ -5739,13 +5737,13 @@ static FT_UInt get_glyph_index(const GdiFont *font, UINT glyph)
default_used_pointer
=
NULL
;
default_used
=
FALSE
;
if
(
codepage_sets_default_used
(
font
->
codepage
))
if
(
codepage_sets_default_used
(
gdi_
font
->
codepage
))
default_used_pointer
=
&
default_used
;
wc
=
(
WCHAR
)
glyph
;
if
(
!
WideCharToMultiByte
(
font
->
codepage
,
0
,
&
wc
,
1
,
&
buf
,
sizeof
(
buf
),
NULL
,
default_used_pointer
)
||
if
(
!
WideCharToMultiByte
(
gdi_
font
->
codepage
,
0
,
&
wc
,
1
,
&
buf
,
sizeof
(
buf
),
NULL
,
default_used_pointer
)
||
default_used
)
{
if
(
font
->
codepage
==
CP_SYMBOL
)
if
(
gdi_
font
->
codepage
==
CP_SYMBOL
)
{
ret
=
get_glyph_index_symbol
(
font
,
glyph
);
if
(
!
ret
)
...
...
@@ -5781,6 +5779,7 @@ static FT_UInt get_glyph_index(const GdiFont *font, UINT glyph)
/* helper for freetype_GetGlyphIndices */
static
FT_UInt
get_gdi_glyph_index
(
const
GdiFont
*
font
,
UINT
glyph
)
{
struct
gdi_font
*
gdi_font
=
font
->
gdi_font
;
WCHAR
wc
=
(
WCHAR
)
glyph
;
BOOL
default_used
=
FALSE
;
BOOL
*
default_used_pointer
=
NULL
;
...
...
@@ -5790,12 +5789,12 @@ static FT_UInt get_gdi_glyph_index(const GdiFont *font, UINT glyph)
if
(
font
->
ft_face
->
charmap
->
encoding
!=
FT_ENCODING_NONE
)
return
get_glyph_index
(
font
,
glyph
);
if
(
codepage_sets_default_used
(
font
->
codepage
))
if
(
codepage_sets_default_used
(
gdi_
font
->
codepage
))
default_used_pointer
=
&
default_used
;
if
(
!
WideCharToMultiByte
(
font
->
codepage
,
0
,
&
wc
,
1
,
&
buf
,
sizeof
(
buf
),
NULL
,
default_used_pointer
)
if
(
!
WideCharToMultiByte
(
gdi_
font
->
codepage
,
0
,
&
wc
,
1
,
&
buf
,
sizeof
(
buf
),
NULL
,
default_used_pointer
)
||
default_used
)
{
if
(
font
->
codepage
==
CP_SYMBOL
&&
wc
<
0x100
)
if
(
gdi_
font
->
codepage
==
CP_SYMBOL
&&
wc
<
0x100
)
ret
=
(
unsigned
char
)
wc
;
else
ret
=
0
;
...
...
@@ -6961,6 +6960,7 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format,
static
BOOL
get_bitmap_text_metrics
(
GdiFont
*
font
)
{
struct
gdi_font
*
gdi_font
=
font
->
gdi_font
;
FT_Face
ft_face
=
font
->
ft_face
;
FT_WinFNT_HeaderRec
winfnt_header
;
const
DWORD
size
=
offsetof
(
OUTLINETEXTMETRICW
,
otmFiller
);
...
...
@@ -7013,7 +7013,7 @@ static BOOL get_bitmap_text_metrics(GdiFont *font)
TM
.
tmStruckOut
=
font
->
strikeout
;
/* NB inverted meaning of TMPF_FIXED_PITCH */
TM
.
tmPitchAndFamily
=
FT_IS_FIXED_WIDTH
(
ft_face
)
?
0
:
TMPF_FIXED_PITCH
;
TM
.
tmCharSet
=
font
->
charset
;
TM
.
tmCharSet
=
gdi_
font
->
charset
;
}
if
(
font
->
fake_bold
)
...
...
@@ -7398,7 +7398,7 @@ static BOOL get_outline_text_metrics(GdiFont *font)
TM
.
tmPitchAndFamily
|=
TMPF_TRUETYPE
;
}
TM
.
tmCharSet
=
font
->
charset
;
TM
.
tmCharSet
=
gdi_
font
->
charset
;
font
->
potm
->
otmFiller
=
0
;
memcpy
(
&
font
->
potm
->
otmPanoseNumber
,
pOS2
->
panose
,
PANOSE_COUNT
);
...
...
@@ -7772,16 +7772,6 @@ static DWORD CDECL freetype_GetFontData( struct gdi_font *font, DWORD table, DWO
return
get_font_data
(
get_font_ptr
(
font
),
table
,
offset
,
buf
,
cbData
);
}
/*************************************************************
* freetype_GetTextCharsetInfo
*/
static
UINT
CDECL
freetype_GetTextCharsetInfo
(
struct
gdi_font
*
gdi_font
,
LPFONTSIGNATURE
fs
,
DWORD
flags
)
{
GdiFont
*
font
=
get_font_ptr
(
gdi_font
);
if
(
fs
)
*
fs
=
font
->
fs
;
return
font
->
charset
;
}
/* Retrieve a list of supported Unicode ranges for a given font.
* Can be called with NULL gs to calculate the buffer size. Returns
* the number of ranges found.
...
...
@@ -8190,7 +8180,6 @@ static const struct font_backend_funcs font_funcs =
freetype_GetGlyphOutline
,
freetype_GetKerningPairs
,
freetype_GetOutlineTextMetrics
,
freetype_GetTextCharsetInfo
,
freetype_GetTextExtentExPoint
,
freetype_GetTextExtentExPointI
,
freetype_GetTextMetrics
,
...
...
dlls/gdi32/gdi_private.h
View file @
6c94c0b0
...
...
@@ -313,6 +313,9 @@ struct gdi_font
DWORD
handle
;
DWORD
cache_num
;
DWORD
hash
;
UINT
charset
;
UINT
codepage
;
FONTSIGNATURE
fs
;
LOGFONTW
lf
;
FMAT2
matrix
;
BOOL
can_use_bitmap
;
...
...
@@ -336,7 +339,6 @@ struct font_backend_funcs
GLYPHMETRICS
*
gm
,
DWORD
buflen
,
void
*
buf
,
const
MAT2
*
mat
);
DWORD
(
CDECL
*
pGetKerningPairs
)(
struct
gdi_font
*
font
,
DWORD
count
,
KERNINGPAIR
*
pairs
);
UINT
(
CDECL
*
pGetOutlineTextMetrics
)(
struct
gdi_font
*
font
,
UINT
size
,
OUTLINETEXTMETRICW
*
metrics
);
UINT
(
CDECL
*
pGetTextCharsetInfo
)(
struct
gdi_font
*
font
,
FONTSIGNATURE
*
fs
,
DWORD
flags
);
BOOL
(
CDECL
*
pGetTextExtentExPoint
)(
struct
gdi_font
*
font
,
LPCWSTR
wstr
,
INT
count
,
INT
*
dxs
);
BOOL
(
CDECL
*
pGetTextExtentExPointI
)(
struct
gdi_font
*
font
,
const
WORD
*
indices
,
INT
count
,
INT
*
dxs
);
BOOL
(
CDECL
*
pGetTextMetrics
)(
struct
gdi_font
*
font
,
TEXTMETRICW
*
metrics
);
...
...
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