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
591a31ba
Commit
591a31ba
authored
Mar 04, 2013
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Increment the face refcount when loading the same font file multiple times.
parent
93c1389b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
0 deletions
+24
-0
freetype.c
dlls/gdi32/freetype.c
+7
-0
font.c
dlls/gdi32/tests/font.c
+17
-0
No files found.
dlls/gdi32/freetype.c
View file @
591a31ba
...
...
@@ -1304,6 +1304,13 @@ static BOOL insert_face_in_family_list( Face *face, Family *family )
debugstr_w
(
family
->
FamilyName
),
debugstr_w
(
face
->
StyleName
),
cursor
->
font_version
,
face
->
font_version
);
if
(
face
->
file
&&
face
->
dev
==
cursor
->
dev
&&
face
->
ino
==
cursor
->
ino
)
{
cursor
->
refcount
++
;
TRACE
(
"Font %s already in list, refcount now %d
\n
"
,
debugstr_w
(
face
->
file
),
cursor
->
refcount
);
return
FALSE
;
}
if
(
face
->
font_version
<=
cursor
->
font_version
)
{
TRACE
(
"Original font %s is newer so skipping %s
\n
"
,
...
...
dlls/gdi32/tests/font.c
View file @
591a31ba
...
...
@@ -4567,6 +4567,7 @@ static void test_CreateScalableFontResource(void)
char
fot_name
[
MAX_PATH
];
char
*
file_part
;
DWORD
ret
;
int
i
;
if
(
!
pAddFontResourceExA
||
!
pRemoveFontResourceExA
)
{
...
...
@@ -4655,6 +4656,22 @@ static void test_CreateScalableFontResource(void)
ret
=
pRemoveFontResourceExA
(
fot_name
,
0
,
0
);
ok
(
!
ret
,
"RemoveFontResourceEx() should fail
\n
"
);
/* test refcounting */
for
(
i
=
0
;
i
<
5
;
i
++
)
{
SetLastError
(
0xdeadbeef
);
ret
=
pAddFontResourceExA
(
fot_name
,
0
,
0
);
ok
(
ret
,
"AddFontResourceEx() error %d
\n
"
,
GetLastError
());
}
for
(
i
=
0
;
i
<
5
;
i
++
)
{
SetLastError
(
0xdeadbeef
);
ret
=
pRemoveFontResourceExA
(
fot_name
,
0
,
0
);
ok
(
ret
,
"RemoveFontResourceEx() error %d
\n
"
,
GetLastError
());
}
ret
=
pRemoveFontResourceExA
(
fot_name
,
0
,
0
);
ok
(
!
ret
,
"RemoveFontResourceEx() should fail
\n
"
);
DeleteFile
(
fot_name
);
/* test hidden font resource */
...
...
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