W3c css has http://www.w3.org/TR/css3-fonts/#font-weight-prop 100 - Thin 200 - Extra Light (Ultra Light) 300 - Light 400 - Normal 500 - Medium 600 - Semi Bold (Demi Bold) 700 - Bold 800 - Extra Bold (Ultra Bold) 900 - Black (Heavy) fontconfig has #define FC_WEIGHT_THIN 0 #define FC_WEIGHT_EXTRALIGHT 40 #define FC_WEIGHT_ULTRALIGHT FC_WEIGHT_EXTRALIGHT #define FC_WEIGHT_LIGHT 50 #define FC_WEIGHT_BOOK 75 #define FC_WEIGHT_REGULAR 80 #define FC_WEIGHT_NORMAL FC_WEIGHT_REGULAR #define FC_WEIGHT_MEDIUM 100 #define FC_WEIGHT_DEMIBOLD 180 #define FC_WEIGHT_SEMIBOLD FC_WEIGHT_DEMIBOLD #define FC_WEIGHT_BOLD 200 #define FC_WEIGHT_EXTRABOLD 205 #define FC_WEIGHT_ULTRABOLD FC_WEIGHT_EXTRABOLD #define FC_WEIGHT_BLACK 210 #define FC_WEIGHT_HEAVY FC_WEIGHT_BLACK #define FC_WEIGHT_EXTRABLACK 215 #define FC_WEIGHT_ULTRABLACK FC_WEIGHT_EXTRABLACK Is there any clear relationship between them please? TIA -- Dave Pawson XSLT XSL-FO FAQ. Docbook FAQ. http://www.dpawson.co.uk
On 09/17/11 08:00, Dave Pawson wrote:> W3c css has > http://www.w3.org/TR/css3-fonts/#font-weight-prop > > 100 - Thin > 200 - Extra Light (Ultra Light) > 300 - Light > 400 - Normal > 500 - Medium > 600 - Semi Bold (Demi Bold) > 700 - Bold > 800 - Extra Bold (Ultra Bold) > 900 - Black (Heavy) > > fontconfig has > > #define FC_WEIGHT_THIN 0 > #define FC_WEIGHT_EXTRALIGHT 40 > #define FC_WEIGHT_ULTRALIGHT FC_WEIGHT_EXTRALIGHT > #define FC_WEIGHT_LIGHT 50 > #define FC_WEIGHT_BOOK 75 > #define FC_WEIGHT_REGULAR 80 > #define FC_WEIGHT_NORMAL FC_WEIGHT_REGULAR > #define FC_WEIGHT_MEDIUM 100 > #define FC_WEIGHT_DEMIBOLD 180 > #define FC_WEIGHT_SEMIBOLD FC_WEIGHT_DEMIBOLD > #define FC_WEIGHT_BOLD 200 > #define FC_WEIGHT_EXTRABOLD 205 > #define FC_WEIGHT_ULTRABOLD FC_WEIGHT_EXTRABOLD > #define FC_WEIGHT_BLACK 210 > #define FC_WEIGHT_HEAVY FC_WEIGHT_BLACK > #define FC_WEIGHT_EXTRABLACK 215 > #define FC_WEIGHT_ULTRABLACK FC_WEIGHT_EXTRABLACK > > Is there any clear relationship between them please?This is how Pango maps them: static int pango_fc_convert_weight_to_fc (PangoWeight pango_weight) { if (pango_weight <= (PANGO_WEIGHT_THIN + PANGO_WEIGHT_ULTRALIGHT) / 2) return FC_WEIGHT_THIN; else if (pango_weight <= (PANGO_WEIGHT_ULTRALIGHT + PANGO_WEIGHT_LIGHT) / 2) return FC_WEIGHT_ULTRALIGHT; else if (pango_weight <= (PANGO_WEIGHT_LIGHT + PANGO_WEIGHT_BOOK) / 2) return FC_WEIGHT_LIGHT; else if (pango_weight <= (PANGO_WEIGHT_BOOK + PANGO_WEIGHT_NORMAL) / 2) return FC_WEIGHT_BOOK; else if (pango_weight <= (PANGO_WEIGHT_NORMAL + PANGO_WEIGHT_MEDIUM) / 2) return FC_WEIGHT_NORMAL; else if (pango_weight <= (PANGO_WEIGHT_MEDIUM + PANGO_WEIGHT_SEMIBOLD) / 2) return FC_WEIGHT_MEDIUM; else if (pango_weight <= (PANGO_WEIGHT_SEMIBOLD + PANGO_WEIGHT_BOLD) / 2) return FC_WEIGHT_DEMIBOLD; else if (pango_weight <= (PANGO_WEIGHT_BOLD + PANGO_WEIGHT_ULTRABOLD) / 2) return FC_WEIGHT_BOLD; else if (pango_weight <= (PANGO_WEIGHT_ULTRABOLD + PANGO_WEIGHT_HEAVY) / 2) return FC_WEIGHT_ULTRABOLD; else if (pango_weight <= (PANGO_WEIGHT_HEAVY + PANGO_WEIGHT_ULTRAHEAVY) / 2) return FC_WEIGHT_BLACK; else return FC_WEIGHT_EXTRABLACK; } where: 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_ULTRAHEAVY = 1000 } PangoWeight; behdad> TIA
On 2011/09/17 13:00 (GMT+0100) Dave Pawson composed:> W3c css has > http://www.w3.org/TR/css3-fonts/#font-weight-prop> 100 - Thin > 200 - Extra Light (Ultra Light) > 300 - Light > 400 - Normal > 500 - Medium > 600 - Semi Bold (Demi Bold) > 700 - Bold > 800 - Extra Bold (Ultra Bold) > 900 - Black (Heavy)Note that just because W3 & CSS provide for them doesn''t mean they exist. Very few web fonts have more than two weights. Most have only medium & bold. Some have only bold or only light. Most of the few common fonts that have more than two are Mac only, or at least were last I checked. Some Vista & W7 fonts might have more. http://fm.no-ip.com/Auth/Font/fonts-comps-commonweight.html & http://fm.no-ip.com/Auth/Font/fonts-weightier.html show what''s available among the most common web fonts.> fontconfig has> #define FC_WEIGHT_THIN 0 > #define FC_WEIGHT_EXTRALIGHT 40 > #define FC_WEIGHT_ULTRALIGHT FC_WEIGHT_EXTRALIGHT > #define FC_WEIGHT_LIGHT 50 > #define FC_WEIGHT_BOOK 75 > #define FC_WEIGHT_REGULAR 80 > #define FC_WEIGHT_NORMAL FC_WEIGHT_REGULAR > #define FC_WEIGHT_MEDIUM 100 > #define FC_WEIGHT_DEMIBOLD 180 > #define FC_WEIGHT_SEMIBOLD FC_WEIGHT_DEMIBOLD > #define FC_WEIGHT_BOLD 200 > #define FC_WEIGHT_EXTRABOLD 205 > #define FC_WEIGHT_ULTRABOLD FC_WEIGHT_EXTRABOLD > #define FC_WEIGHT_BLACK 210 > #define FC_WEIGHT_HEAVY FC_WEIGHT_BLACK > #define FC_WEIGHT_EXTRABLACK 215 > #define FC_WEIGHT_ULTRABLACK FC_WEIGHT_EXTRABLACK> Is there any clear relationship between them please?-- "The wise are known for their understanding, and pleasant words are persuasive." Proverbs 16:21 (New Living Translation) Team OS/2 ** Reg. Linux User #211409 ** a11y rocks! Felix Miata *** http://fm.no-ip.com/
On 17 September 2011 14:34, Behdad Esfahbod <behdad at behdad.org> wrote:> On 09/17/11 08:00, Dave Pawson wrote: >> W3c css has >> http://www.w3.org/TR/css3-fonts/#font-weight-prop >> >> 100 - Thin >> 200 - Extra Light (Ultra Light) >> 300 - Light >> 400 - Normal >> 500 - Medium >> 600 - Semi Bold (Demi Bold) >> 700 - Bold >> 800 - Extra Bold (Ultra Bold) >> 900 - Black (Heavy) >> >> fontconfig has >> >> #define FC_WEIGHT_THIN ? ? ? ? ? ? ? ? ? ?0 >> #define FC_WEIGHT_EXTRALIGHT ? ? ?40 >> #define FC_WEIGHT_ULTRALIGHT ? ? ?FC_WEIGHT_EXTRALIGHT >> #define FC_WEIGHT_LIGHT ? ? ? ? ? ? ? ? ? 50 >> #define FC_WEIGHT_BOOK ? ? ? ? ? ? ? ? ? ?75 >> #define FC_WEIGHT_REGULAR ? ? ? ? 80 >> #define FC_WEIGHT_NORMAL ? ? ? ? ?FC_WEIGHT_REGULAR >> #define FC_WEIGHT_MEDIUM ? ? ? ? ?100 >> #define FC_WEIGHT_DEMIBOLD ? ? ? ?180 >> #define FC_WEIGHT_SEMIBOLD ? ? ? ?FC_WEIGHT_DEMIBOLD >> #define FC_WEIGHT_BOLD ? ? ? ? ? ? ? ? ? ?200 >> #define FC_WEIGHT_EXTRABOLD ? ? ? 205 >> #define FC_WEIGHT_ULTRABOLD ? ? ? FC_WEIGHT_EXTRABOLD >> #define FC_WEIGHT_BLACK ? ? ? ? ? ? ? ? ? 210 >> #define FC_WEIGHT_HEAVY ? ? ? ? ? ? ? ? ? FC_WEIGHT_BLACK >> #define FC_WEIGHT_EXTRABLACK ? ? ?215 >> #define FC_WEIGHT_ULTRABLACK ? ? ?FC_WEIGHT_EXTRABLACK >> >> Is there any clear relationship between them please?So from the figures below, mapping backwards <40 : 75 <50 : 245 <75 : 365 <80 : 420 <100: 500 <180: 600 <200: 700 <205: 800 else 900 Thanks for that. Shame there are no standards in this area. DaveP> > This is how Pango maps them: > > > static int > pango_fc_convert_weight_to_fc (PangoWeight pango_weight) > { > ?if (pango_weight <= (PANGO_WEIGHT_THIN + PANGO_WEIGHT_ULTRALIGHT) / 2) > ? ?return FC_WEIGHT_THIN; > ?else if (pango_weight <= (PANGO_WEIGHT_ULTRALIGHT + PANGO_WEIGHT_LIGHT) / 2) > ? ?return FC_WEIGHT_ULTRALIGHT; > ?else if (pango_weight <= (PANGO_WEIGHT_LIGHT + PANGO_WEIGHT_BOOK) / 2) > ? ?return FC_WEIGHT_LIGHT; > ?else if (pango_weight <= (PANGO_WEIGHT_BOOK + PANGO_WEIGHT_NORMAL) / 2) > ? ?return FC_WEIGHT_BOOK; > ?else if (pango_weight <= (PANGO_WEIGHT_NORMAL + PANGO_WEIGHT_MEDIUM) / 2) > ? ?return FC_WEIGHT_NORMAL; > ?else if (pango_weight <= (PANGO_WEIGHT_MEDIUM + PANGO_WEIGHT_SEMIBOLD) / 2) > ? ?return FC_WEIGHT_MEDIUM; > ?else if (pango_weight <= (PANGO_WEIGHT_SEMIBOLD + PANGO_WEIGHT_BOLD) / 2) > ? ?return FC_WEIGHT_DEMIBOLD; > ?else if (pango_weight <= (PANGO_WEIGHT_BOLD + PANGO_WEIGHT_ULTRABOLD) / 2) > ? ?return FC_WEIGHT_BOLD; > ?else if (pango_weight <= (PANGO_WEIGHT_ULTRABOLD + PANGO_WEIGHT_HEAVY) / 2) > ? ?return FC_WEIGHT_ULTRABOLD; > ?else if (pango_weight <= (PANGO_WEIGHT_HEAVY + PANGO_WEIGHT_ULTRAHEAVY) / 2) > ? ?return FC_WEIGHT_BLACK; > ?else > ? ?return FC_WEIGHT_EXTRABLACK; > } > > where: > > 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_ULTRAHEAVY = 1000 > } PangoWeight; > > > behdad > >> TIA >-- Dave Pawson XSLT XSL-FO FAQ. Docbook FAQ. http://www.dpawson.co.uk
On 17 September 2011 15:15, Felix Miata <mrmazda at earthlink.net> wrote:> Note that just because W3 & CSS provide for them doesn''t mean they exist. > Very few web fonts have more than two weights.Noted. I''m targetting PDF output via XSL-FO. Using fc-query output, hence wanted a way to map to xsl-fo values which are the W3C set. regards -- Dave Pawson XSLT XSL-FO FAQ. Docbook FAQ. http://www.dpawson.co.uk
Le Sam 17 septembre 2011 17:05, Dave Pawson a ?crit :> Shame there are no standards in this area.Microsoft wants new fonts to conform to http://blogs.msdn.com/text/attachment/2249036.ashx (wayback archive is your friend) It has the support of Adobe, which shiould be enough to cover everything not-Apple http://blogs.adobe.com/typblography/typotechnica2007/Font%20names.pdf http://blogs.adobe.com/typblography/atypi2006/CSS%20&%20OT%2015.pdf -- Nicolas Mailhot
On 2011/09/19 10:41 (GMT+0200) Nicolas Mailhot composed:> Le Sam 17 septembre 2011 17:05, Dave Pawson a ??crit :>> Shame there are no standards in this area.> Microsoft wants new fonts to conform to > http://blogs.msdn.com/text/attachment/2249036.ashx> (wayback archive is your friend)But PDF as web doc is not. What''s the gist of that inaccessible content? http://www.useit.com/alertbox/20030714.html> It has the support of Adobe, which shiould be enough to cover everything > not-Apple > http://blogs.adobe.com/typblography/typotechnica2007/Font%20names.pdf > http://blogs.adobe.com/typblography/atypi2006/CSS%20&%20OT%2015.pdf-- "The wise are known for their understanding, and pleasant words are persuasive." Proverbs 16:21 (New Living Translation) Team OS/2 ** Reg. Linux User #211409 ** a11y rocks! Felix Miata *** http://fm.no-ip.com/
Le Lun 19 septembre 2011 11:17, Felix Miata a ?crit :> On 2011/09/19 10:41 (GMT+0200) Nicolas Mailhot composed: > >> Le Sam 17 septembre 2011 17:05, Dave Pawson a ??crit : > >>> Shame there are no standards in this area. > >> Microsoft wants new fonts to conform to >> http://blogs.msdn.com/text/attachment/2249036.ashx > >> (wayback archive is your friend) > > But PDF as web doc is not. What''s the gist of that inaccessible content? > http://www.useit.com/alertbox/20030714.htmlThe document is in the wrong format, and not easy to read (screaming a lot helps), but you can infer from it what Microsoft and Adobe apps expect of recent fonts. It sucks but as far as I know it''s the best source we have right now. I won''t pretend I know it well enough to interpret it by memory. No doubt our proprietary friends have a better version somewhere in their internal documentation silos. -- Nicolas Mailhot