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
28896ee7
Commit
28896ee7
authored
Jul 24, 1999
by
Huw D M Davies
Committed by
Alexandre Julliard
Jul 24, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
For large font sizes call XLoadQueryFont with a 100 pixel high font
and rescale the metrics.
parent
d016b0a0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
11 deletions
+20
-11
xfont.c
graphics/x11drv/xfont.c
+19
-11
x11font.h
include/x11font.h
+1
-0
No files found.
graphics/x11drv/xfont.c
View file @
28896ee7
...
...
@@ -822,13 +822,16 @@ static void XFONT_GetTextMetric( fontObject* pfo, LPTEXTMETRICA pTM )
pTM
->
tmAscent
=
pfo
->
lpX11Trans
->
ascent
;
pTM
->
tmDescent
=
pfo
->
lpX11Trans
->
descent
;
}
pTM
->
tmAscent
*=
pfo
->
rescale
;
pTM
->
tmDescent
*=
pfo
->
rescale
;
pTM
->
tmHeight
=
pTM
->
tmAscent
+
pTM
->
tmDescent
;
pTM
->
tmAveCharWidth
=
pfo
->
foAvgCharWidth
;
pTM
->
tmMaxCharWidth
=
pfo
->
foMaxCharWidth
;
pTM
->
tmAveCharWidth
=
pfo
->
foAvgCharWidth
*
pfo
->
rescale
;
pTM
->
tmMaxCharWidth
=
pfo
->
foMaxCharWidth
*
pfo
->
rescale
;
pTM
->
tmInternalLeading
=
pfo
->
foInternalLeading
;
pTM
->
tmExternalLeading
=
pdf
->
dfExternalLeading
;
pTM
->
tmInternalLeading
=
pfo
->
foInternalLeading
*
pfo
->
rescale
;
pTM
->
tmExternalLeading
=
pdf
->
dfExternalLeading
*
pfo
->
rescale
;
pTM
->
tmStruckOut
=
(
pfo
->
fo_flags
&
FO_SYNTH_STRIKEOUT
)
?
1
:
pdf
->
dfStrikeOut
;
...
...
@@ -2393,10 +2396,13 @@ static X_PHYSFONT XFONT_RealizeFont( LPLOGFONT16 plf )
if
(
abs
(
plf
->
lfHeight
)
>
MAX_FONT_SIZE
)
{
ERR
(
"plf->lfHeight = %d, this is probably not right. Setting to 12
\n
"
,
"plf->lfHeight = %d, Creating a 100 pixel font and rescaling metrics
\n
"
,
plf
->
lfHeight
);
plf
->
lfHeight
=
12
;
}
pfo
->
rescale
=
fabs
(
plf
->
lfHeight
/
100
.
0
);
if
(
plf
->
lfHeight
>
0
)
plf
->
lfHeight
=
100
;
else
plf
->
lfHeight
=
-
100
;
}
else
pfo
->
rescale
=
1
.
0
;
XFONT_MatchDeviceFont
(
fontList
,
&
fm
);
...
...
@@ -2643,6 +2649,8 @@ BOOL X11DRV_GetTextExtentPoint( DC *dc, LPCSTR str, INT count,
dc
->
wndExtX
/
dc
->
vportExtX
);
size
->
cy
=
fabs
(
y
*
dc
->
wndExtY
/
dc
->
vportExtY
);
}
size
->
cx
*=
pfo
->
rescale
;
size
->
cy
*=
pfo
->
rescale
;
return
TRUE
;
}
return
FALSE
;
...
...
@@ -2684,9 +2692,9 @@ BOOL X11DRV_GetCharWidth( DC *dc, UINT firstChar, UINT lastChar,
for
(
i
=
firstChar
;
i
<=
lastChar
;
i
++
)
if
(
pfo
->
lpX11Trans
)
*
buffer
++
=
pfo
->
fs
->
min_bounds
.
attributes
*
pfo
->
lpX11Trans
->
pixelsize
/
1000
.
0
;
pfo
->
lpX11Trans
->
pixelsize
/
1000
.
0
*
pfo
->
rescale
;
else
*
buffer
++
=
pfo
->
fs
->
min_bounds
.
width
;
*
buffer
++
=
pfo
->
fs
->
min_bounds
.
width
*
pfo
->
rescale
;
else
{
XCharStruct
*
cs
,
*
def
;
...
...
@@ -2705,9 +2713,9 @@ BOOL X11DRV_GetCharWidth( DC *dc, UINT firstChar, UINT lastChar,
}
else
cs
=
def
;
if
(
pfo
->
lpX11Trans
)
*
buffer
++
=
MAX
(
cs
->
attributes
,
0
)
*
pfo
->
lpX11Trans
->
pixelsize
/
1000
.
0
;
pfo
->
lpX11Trans
->
pixelsize
/
1000
.
0
*
pfo
->
rescale
;
else
*
buffer
++
=
MAX
(
cs
->
width
,
0
);
*
buffer
++
=
MAX
(
cs
->
width
,
0
)
*
pfo
->
rescale
;
}
}
...
...
include/x11font.h
View file @
28896ee7
...
...
@@ -146,6 +146,7 @@ typedef struct
Pixmap
*
lpPixmap
;
/* optional character bitmasks for synth fonts */
XFONTTRANS
*
lpX11Trans
;
/* Info for X11R6 transform */
float
rescale
;
/* Rescale for large fonts */
INT16
foInternalLeading
;
INT16
foAvgCharWidth
;
INT16
foMaxCharWidth
;
...
...
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