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
87194855
Commit
87194855
authored
Aug 03, 2000
by
Alexandre Julliard
Committed by
Alexandre Julliard
Aug 03, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed the AFM metrics structure to use an array instead of a linked
list. This avoids doing two heap allocations for every character, and reduces the metrics parsing time by approx 25%.
parent
66b4dd28
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
13 deletions
+9
-13
afm.c
dlls/wineps/afm.c
+8
-11
psdrv.h
dlls/wineps/psdrv.h
+1
-2
No files found.
dlls/wineps/afm.c
View file @
87194855
...
...
@@ -35,19 +35,16 @@ static void PSDRV_AFMGetCharMetrics(AFM *afm, FILE *fp)
char
line
[
256
],
valbuf
[
256
];
char
*
cp
,
*
item
,
*
value
,
*
curpos
,
*
endpos
;
int
i
;
AFMMETRICS
*
*
insert
=
&
afm
->
Metrics
,
*
metric
;
AFMMETRICS
*
metric
;
for
(
i
=
0
;
i
<
afm
->
NumofMetrics
;
i
++
)
{
afm
->
Metrics
=
metric
=
HeapAlloc
(
PSDRV_Heap
,
HEAP_ZERO_MEMORY
,
afm
->
NumofMetrics
*
sizeof
(
AFMMETRICS
)
);
for
(
i
=
0
;
i
<
afm
->
NumofMetrics
;
i
++
,
metric
++
)
{
if
(
!
fgets
(
line
,
sizeof
(
line
),
fp
))
{
ERR
(
"Unexpected EOF
\n
"
);
return
;
}
metric
=
*
insert
=
HeapAlloc
(
PSDRV_Heap
,
HEAP_ZERO_MEMORY
,
sizeof
(
AFMMETRICS
)
);
insert
=
&
metric
->
next
;
cp
=
line
+
strlen
(
line
);
do
{
*
cp
=
'\0'
;
...
...
@@ -85,7 +82,7 @@ static void PSDRV_AFMGetCharMetrics(AFM *afm, FILE *fp)
}
else
if
(
!
strncmp
(
"N "
,
item
,
2
))
{
metric
->
N
=
HEAP_strdupA
(
PSDRV_Heap
,
0
,
value
);
strncpy
(
metric
->
N
,
value
,
sizeof
(
metric
->
N
)
);
}
else
if
(
!
strncmp
(
"B "
,
item
,
2
))
{
...
...
@@ -367,7 +364,7 @@ void PSDRV_AddAFMtoList(FONTFAMILY **head, AFM *afm)
*/
static
void
PSDRV_ReencodeCharWidths
(
AFM
*
afm
)
{
int
i
;
int
i
,
j
;
AFMMETRICS
*
metric
;
for
(
i
=
0
;
i
<
256
;
i
++
)
{
...
...
@@ -377,13 +374,13 @@ static void PSDRV_ReencodeCharWidths(AFM *afm)
afm
->
CharWidths
[
i
]
=
0
.
0
;
continue
;
}
for
(
metric
=
afm
->
Metrics
;
metric
;
metric
=
metric
->
next
)
{
for
(
j
=
0
,
metric
=
afm
->
Metrics
;
j
<
afm
->
NumofMetrics
;
j
++
,
metric
++
)
{
if
(
!
strcmp
(
metric
->
N
,
PSDRV_ANSIVector
[
i
]))
{
afm
->
CharWidths
[
i
]
=
metric
->
WX
;
break
;
}
}
if
(
!
metric
)
{
if
(
j
==
afm
->
NumofMetrics
)
{
WARN
(
"Couldn't find glyph '%s' in font '%s'
\n
"
,
PSDRV_ANSIVector
[
i
],
afm
->
FontName
);
afm
->
CharWidths
[
i
]
=
0
.
0
;
...
...
dlls/wineps/psdrv.h
View file @
87194855
...
...
@@ -26,10 +26,9 @@ typedef struct _tagAFMLIGS {
typedef
struct
_tagAFMMETRICS
{
int
C
;
/* character */
float
WX
;
char
*
N
;
/* name */
char
N
[
32
]
;
/* name */
AFMBBOX
B
;
AFMLIGS
*
L
;
/* Ligatures */
struct
_tagAFMMETRICS
*
next
;
}
AFMMETRICS
;
typedef
struct
_tagAFM
{
...
...
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