Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
922e15cb
Commit
922e15cb
authored
May 17, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Use the subpixel rendering configuration from fontconfig to override the registry options.
parent
1371e71f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
84 additions
and
0 deletions
+84
-0
xrender.c
dlls/winex11.drv/xrender.c
+84
-0
No files found.
dlls/winex11.drv/xrender.c
View file @
922e15cb
...
...
@@ -182,6 +182,21 @@ MAKE_FUNCPTR(XRenderSetPictureClipRectangles)
MAKE_FUNCPTR
(
XRenderSetPictureTransform
)
#endif
MAKE_FUNCPTR
(
XRenderQueryExtension
)
#ifdef SONAME_LIBFONTCONFIG
#include <fontconfig/fontconfig.h>
MAKE_FUNCPTR
(
FcConfigSubstitute
)
MAKE_FUNCPTR
(
FcDefaultSubstitute
)
MAKE_FUNCPTR
(
FcFontMatch
)
MAKE_FUNCPTR
(
FcInit
)
MAKE_FUNCPTR
(
FcPatternCreate
)
MAKE_FUNCPTR
(
FcPatternDestroy
)
MAKE_FUNCPTR
(
FcPatternAddInteger
)
MAKE_FUNCPTR
(
FcPatternAddString
)
MAKE_FUNCPTR
(
FcPatternGetInteger
)
static
BOOL
fontconfig_installed
;
#endif
#undef MAKE_FUNCPTR
static
CRITICAL_SECTION
xrender_cs
;
...
...
@@ -326,6 +341,7 @@ static int load_xrender_formats(void)
void
X11DRV_XRender_Init
(
void
)
{
int
event_base
,
i
;
void
*
fontconfig_handle
;
if
(
client_side_with_render
&&
wine_dlopen
(
SONAME_LIBX11
,
RTLD_NOW
|
RTLD_GLOBAL
,
NULL
,
0
)
&&
...
...
@@ -379,6 +395,23 @@ LOAD_OPTIONAL_FUNCPTR(XRenderSetPictureTransform)
}
}
if
((
fontconfig_handle
=
wine_dlopen
(
SONAME_LIBFONTCONFIG
,
RTLD_NOW
,
NULL
,
0
)))
{
#define LOAD_FUNCPTR(f) if((p##f = wine_dlsym(fontconfig_handle, #f, NULL, 0)) == NULL){WARN("Can't find symbol %s\n", #f); goto sym_not_found;}
LOAD_FUNCPTR
(
FcConfigSubstitute
);
LOAD_FUNCPTR
(
FcDefaultSubstitute
);
LOAD_FUNCPTR
(
FcFontMatch
);
LOAD_FUNCPTR
(
FcInit
);
LOAD_FUNCPTR
(
FcPatternCreate
);
LOAD_FUNCPTR
(
FcPatternDestroy
);
LOAD_FUNCPTR
(
FcPatternAddInteger
);
LOAD_FUNCPTR
(
FcPatternAddString
);
LOAD_FUNCPTR
(
FcPatternGetInteger
);
#undef LOAD_FUNCPTR
fontconfig_installed
=
pFcInit
();
}
else
TRACE
(
"cannot find the fontconfig library "
SONAME_LIBFONTCONFIG
"
\n
"
);
sym_not_found:
if
(
X11DRV_XRender_Installed
||
client_side_with_core
)
{
...
...
@@ -839,6 +872,57 @@ static int GetCacheEntry(X11DRV_PDEVICE *physDev, LFANDSIZE *plfsz)
entry
->
aa_default
=
AA_None
;
break
;
}
#ifdef SONAME_LIBFONTCONFIG
if
(
fontconfig_installed
)
{
FcPattern
*
match
,
*
pattern
=
pFcPatternCreate
();
FcResult
result
;
char
family
[
LF_FACESIZE
*
4
];
WideCharToMultiByte
(
CP_UTF8
,
0
,
plfsz
->
lf
.
lfFaceName
,
-
1
,
family
,
sizeof
(
family
),
NULL
,
NULL
);
pFcPatternAddString
(
pattern
,
FC_FAMILY
,
(
FcChar8
*
)
family
);
if
(
plfsz
->
lf
.
lfWeight
!=
FW_DONTCARE
)
{
int
weight
;
switch
(
plfsz
->
lf
.
lfWeight
)
{
case
FW_THIN
:
weight
=
FC_WEIGHT_THIN
;
break
;
case
FW_EXTRALIGHT
:
weight
=
FC_WEIGHT_EXTRALIGHT
;
break
;
case
FW_LIGHT
:
weight
=
FC_WEIGHT_LIGHT
;
break
;
case
FW_NORMAL
:
weight
=
FC_WEIGHT_NORMAL
;
break
;
case
FW_MEDIUM
:
weight
=
FC_WEIGHT_MEDIUM
;
break
;
case
FW_SEMIBOLD
:
weight
=
FC_WEIGHT_SEMIBOLD
;
break
;
case
FW_BOLD
:
weight
=
FC_WEIGHT_BOLD
;
break
;
case
FW_EXTRABOLD
:
weight
=
FC_WEIGHT_EXTRABOLD
;
break
;
case
FW_HEAVY
:
weight
=
FC_WEIGHT_HEAVY
;
break
;
default:
weight
=
(
plfsz
->
lf
.
lfWeight
-
80
)
/
4
;
break
;
}
pFcPatternAddInteger
(
pattern
,
FC_WEIGHT
,
weight
);
}
pFcPatternAddInteger
(
pattern
,
FC_SLANT
,
plfsz
->
lf
.
lfItalic
?
FC_SLANT_ITALIC
:
FC_SLANT_ROMAN
);
pFcConfigSubstitute
(
NULL
,
pattern
,
FcMatchPattern
);
pFcDefaultSubstitute
(
pattern
);
if
((
match
=
pFcFontMatch
(
NULL
,
pattern
,
&
result
)))
{
int
rgba
;
if
(
pFcPatternGetInteger
(
match
,
FC_RGBA
,
0
,
&
rgba
)
==
FcResultMatch
)
{
switch
(
rgba
)
{
case
FC_RGBA_RGB
:
entry
->
aa_default
=
AA_RGB
;
break
;
case
FC_RGBA_BGR
:
entry
->
aa_default
=
AA_BGR
;
break
;
case
FC_RGBA_VRGB
:
entry
->
aa_default
=
AA_VRGB
;
break
;
case
FC_RGBA_VBGR
:
entry
->
aa_default
=
AA_VBGR
;
break
;
case
FC_RGBA_NONE
:
entry
->
aa_default
=
AA_None
;
break
;
}
}
pFcPatternDestroy
(
match
);
}
pFcPatternDestroy
(
pattern
);
}
#endif
/* SONAME_LIBFONTCONFIG */
}
else
entry
->
aa_default
=
AA_None
;
...
...
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