comparison src/font.c @ 102298:b666efc8e847

(font_style_to_value): Set value for unknown symbols to 100 instead of 255. (weight_table, slant_table, width_table): Treat "unspecified" as the default value.
author Chong Yidong <cyd@stupidchicken.com>
date Fri, 27 Feb 2009 00:29:42 +0000
parents 7a18c1cb1a14
children ccbe1c8ab377
comparison
equal deleted inserted replaced
102297:183133f0055d 102298:b666efc8e847
94 { 0, { "thin" }}, 94 { 0, { "thin" }},
95 { 20, { "ultra-light", "ultralight" }}, 95 { 20, { "ultra-light", "ultralight" }},
96 { 40, { "extra-light", "extralight" }}, 96 { 40, { "extra-light", "extralight" }},
97 { 50, { "light" }}, 97 { 50, { "light" }},
98 { 75, { "semi-light", "semilight", "demilight", "book" }}, 98 { 75, { "semi-light", "semilight", "demilight", "book" }},
99 { 100, { "normal", "medium", "regular" }}, 99 { 100, { "normal", "medium", "regular", "unspecified" }},
100 { 180, { "semi-bold", "semibold", "demibold", "demi" }}, 100 { 180, { "semi-bold", "semibold", "demibold", "demi" }},
101 { 200, { "bold" }}, 101 { 200, { "bold" }},
102 { 205, { "extra-bold", "extrabold" }}, 102 { 205, { "extra-bold", "extrabold" }},
103 { 210, { "ultra-bold", "ultrabold", "black" }} 103 { 210, { "ultra-bold", "ultrabold", "black" }}
104 }; 104 };
108 108
109 static struct table_entry slant_table[] = 109 static struct table_entry slant_table[] =
110 { 110 {
111 { 0, { "reverse-oblique", "ro" }}, 111 { 0, { "reverse-oblique", "ro" }},
112 { 10, { "reverse-italic", "ri" }}, 112 { 10, { "reverse-italic", "ri" }},
113 { 100, { "normal", "r" }}, 113 { 100, { "normal", "r", "unspecified" }},
114 { 200, { "italic" ,"i", "ot" }}, 114 { 200, { "italic" ,"i", "ot" }},
115 { 210, { "oblique", "o" }} 115 { 210, { "oblique", "o" }}
116 }; 116 };
117 117
118 /* Table of width numeric values and their names. This table must be 118 /* Table of width numeric values and their names. This table must be
122 { 122 {
123 { 50, { "ultra-condensed", "ultracondensed" }}, 123 { 50, { "ultra-condensed", "ultracondensed" }},
124 { 63, { "extra-condensed", "extracondensed" }}, 124 { 63, { "extra-condensed", "extracondensed" }},
125 { 75, { "condensed", "compressed", "narrow" }}, 125 { 75, { "condensed", "compressed", "narrow" }},
126 { 87, { "semi-condensed", "semicondensed", "demicondensed" }}, 126 { 87, { "semi-condensed", "semicondensed", "demicondensed" }},
127 { 100, { "normal", "medium", "regular" }}, 127 { 100, { "normal", "medium", "regular", "unspecified" }},
128 { 113, { "semi-expanded", "semiexpanded", "demiexpanded" }}, 128 { 113, { "semi-expanded", "semiexpanded", "demiexpanded" }},
129 { 125, { "expanded" }}, 129 { 125, { "expanded" }},
130 { 150, { "extra-expanded", "extraexpanded" }}, 130 { 150, { "extra-expanded", "extraexpanded" }},
131 { 200, { "ultra-expanded", "ultraexpanded", "wide" }} 131 { 200, { "ultra-expanded", "ultraexpanded", "wide" }}
132 }; 132 };
358 } 358 }
359 if (! noerror) 359 if (! noerror)
360 return -1; 360 return -1;
361 if (len == 255) 361 if (len == 255)
362 abort (); 362 abort ();
363 elt = Fmake_vector (make_number (2), make_number (255)); 363 elt = Fmake_vector (make_number (2), make_number (100));
364 ASET (elt, 1, val); 364 ASET (elt, 1, val);
365 args[0] = table; 365 args[0] = table;
366 args[1] = Fmake_vector (make_number (1), elt); 366 args[1] = Fmake_vector (make_number (1), elt);
367 ASET (font_style_table, prop - FONT_WEIGHT_INDEX, Fvconcat (2, args)); 367 ASET (font_style_table, prop - FONT_WEIGHT_INDEX, Fvconcat (2, args));
368 return (255 << 8) | (i << 4); 368 return (100 << 8) | (i << 4);
369 } 369 }
370 else 370 else
371 { 371 {
372 int i, last_n; 372 int i, last_n;
373 int numeric = XINT (val); 373 int numeric = XINT (val);