Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
fontconfig
fontconfig
Commits
1fa9cb78
Commit
1fa9cb78
authored
Jan 03, 2018
by
Behdad Esfahbod
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove hack for OS/2 weights 1..9
parent
d7d40b5a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
26 deletions
+2
-26
src/fcfreetype.c
src/fcfreetype.c
+1
-7
src/fcweight.c
src/fcweight.c
+1
-19
No files found.
src/fcfreetype.c
View file @
1fa9cb78
...
...
@@ -1690,13 +1690,7 @@ FcFreeTypeQueryFaceInternal (const FT_Face face,
if
(
os2
&&
os2
->
version
!=
0xffff
)
{
weight
=
os2
->
usWeightClass
;
if
(
weight
<
10
&&
weight_mult
!=
1
.
0
)
{
/* Work around bad values by cleaning them up before
* multiplying by weight_mult. */
weight
=
FcWeightToOpenTypeDouble
(
FcWeightFromOpenTypeDouble
(
weight
));
}
weight
=
FcWeightFromOpenTypeDouble
((
int
)
(
weight
*
weight_mult
+
.
5
));
weight
=
FcWeightFromOpenTypeDouble
(
weight
*
weight_mult
);
if
((
FcDebug
()
&
FC_DBG_SCANV
)
&&
weight
!=
-
1
)
printf
(
"
\t
os2 weight class %d multiplier %g maps to weight %g
\n
"
,
os2
->
usWeightClass
,
weight_mult
,
weight
);
...
...
src/fcweight.c
View file @
1fa9cb78
...
...
@@ -54,27 +54,9 @@ FcWeightFromOpenTypeDouble (double ot_weight)
{
int
i
;
/* Loosely based on WPF Font Selection Model's advice. */
if
(
ot_weight
<
0
)
return
-
1
;
else
if
(
1
<=
ot_weight
&&
ot_weight
<=
9
)
{
/* WPF Font Selection Model says do "ot_weight *= 100",
* but Greg Hitchcock revealed that GDI had a mapping
* reflected below: */
switch
((
int
)
ot_weight
)
{
case
1
:
ot_weight
=
80
;
break
;
case
2
:
ot_weight
=
160
;
break
;
case
3
:
ot_weight
=
240
;
break
;
case
4
:
ot_weight
=
320
;
break
;
case
5
:
ot_weight
=
400
;
break
;
case
6
:
ot_weight
=
550
;
break
;
case
7
:
ot_weight
=
700
;
break
;
case
8
:
ot_weight
=
800
;
break
;
case
9
:
ot_weight
=
900
;
break
;
}
}
ot_weight
=
FC_MIN
(
ot_weight
,
map
[(
sizeof
(
map
)
/
sizeof
(
map
[
0
]))
-
1
].
ot
);
for
(
i
=
1
;
ot_weight
>
map
[
i
].
ot
;
i
++
)
...
...
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