From b072c3353cc2d10d6b26fb86cb13694a967a59cd Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 6 Jan 2009 11:07:02 +0000 Subject: =?UTF-8?q?Bug=20166709=20=E2=80=93=20Handle=20font=20variants=20m?= =?UTF-8?q?ore=20consistently?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2009-01-06 Behdad Esfahbod Bug 166709 – Handle font variants more consistently * pango/pango-font.h: Add enum values PANGO_WEIGHT_BOOK and PANGO_WEIGHT_ULTRAHEAVY. * pango/fonts.c: * docs/tmpl/fonts.sgml: Add new weights with their aliases, as well as aliasing "Roman" to the normal weight. svn path=/trunk/; revision=2787 --- ChangeLog | 12 ++++++++++++ docs/tmpl/fonts.sgml | 8 ++++++-- pango/fonts.c | 8 +++++++- pango/pango-font.h | 4 +++- 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index c66b02d8..978ab4a9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2009-01-06 Behdad Esfahbod + + Bug 166709 – Handle font variants more consistently + + * pango/pango-font.h: + Add enum values PANGO_WEIGHT_BOOK and PANGO_WEIGHT_ULTRAHEAVY. + + * pango/fonts.c: + * docs/tmpl/fonts.sgml: + Add new weights with their aliases, as well as aliasing "Roman" to the + normal weight. + 2009-01-06 Behdad Esfahbod * pango/fonts.c (pango_font_description_to_filename): diff --git a/docs/tmpl/fonts.sgml b/docs/tmpl/fonts.sgml index 4b91624b..baa05584 100644 --- a/docs/tmpl/fonts.sgml +++ b/docs/tmpl/fonts.sgml @@ -59,13 +59,17 @@ An enumeration specifying the weight (boldness) of a font. This is a numerical value ranging from 100 to 900, but there are some predefined values: +@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_LIGHT: the light weight (= 300) +@PANGO_WEIGHT_BOOK: the book weight (= 380; Since: 1.24) @PANGO_WEIGHT_NORMAL: the default weight (= 400) -@PANGO_WEIGHT_SEMIBOLD: a weight intermediate between normal and bold (=600) +@PANGO_WEIGHT_MEDIUM: the normal weight (= 500; Since: 1.24) +@PANGO_WEIGHT_SEMIBOLD: the semibold weight (= 600) @PANGO_WEIGHT_BOLD: the bold weight (= 700) @PANGO_WEIGHT_ULTRABOLD: the ultrabold weight (= 800) @PANGO_WEIGHT_HEAVY: the heavy weight (= 900) +@PANGO_WEIGHT_ULTRAHEAVY: the ultraheavy weight (= 1000; Since: 1.24) diff --git a/pango/fonts.c b/pango/fonts.c index 5e145aec..1faedff5 100644 --- a/pango/fonts.c +++ b/pango/fonts.c @@ -862,8 +862,10 @@ static const FieldMap weight_map[] = { { PANGO_WEIGHT_ULTRALIGHT, "Ultra-Light" }, { PANGO_WEIGHT_ULTRALIGHT, "Extra-Light" }, { PANGO_WEIGHT_LIGHT, "Light" }, + { PANGO_WEIGHT_BOOK, "Book" }, { PANGO_WEIGHT_NORMAL, "" }, { PANGO_WEIGHT_NORMAL, "Regular" }, + { PANGO_WEIGHT_NORMAL, "Roman" }, { PANGO_WEIGHT_MEDIUM, "Medium" }, { PANGO_WEIGHT_SEMIBOLD, "Semi-Bold" }, { PANGO_WEIGHT_SEMIBOLD, "Demi-Bold" }, @@ -871,7 +873,11 @@ static const FieldMap weight_map[] = { { PANGO_WEIGHT_ULTRABOLD, "Ultra-Bold" }, { PANGO_WEIGHT_ULTRABOLD, "Extra-Bold" }, { PANGO_WEIGHT_HEAVY, "Heavy" }, - { PANGO_WEIGHT_HEAVY, "Black" } + { PANGO_WEIGHT_HEAVY, "Black" }, + { PANGO_WEIGHT_ULTRAHEAVY, "Ultra-Heavy" }, + { PANGO_WEIGHT_ULTRAHEAVY, "Extra-Heavy" }, + { PANGO_WEIGHT_ULTRAHEAVY, "Ultra-Black" }, + { PANGO_WEIGHT_ULTRAHEAVY, "Extra-Black" } }; static const FieldMap stretch_map[] = { diff --git a/pango/pango-font.h b/pango/pango-font.h index 5a86113e..b5b2cf14 100644 --- a/pango/pango-font.h +++ b/pango/pango-font.h @@ -55,12 +55,14 @@ typedef enum { PANGO_WEIGHT_THIN = 100, PANGO_WEIGHT_ULTRALIGHT = 200, PANGO_WEIGHT_LIGHT = 300, + PANGO_WEIGHT_BOOK = 380, PANGO_WEIGHT_NORMAL = 400, PANGO_WEIGHT_MEDIUM = 500, PANGO_WEIGHT_SEMIBOLD = 600, PANGO_WEIGHT_BOLD = 700, PANGO_WEIGHT_ULTRABOLD = 800, - PANGO_WEIGHT_HEAVY = 900 + PANGO_WEIGHT_HEAVY = 900, + PANGO_WEIGHT_ULTRAHEAVY = 1000 } PangoWeight; typedef enum { -- cgit v1.2.1