summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2014-08-06 12:29:35 -0400
committerBehdad Esfahbod <behdad@behdad.org>2014-08-06 12:29:35 -0400
commit80edaccc3cbd77434718e8f4731a20b410f9d10a (patch)
tree34e3729fd56e7d0b61916fae7f14f4292a302bcd /src
parent01bb6978b6389852c5259b135af45ecdfe9f42f8 (diff)
If OS/2 table says weight is 1 to 9, multiply by 100
https://bugs.freedesktop.org/show_bug.cgi?id=82228
Diffstat (limited to 'src')
-rw-r--r--src/fcweight.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/fcweight.c b/src/fcweight.c
index 313f3f2b..77b78ad5 100644
--- a/src/fcweight.c
+++ b/src/fcweight.c
@@ -53,7 +53,14 @@ int
FcWeightFromOpenType (int ot_weight)
{
int i;
- if (ot_weight <= 0 || ot_weight > 1000)
+
+ /* Follow WPF Font Selection Model's advice. */
+ if (1 <= ot_weight && ot_weight <= 9)
+ ot_weight *= 100;
+
+ /* WPF Font Selection Model rejects 1000, we allow it
+ * because Pango uses that number. */
+ if (ot_weight < 1 || ot_weight > 1000)
return -1;
for (i = 1; ot_weight > map[i].ot; i++)