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
e1e51f99
Commit
e1e51f99
authored
Apr 03, 2002
by
Huw D M Davies
Committed by
Alexandre Julliard
Apr 03, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't calculate cached metrics or enumerate X11 fonts if we're using
client side fonts.
parent
f879cb9e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
22 deletions
+38
-22
init.c
graphics/x11drv/init.c
+5
-2
xfont.c
graphics/x11drv/xfont.c
+31
-19
x11drv.h
include/x11drv.h
+2
-1
No files found.
graphics/x11drv/init.c
View file @
e1e51f99
...
...
@@ -53,7 +53,10 @@ static int log_pixels_y; /* pixels per logical inch in y direction */
static
int
horz_size
;
/* horz. size of screen in millimeters */
static
int
vert_size
;
/* vert. size of screen in millimeters */
static
int
palette_size
;
static
int
text_caps
;
unsigned
int
text_caps
=
(
TC_OP_CHARACTER
|
TC_OP_STROKE
|
TC_CP_STROKE
|
TC_CR_ANY
|
TC_SA_DOUBLE
|
TC_SA_INTEGER
|
TC_SA_CONTIN
|
TC_UA_ABLE
|
TC_SO_ABLE
|
TC_RA_ABLE
);
/* X11R6 adds TC_SF_X_YINDEP, Xrender adds TC_VA_ABLE */
/**********************************************************************
* X11DRV_GDI_Initialize
...
...
@@ -76,7 +79,7 @@ BOOL X11DRV_GDI_Initialize( Display *display )
log_pixels_x
=
MulDiv
(
WidthOfScreen
(
screen
),
254
,
WidthMMOfScreen
(
screen
)
*
10
);
log_pixels_y
=
MulDiv
(
HeightOfScreen
(
screen
),
254
,
HeightMMOfScreen
(
screen
)
*
10
);
text_caps
=
X11DRV_FONT_Init
(
&
log_pixels_x
,
&
log_pixels_y
);
X11DRV_FONT_Init
(
&
log_pixels_x
,
&
log_pixels_y
);
horz_size
=
MulDiv
(
screen_width
,
254
,
log_pixels_x
*
10
);
vert_size
=
MulDiv
(
screen_height
,
254
,
log_pixels_y
*
10
);
return
TRUE
;
...
...
graphics/x11drv/xfont.c
View file @
e1e51f99
...
...
@@ -77,11 +77,6 @@ typedef struct __fontAlias
static
fontAlias
*
aliasTable
=
NULL
;
static
UINT
XTextCaps
=
(
TC_OP_CHARACTER
|
TC_OP_STROKE
|
TC_CP_STROKE
|
TC_CR_ANY
|
TC_SA_DOUBLE
|
TC_SA_INTEGER
|
TC_SA_CONTIN
|
TC_UA_ABLE
|
TC_SO_ABLE
|
TC_RA_ABLE
);
/* X11R6 adds TC_SF_X_YINDEP, maybe more... */
static
const
char
*
INIFontMetrics
=
"cachedmetrics."
;
static
const
char
*
INIFontSection
=
"Software
\\
Wine
\\
Wine
\\
Config
\\
fonts"
;
static
const
char
*
INIAliasSection
=
"Alias"
;
...
...
@@ -952,7 +947,7 @@ static BOOL LFD_ComposeLFD( const fontObject* fo,
aLFD
.
resolution_x
=
resx_string
;
strcpy
(
resy_string
,
resx_string
);
if
(
uRelax
==
0
&&
XTextC
aps
&
TC_SF_X_YINDEP
)
if
(
uRelax
==
0
&&
text_c
aps
&
TC_SF_X_YINDEP
)
{
if
(
fo
->
lf
.
lfWidth
&&
!
(
fo
->
fo_flags
&
FO_SYNTH_WIDTH
))
{
...
...
@@ -2428,7 +2423,7 @@ static UINT XFONT_Match( fontMatch* pfm )
fontInfo
*
pfi
=
pfm
->
pfi
;
/* device font to match */
LPLOGFONT16
plf
=
pfm
->
plf
;
/* wanted logical font */
UINT
penalty
=
0
;
BOOL
bR6
=
pfm
->
flags
&
FO_MATCH_XYINDEP
;
/* from
TextC
aps */
BOOL
bR6
=
pfm
->
flags
&
FO_MATCH_XYINDEP
;
/* from
text_c
aps */
BOOL
bScale
=
pfi
->
fi_flags
&
FI_SCALABLE
;
int
d
=
0
,
height
;
...
...
@@ -2834,24 +2829,22 @@ static int XFONT_ReleaseCacheEntry(const fontObject* pfo)
}
/***********************************************************************
* X11DRV_FONT_Init
* X11DRV_FONT_Init
X11Metrics
*
* Initialize font resource list and allocate font cache.
*/
int
X11DRV_FONT_Init
(
int
*
log_pixels_x
,
int
*
log_pixels_y
)
void
X11DRV_FONT_InitX11Metrics
(
void
)
{
char
**
x_pattern
;
unsigned
x_checksum
;
int
i
,
res
,
x_count
,
fd
,
buf_size
;
int
i
,
x_count
,
fd
,
buf_size
;
char
*
buffer
;
HKEY
hkey
;
res
=
XFONT_GetPointResolution
(
log_pixels_x
,
log_pixels_y
);
x_pattern
=
TSXListFonts
(
gdi_display
,
"*"
,
MAX_FONTS
,
&
x_count
);
TRACE
(
"Font Mapper: initializing %i fonts [logical dpi=%i, default dpi=%i]
\n
"
,
x_count
,
res
,
DefResolution
);
TRACE
(
"Font Mapper: initializing %i x11 fonts
\n
"
,
x_count
);
if
(
x_count
==
MAX_FONTS
)
MESSAGE
(
"There may be more fonts available - try increasing the value of MAX_FONTS
\n
"
);
...
...
@@ -2917,7 +2910,7 @@ int X11DRV_FONT_Init( int *log_pixels_x, int *log_pixels_y )
strcpy
(
buffer
,
"-*-*-*-*-normal-*-[12 0 0 12]-*-72-*-*-*-iso8859-1"
);
if
(
(
x_fs
=
TSXLoadQueryFont
(
gdi_display
,
buffer
))
)
{
XTextC
aps
|=
TC_SF_X_YINDEP
;
text_c
aps
|=
TC_SF_X_YINDEP
;
TSXFreeFont
(
gdi_display
,
x_fs
);
}
}
...
...
@@ -2939,11 +2932,20 @@ int X11DRV_FONT_Init( int *log_pixels_x, int *log_pixels_y )
RAW_ASCENT
=
TSXInternAtom
(
gdi_display
,
"RAW_ASCENT"
,
TRUE
);
RAW_DESCENT
=
TSXInternAtom
(
gdi_display
,
"RAW_DESCENT"
,
TRUE
);
return
;
}
/***********************************************************************
* X11DRV_FONT_Init
*/
void
X11DRV_FONT_Init
(
int
*
log_pixels_x
,
int
*
log_pixels_y
)
{
XFONT_GetPointResolution
(
log_pixels_x
,
log_pixels_y
);
if
(
X11DRV_XRender_Installed
)
XTextC
aps
|=
TC_VA_ABLE
;
text_c
aps
|=
TC_VA_ABLE
;
return
XTextCaps
;
return
;
}
/**********************************************************************
...
...
@@ -3016,7 +3018,7 @@ static X_PHYSFONT XFONT_RealizeFont( const LPLOGFONT16 plf,
fm
.
plf
=
plf
;
fm
.
internal_charset
=
internal_charset
;
if
(
XTextC
aps
&
TC_SF_X_YINDEP
)
fm
.
flags
=
FO_MATCH_XYINDEP
;
if
(
text_c
aps
&
TC_SF_X_YINDEP
)
fm
.
flags
=
FO_MATCH_XYINDEP
;
/* allocate new font cache entry */
...
...
@@ -3203,6 +3205,8 @@ HFONT X11DRV_SelectFont( X11DRV_PDEVICE *physDev, HFONT hfont )
EnterCriticalSection
(
&
crtsc_fonts_X11
);
if
(
fontList
==
NULL
)
X11DRV_FONT_InitX11Metrics
();
if
(
CHECK_PFONT
(
physDev
->
font
)
)
XFONT_ReleaseCacheEntry
(
__PFONT
(
physDev
->
font
)
);
...
...
@@ -3279,9 +3283,17 @@ BOOL X11DRV_EnumDeviceFonts( HDC hdc, LPLOGFONTW plf,
ENUMLOGFONTEXW
lf
;
NEWTEXTMETRICEXW
tm
;
fontResource
*
pfr
=
fontList
;
BOOL
b
,
bRet
=
0
;
BOOL
b
,
bRet
=
0
,
using_gdi
=
0
;
LOGFONT16
lf16
;
DC
*
dc
;
dc
=
DC_GetDCPtr
(
hdc
);
if
(
!
dc
)
return
FALSE
;
if
(
dc
->
gdiFont
)
using_gdi
=
TRUE
;
GDI_ReleaseObj
(
hdc
);
/* don't enumerate x11 fonts if we're using client side fonts */
if
(
using_gdi
)
return
FALSE
;
FONT_LogFontWTo16
(
plf
,
&
lf16
);
...
...
include/x11drv.h
View file @
e1e51f99
...
...
@@ -185,7 +185,7 @@ extern BOOL X11DRV_SwapBuffers(DC *dc) ;
/* X11 driver internal functions */
extern
BOOL
X11DRV_BITMAP_Init
(
void
);
extern
int
X11DRV_FONT_Init
(
int
*
log_pixels_x
,
int
*
log_pixels_y
);
extern
void
X11DRV_FONT_Init
(
int
*
log_pixels_x
,
int
*
log_pixels_y
);
extern
BOOL
X11DRV_BITMAP_DeleteObject
(
HBITMAP
hbitmap
);
struct
tagBITMAPOBJ
;
...
...
@@ -348,6 +348,7 @@ extern Window root_window;
extern
unsigned
int
screen_width
;
extern
unsigned
int
screen_height
;
extern
unsigned
int
screen_depth
;
extern
unsigned
int
text_caps
;
extern
Atom
wmProtocols
;
extern
Atom
wmDeleteWindow
;
...
...
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