[pango] Add PANGO_WEIGHT_SEMILIGHT
- From: Behdad Esfahbod <behdad src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pango] Add PANGO_WEIGHT_SEMILIGHT
- Date: Fri, 25 Jul 2014 22:26:08 +0000 (UTC)
commit 6a1420c22bb1365bac94cc979053b558ba328796
Author: Behdad Esfahbod <behdad behdad org>
Date: Fri Jul 25 18:24:32 2014 -0400
Add PANGO_WEIGHT_SEMILIGHT
Part of Bug 733764 - Support more / free font weights
pango/fonts.c | 2 ++
pango/pango-font.h | 2 ++
pango/pangofc-fontmap.c | 4 +++-
pango/pangofc-private.h | 6 ++++++
4 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/pango/fonts.c b/pango/fonts.c
index 4a72d32..d92a903 100644
--- a/pango/fonts.c
+++ b/pango/fonts.c
@@ -871,6 +871,8 @@ static const FieldMap weight_map[] = {
{ PANGO_WEIGHT_ULTRALIGHT, "Ultra-Light" },
{ PANGO_WEIGHT_ULTRALIGHT, "Extra-Light" },
{ PANGO_WEIGHT_LIGHT, "Light" },
+ { PANGO_WEIGHT_SEMILIGHT, "Semi-Light" },
+ { PANGO_WEIGHT_SEMILIGHT, "Demi-Light" },
{ PANGO_WEIGHT_BOOK, "Book" },
{ PANGO_WEIGHT_NORMAL, "" },
{ PANGO_WEIGHT_NORMAL, "Regular" },
diff --git a/pango/pango-font.h b/pango/pango-font.h
index cd306f1..45b0447 100644
--- a/pango/pango-font.h
+++ b/pango/pango-font.h
@@ -81,6 +81,7 @@ typedef enum {
* @PANGO_WEIGHT_THIN: the thin weight (= 100; Since: 1.24)
* @PANGO_WEIGHT_ULTRALIGHT: the ultralight weight (= 200)
* @PANGO_WEIGHT_LIGHT: the light weight (= 300)
+ * @PANGO_WEIGHT_SEMILIGHT: the semilight weight (= 350; Since: 1.36.7)
* @PANGO_WEIGHT_BOOK: the book weight (= 380; Since: 1.24)
* @PANGO_WEIGHT_NORMAL: the default weight (= 400)
* @PANGO_WEIGHT_MEDIUM: the normal weight (= 500; Since: 1.24)
@@ -97,6 +98,7 @@ typedef enum {
PANGO_WEIGHT_THIN = 100,
PANGO_WEIGHT_ULTRALIGHT = 200,
PANGO_WEIGHT_LIGHT = 300,
+ PANGO_WEIGHT_SEMILIGHT = 350,
PANGO_WEIGHT_BOOK = 380,
PANGO_WEIGHT_NORMAL = 400,
PANGO_WEIGHT_MEDIUM = 500,
diff --git a/pango/pangofc-fontmap.c b/pango/pangofc-fontmap.c
index a4053f7..06ddca0 100644
--- a/pango/pangofc-fontmap.c
+++ b/pango/pangofc-fontmap.c
@@ -2063,7 +2063,9 @@ pango_fc_convert_weight_to_pango (int fc_weight)
return PANGO_WEIGHT_THIN;
else if (fc_weight <= (FC_WEIGHT_EXTRALIGHT + FC_WEIGHT_LIGHT) / 2)
return PANGO_WEIGHT_ULTRALIGHT;
- else if (fc_weight <= (FC_WEIGHT_LIGHT + FC_WEIGHT_BOOK) / 2)
+ else if (fc_weight <= (FC_WEIGHT_LIGHT + FC_WEIGHT_DEMILIGHT) / 2)
+ return PANGO_WEIGHT_SEMILIGHT;
+ else if (fc_weight <= (FC_WEIGHT_DEMILIGHT + FC_WEIGHT_BOOK) / 2)
return PANGO_WEIGHT_LIGHT;
else if (fc_weight <= (FC_WEIGHT_BOOK + FC_WEIGHT_REGULAR) / 2)
return PANGO_WEIGHT_BOOK;
diff --git a/pango/pangofc-private.h b/pango/pangofc-private.h
index 7945962..3204567 100644
--- a/pango/pangofc-private.h
+++ b/pango/pangofc-private.h
@@ -28,6 +28,12 @@
G_BEGIN_DECLS
+#ifndef FC_WEIGHT_DEMILIGHT
+#define FC_WEIGHT_DEMILIGHT 55
+#define FC_WEIGHT_SEMILIGHT FC_WEIGHT_DEMILIGHT
+#endif
+
+
typedef struct _PangoFcMetricsInfo PangoFcMetricsInfo;
struct _PangoFcMetricsInfo
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]