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
d1b09fa2
Commit
d1b09fa2
authored
May 06, 2023
by
Piotr Caban
Committed by
Alexandre Julliard
May 10, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineps: Introduce PSDRV_GET_GLYPH_NAME escape to obtain builtin glyph name from unixlib.
parent
9e95b9e6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
32 deletions
+44
-32
builtin.c
dlls/wineps.drv/builtin.c
+3
-4
unixlib.c
dlls/wineps.drv/unixlib.c
+39
-28
unixlib.h
dlls/wineps.drv/unixlib.h
+2
-0
No files found.
dlls/wineps.drv/builtin.c
View file @
d1b09fa2
...
...
@@ -31,6 +31,7 @@
#include "winternl.h"
#include "psdrv.h"
#include "unixlib.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
psdrv
);
...
...
@@ -244,14 +245,12 @@ BOOL PSDRV_WriteSetBuiltinFont(PHYSDEV dev)
BOOL
PSDRV_WriteBuiltinGlyphShow
(
PHYSDEV
dev
,
LPCWSTR
str
,
INT
count
)
{
PSDRV_PDEVICE
*
physDev
=
get_psdrv_dev
(
dev
)
;
char
name
[
32
]
;
int
i
;
LPCSTR
name
;
for
(
i
=
0
;
i
<
count
;
++
i
)
{
name
=
PSDRV_UVMetrics
(
str
[
i
],
physDev
->
font
.
fontinfo
.
Builtin
.
afm
)
->
N
->
sz
;
ExtEscape
(
dev
->
hdc
,
PSDRV_GET_GLYPH_NAME
,
sizeof
(
str
[
i
]),
(
const
char
*
)
&
str
[
i
],
sizeof
(
name
),
name
);
PSDRV_WriteGlyphShow
(
dev
,
name
);
}
...
...
dlls/wineps.drv/unixlib.c
View file @
d1b09fa2
...
...
@@ -518,6 +518,34 @@ static BOOL CDECL reset_dc(PHYSDEV dev, const DEVMODEW *devmode)
return
TRUE
;
}
static
int
metrics_by_uv
(
const
void
*
a
,
const
void
*
b
)
{
return
(
int
)(((
const
AFMMETRICS
*
)
a
)
->
UV
-
((
const
AFMMETRICS
*
)
b
)
->
UV
);
}
const
AFMMETRICS
*
uv_metrics
(
LONG
uv
,
const
AFM
*
afm
)
{
const
AFMMETRICS
*
needle
;
AFMMETRICS
key
;
/*
* Ugly work-around for symbol fonts. Wine is sending characters which
* belong in the Unicode private use range (U+F020 - U+F0FF) as ASCII
* characters (U+0020 - U+00FF).
*/
if
((
afm
->
Metrics
->
UV
&
0xff00
)
==
0xf000
&&
uv
<
0x100
)
uv
|=
0xf000
;
key
.
UV
=
uv
;
needle
=
bsearch
(
&
key
,
afm
->
Metrics
,
afm
->
NumofMetrics
,
sizeof
(
AFMMETRICS
),
metrics_by_uv
);
if
(
!
needle
)
{
WARN
(
"No glyph for U+%.4X in '%s'
\n
"
,
(
int
)
uv
,
afm
->
FontName
);
needle
=
afm
->
Metrics
;
}
return
needle
;
}
static
int
CDECL
ext_escape
(
PHYSDEV
dev
,
int
escape
,
int
input_size
,
const
void
*
input
,
int
output_size
,
void
*
output
)
{
...
...
@@ -770,6 +798,17 @@ static int CDECL ext_escape(PHYSDEV dev, int escape, int input_size, const void
case
CLIP_TO_PATH
:
return
1
;
case
PSDRV_GET_GLYPH_NAME
:
{
PSDRV_PDEVICE
*
pdev
=
get_psdrv_dev
(
dev
);
WCHAR
*
uv
=
(
WCHAR
*
)
input
;
const
char
*
name
=
uv_metrics
(
*
uv
,
pdev
->
font
.
fontinfo
.
Builtin
.
afm
)
->
N
->
sz
;
lstrcpynA
(
output
,
name
,
output_size
);
return
1
;
}
default:
FIXME
(
"Unimplemented code %d
\n
"
,
escape
);
return
0
;
...
...
@@ -1135,34 +1174,6 @@ static BOOL CDECL enum_fonts(PHYSDEV dev, LPLOGFONTW plf, FONTENUMPROCW proc, LP
return
ret
;
}
static
int
metrics_by_uv
(
const
void
*
a
,
const
void
*
b
)
{
return
(
int
)(((
const
AFMMETRICS
*
)
a
)
->
UV
-
((
const
AFMMETRICS
*
)
b
)
->
UV
);
}
const
AFMMETRICS
*
uv_metrics
(
LONG
uv
,
const
AFM
*
afm
)
{
const
AFMMETRICS
*
needle
;
AFMMETRICS
key
;
/*
* Ugly work-around for symbol fonts. Wine is sending characters which
* belong in the Unicode private use range (U+F020 - U+F0FF) as ASCII
* characters (U+0020 - U+00FF).
*/
if
((
afm
->
Metrics
->
UV
&
0xff00
)
==
0xf000
&&
uv
<
0x100
)
uv
|=
0xf000
;
key
.
UV
=
uv
;
needle
=
bsearch
(
&
key
,
afm
->
Metrics
,
afm
->
NumofMetrics
,
sizeof
(
AFMMETRICS
),
metrics_by_uv
);
if
(
!
needle
)
{
WARN
(
"No glyph for U+%.4X in '%s'
\n
"
,
(
int
)
uv
,
afm
->
FontName
);
needle
=
afm
->
Metrics
;
}
return
needle
;
}
static
BOOL
CDECL
get_char_width
(
PHYSDEV
dev
,
UINT
first
,
UINT
count
,
const
WCHAR
*
chars
,
INT
*
buffer
)
{
PSDRV_PDEVICE
*
pdev
=
get_psdrv_dev
(
dev
);
...
...
dlls/wineps.drv/unixlib.h
View file @
d1b09fa2
...
...
@@ -19,6 +19,8 @@
#include "ntuser.h"
#include "wine/unixlib.h"
#define PSDRV_GET_GLYPH_NAME 0x10000
enum
wineps_funcs
{
unix_init_dc
,
...
...
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