From 935bf108b2dd9693c7f9f1e0752a03d2f0ccfbfa Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sun, 4 Jan 2009 02:25:59 +0000 Subject: [PATCH] =?utf8?q?Bug=20384362=20=E2=80=93=20pango=20can't=20selec?= =?utf8?q?t=20some=20font=20styles?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 2009-01-03 Behdad Esfahbod Bug 384362 – pango can't select some font styles * pango/pango-font.h: Add enum values PANGO_WEIGHT_THIN and PANGO_WEIGHT_MEDIUM to PangoWeight. * pango/fonts.c: Parse "Thin", "Extra-Light", "Regular", "Demi-Bold", "Extra-Bold", and "Black" as weight descriptors (from the OpenType spec). svn path=/trunk/; revision=2782 --- ChangeLog | 12 ++++++++++++ pango/fonts.c | 10 ++++++++-- pango/pango-font.h | 2 ++ 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index a275b4f..1591a1d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,17 @@ 2009-01-03 Behdad Esfahbod + Bug 384362 – pango can't select some font styles + + * pango/pango-font.h: + Add enum values PANGO_WEIGHT_THIN and PANGO_WEIGHT_MEDIUM to + PangoWeight. + + * pango/fonts.c: Parse "Thin", "Extra-Light", "Regular", "Demi-Bold", + "Extra-Bold", and "Black" as weight descriptors (from the OpenType + spec). + +2009-01-03 Behdad Esfahbod + Bug 168085 – numeric styles in pango_font_description_to_string() * pango/fonts.c (parse_int), (find_field), (find_field_any), diff --git a/pango/fonts.c b/pango/fonts.c index e1a10a5..4af87e8 100644 --- a/pango/fonts.c +++ b/pango/fonts.c @@ -858,14 +858,20 @@ static const FieldMap variant_map[] = { }; static const FieldMap weight_map[] = { + { PANGO_WEIGHT_THIN, "Thin" }, { PANGO_WEIGHT_ULTRALIGHT, "Ultra-Light" }, + { PANGO_WEIGHT_ULTRALIGHT, "Extra-Light" }, { PANGO_WEIGHT_LIGHT, "Light" }, { PANGO_WEIGHT_NORMAL, "" }, - { 500, "Medium" }, + { PANGO_WEIGHT_NORMAL, "Regular" }, + { PANGO_WEIGHT_MEDIUM, "Medium" }, { PANGO_WEIGHT_SEMIBOLD, "Semi-Bold" }, + { PANGO_WEIGHT_SEMIBOLD, "Demi-Bold" }, { PANGO_WEIGHT_BOLD, "Bold" }, { PANGO_WEIGHT_ULTRABOLD, "Ultra-Bold" }, - { PANGO_WEIGHT_HEAVY, "Heavy" } + { PANGO_WEIGHT_ULTRABOLD, "Extra-Bold" }, + { PANGO_WEIGHT_HEAVY, "Heavy" }, + { PANGO_WEIGHT_HEAVY, "Black" } }; static const FieldMap stretch_map[] = { diff --git a/pango/pango-font.h b/pango/pango-font.h index 66e68aa..5a86113 100644 --- a/pango/pango-font.h +++ b/pango/pango-font.h @@ -52,9 +52,11 @@ typedef enum { } PangoVariant; typedef enum { + PANGO_WEIGHT_THIN = 100, PANGO_WEIGHT_ULTRALIGHT = 200, PANGO_WEIGHT_LIGHT = 300, PANGO_WEIGHT_NORMAL = 400, + PANGO_WEIGHT_MEDIUM = 500, PANGO_WEIGHT_SEMIBOLD = 600, PANGO_WEIGHT_BOLD = 700, PANGO_WEIGHT_ULTRABOLD = 800, -- 2.7.4