aboutsummaryrefslogtreecommitdiff
path: root/fontconfig
diff options
context:
space:
mode:
Diffstat (limited to 'fontconfig')
-rw-r--r--fontconfig/conf.d/45-latin.conf8
-rw-r--r--fontconfig/src/fcatomic.c2
-rw-r--r--fontconfig/src/fcweight.c15
3 files changed, 16 insertions, 9 deletions
diff --git a/fontconfig/conf.d/45-latin.conf b/fontconfig/conf.d/45-latin.conf
index aa62ed42e..996fb81e6 100644
--- a/fontconfig/conf.d/45-latin.conf
+++ b/fontconfig/conf.d/45-latin.conf
@@ -57,10 +57,6 @@
<family>Palatino Linotype</family>
<default><family>serif</family></default>
</alias>
- <alias>
- <family>Trebuchet MS</family>
- <default><family>serif</family></default>
- </alias>
<!--
Sans-serif faces
-->
@@ -104,6 +100,10 @@
<family>Luxi Sans</family>
<default><family>sans-serif</family></default>
</alias>
+ <alias>
+ <family>Trebuchet MS</family>
+ <default><family>sans-serif</family></default>
+ </alias>
<!--
Monospace faces
-->
diff --git a/fontconfig/src/fcatomic.c b/fontconfig/src/fcatomic.c
index c1daed938..2ce419f74 100644
--- a/fontconfig/src/fcatomic.c
+++ b/fontconfig/src/fcatomic.c
@@ -131,7 +131,7 @@ FcAtomicLock (FcAtomic *atomic)
return FcFalse;
}
ret = link ((char *) atomic->tmp, (char *) atomic->lck);
- if (ret < 0 && errno == EPERM)
+ if (ret < 0 && (errno == EPERM || errno == ENOTSUP))
{
/* the filesystem where atomic->lck points to may not supports
* the hard link. so better try to fallback
diff --git a/fontconfig/src/fcweight.c b/fontconfig/src/fcweight.c
index 87bbe67ab..77b78ad54 100644
--- a/fontconfig/src/fcweight.c
+++ b/fontconfig/src/fcweight.c
@@ -45,15 +45,22 @@ static int lerp(int x, int x1, int x2, int y1, int y2)
{
int dx = x2 - x1;
int dy = y2 - y1;
- assert (dx > 0 && dy > 0 && x1 <= x && x <= x2);
+ assert (dx > 0 && dy >= 0 && x1 <= x && x <= x2);
return y1 + (dy*(x-x1) + dx/2) / dx;
}
-FcPublic int
+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++)
@@ -66,7 +73,7 @@ FcWeightFromOpenType (int ot_weight)
return lerp (ot_weight, map[i-1].ot, map[i].ot, map[i-1].fc, map[i].fc);
}
-FcPublic int
+int
FcWeightToOpenType (int fc_weight)
{
int i;