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
afd519be
Commit
afd519be
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
Fix a few font problems with rotated text and non MM_TEXT mapping
modes. Do slightly better with the FF_ flags in WineEngGetTextMetrics.
parent
43b62092
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
9 deletions
+54
-9
freetype.c
dlls/gdi/freetype.c
+49
-6
xrender.c
dlls/x11drv/xrender.c
+3
-1
font.h
include/font.h
+1
-1
gdiobj.c
objects/gdiobj.c
+1
-1
No files found.
dlls/gdi/freetype.c
View file @
afd519be
...
...
@@ -676,6 +676,7 @@ static LONG load_VDMX(GdiFont font, LONG height)
numRecs
=
GET_BE_WORD
(
&
hdr
[
2
]);
numRatios
=
GET_BE_WORD
(
&
hdr
[
4
]);
TRACE
(
"numRecs = %d numRatios = %d
\n
"
,
numRecs
,
numRatios
);
for
(
i
=
0
;
i
<
numRatios
;
i
++
)
{
Ratios
ratio
;
...
...
@@ -784,7 +785,7 @@ static LONG load_VDMX(GdiFont font, LONG height)
* WineEngCreateFontInstance
*
*/
GdiFont
WineEngCreateFontInstance
(
HFONT
hfont
)
GdiFont
WineEngCreateFontInstance
(
DC
*
dc
,
HFONT
hfont
)
{
GdiFont
ret
;
Face
*
face
;
...
...
@@ -893,7 +894,14 @@ not_found:
TRACE
(
"Choosen %s %s
\n
"
,
debugstr_w
(
family
->
FamilyName
),
debugstr_w
(
face
->
StyleName
));
ret
->
ft_face
=
OpenFontFile
(
ret
,
face
->
file
,
plf
->
lfHeight
);
ret
->
ft_face
=
OpenFontFile
(
ret
,
face
->
file
,
INTERNAL_YWSTODS
(
dc
,
plf
->
lfHeight
));
if
(
!
ret
->
ft_face
)
{
GDI_ReleaseObj
(
hfont
);
free_font
(
ret
);
return
0
;
}
if
(
ret
->
charset
==
SYMBOL_CHARSET
)
pFT_Select_Charmap
(
ret
->
ft_face
,
ft_encoding_symbol
);
...
...
@@ -959,7 +967,11 @@ static void GetEnumStructs(Face *face, LPENUMLOGFONTEXW pelf,
UINT
size
;
GdiFont
font
=
alloc_font
();
font
->
ft_face
=
OpenFontFile
(
font
,
face
->
file
,
100
);
if
(
!
(
font
->
ft_face
=
OpenFontFile
(
font
,
face
->
file
,
100
)))
{
free_font
(
font
);
return
;
}
memset
(
&
pelf
->
elfLogFont
,
0
,
sizeof
(
LOGFONTW
));
...
...
@@ -1476,8 +1488,39 @@ BOOL WineEngGetTextMetrics(GdiFont font, LPTEXTMETRICW ptm)
ptm
->
tmUnderlined
=
0
;
/* entry in OS2 table */
ptm
->
tmStruckOut
=
0
;
/* entry in OS2 table */
/* Yes this is correct; braindead api */
ptm
->
tmPitchAndFamily
=
FT_IS_FIXED_WIDTH
(
ft_face
)
?
0
:
TMPF_FIXED_PITCH
;
/* Yes TPMF_FIXED_PITCH is correct; braindead api */
if
(
!
FT_IS_FIXED_WIDTH
(
ft_face
))
ptm
->
tmPitchAndFamily
=
TMPF_FIXED_PITCH
;
else
ptm
->
tmPitchAndFamily
=
0
;
switch
(
pOS2
->
panose
[
PAN_FAMILYTYPE_INDEX
])
{
case
PAN_FAMILY_SCRIPT
:
ptm
->
tmPitchAndFamily
|=
FF_SCRIPT
;
break
;
case
PAN_FAMILY_DECORATIVE
:
case
PAN_FAMILY_PICTORIAL
:
ptm
->
tmPitchAndFamily
|=
FF_DECORATIVE
;
break
;
case
PAN_FAMILY_TEXT_DISPLAY
:
if
(
ptm
->
tmPitchAndFamily
==
0
)
/* fixed */
ptm
->
tmPitchAndFamily
=
FF_MODERN
;
else
{
switch
(
pOS2
->
panose
[
PAN_SERIFSTYLE_INDEX
])
{
case
PAN_SERIF_NORMAL_SANS
:
case
PAN_SERIF_OBTUSE_SANS
:
case
PAN_SERIF_PERP_SANS
:
ptm
->
tmPitchAndFamily
|=
FF_SWISS
;
break
;
default:
ptm
->
tmPitchAndFamily
|=
FF_ROMAN
;
}
}
break
;
default:
ptm
->
tmPitchAndFamily
|=
FF_DONTCARE
;
}
if
(
FT_IS_SCALABLE
(
ft_face
))
ptm
->
tmPitchAndFamily
|=
TMPF_VECTOR
;
if
(
FT_IS_SFNT
(
ft_face
))
...
...
@@ -1726,7 +1769,7 @@ BOOL WineEngInit(void)
{
return
FALSE
;
}
GdiFont
WineEngCreateFontInstance
(
HFONT
hfont
)
GdiFont
WineEngCreateFontInstance
(
DC
*
dc
,
HFONT
hfont
)
{
return
NULL
;
}
...
...
dlls/x11drv/xrender.c
View file @
afd519be
...
...
@@ -578,6 +578,8 @@ BOOL X11DRV_XRender_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flag
GetTextMetricsW
(
hdc
,
&
tm
);
tm
.
tmAscent
=
INTERNAL_YWSTODS
(
dc
,
tm
.
tmAscent
);
tm
.
tmDescent
=
INTERNAL_YWSTODS
(
dc
,
tm
.
tmDescent
);
switch
(
dc
->
textAlign
&
(
TA_LEFT
|
TA_RIGHT
|
TA_CENTER
)
)
{
case
TA_LEFT
:
if
(
dc
->
textAlign
&
TA_UPDATECP
)
{
...
...
@@ -775,7 +777,7 @@ BOOL X11DRV_XRender_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flag
(
unsigned
short
*
)
wstr
+
idx
,
1
);
offset
+=
INTERNAL_XWSTODS
(
dc
,
lpDx
[
idx
]);
xoff
=
offset
*
cosEsc
;
yoff
=
offset
*
sinEsc
;
yoff
=
offset
*
-
sinEsc
;
}
}
...
...
include/font.h
View file @
afd519be
...
...
@@ -87,7 +87,7 @@ extern void FONT_EnumLogFontEx16ToW(const ENUMLOGFONTEX16*, LPENUMLOGFONTEXW);
extern
LPWSTR
FONT_mbtowc
(
HDC
,
LPCSTR
,
INT
,
INT
*
,
UINT
*
);
extern
GdiFont
WineEngCreateFontInstance
(
HFONT
);
extern
GdiFont
WineEngCreateFontInstance
(
DC
*
,
HFONT
);
extern
BOOL
WineEngDestroyFontInstance
(
HFONT
handle
);
extern
DWORD
WineEngEnumFonts
(
LPLOGFONTW
,
DEVICEFONTENUMPROC
,
LPARAM
);
extern
BOOL
WineEngGetCharWidth
(
GdiFont
,
UINT
,
UINT
,
LPINT
);
...
...
objects/gdiobj.c
View file @
afd519be
...
...
@@ -1153,7 +1153,7 @@ static HGDIOBJ FONT_SelectObject(DC *dc, HGDIOBJ hFont)
if
(
dc
->
hFont
!=
hFont
||
dc
->
gdiFont
==
NULL
)
{
if
(
GetDeviceCaps
(
dc
->
hSelf
,
TEXTCAPS
)
&
TC_VA_ABLE
)
dc
->
gdiFont
=
WineEngCreateFontInstance
(
hFont
);
dc
->
gdiFont
=
WineEngCreateFontInstance
(
dc
,
hFont
);
}
if
(
dc
->
funcs
->
pSelectFont
)
...
...
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