Commit 6a1420c2 authored by Behdad Esfahbod's avatar Behdad Esfahbod
Browse files

Add PANGO_WEIGHT_SEMILIGHT

Part of Bug 733764 - Support more / free font weights
parent 9f221d65
......@@ -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" },
......
......@@ -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,
......
......@@ -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;
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment