Jumping to source from "*Help*" buffer moves the point when the source
buffer is already open. Now, the old point is pushed to mark ring.
+** Fonts
+
+---
+*** Emacs now supports "medium" fonts.
+Emacs previously didn't distinguish between the "regular" weight and
+the "medium" weight, but it now also supports the (heavier) "medium"
+weight.
+
\f
* Editing Changes in Emacs 29.1
`:weight'
-VALUE specifies the weight of the font to use. It must be one of the
-symbols `ultra-bold', `extra-bold', `bold', `semi-bold', `normal',
-`semi-light', `light', `extra-light', `ultra-light'.
+VALUE specifies the weight of the font to use. It must be one of
+the symbols `ultra-heavy', `heavy', `ultra-bold', `extra-bold',
+`bold', `semi-bold', `medium', `normal', `book', `semi-light',
+`light', `extra-light', `ultra-light', or `thin'.
`:slant'
int numeric;
/* The first one is a valid name as a face attribute.
The second one (if any) is a typical name in XLFD field. */
- const char *names[5];
+ const char *names[6];
};
/* Table of weight numeric values and their names. This table must be
- sorted by numeric values in ascending order. */
+ sorted by numeric values in ascending order and the numeric values
+ must approximately match the weights in the font files. */
static const struct table_entry weight_table[] =
{
{ 0, { "thin" }},
- { 20, { "ultra-light", "ultralight" }},
- { 40, { "extra-light", "extralight" }},
+ { 40, { "ultra-light", "ultralight", "extra-light", "extralight" }},
{ 50, { "light" }},
- { 75, { "semi-light", "semilight", "demilight", "book" }},
- { 100, { "normal", "medium", "regular", "unspecified" }},
- { 180, { "semi-bold", "semibold", "demibold", "demi" }},
+ { 55, { "semi-light", "semilight", "demilight" }},
+ { 80, { "regular", "normal", "unspecified", "book" }},
+ { 100, { "medium" }},
+ { 180, { "semi-bold", "semibold", "demibold", "demi-bold", "demi" }},
{ 200, { "bold" }},
- { 205, { "extra-bold", "extrabold" }},
- { 210, { "ultra-bold", "ultrabold", "black" }}
+ { 205, { "extra-bold", "extrabold", "ultra-bold", "ultrabold" }},
+ { 210, { "black", "heavy" }},
+ { 250, { "ultra-heavy", "ultraheavy" }}
};
/* Table of slant numeric values and their names. This table must be
#define PROP_MATCH(STR) (word_len == strlen (STR) \
&& memcmp (p, STR, strlen (STR)) == 0)
- if (PROP_MATCH ("light")
+ if (PROP_MATCH ("thin")
+ || PROP_MATCH ("ultra-light")
+ || PROP_MATCH ("light")
+ || PROP_MATCH ("semi-light")
+ || PROP_MATCH ("book")
|| PROP_MATCH ("medium")
+ || PROP_MATCH ("normal")
+ || PROP_MATCH ("semibold")
|| PROP_MATCH ("demibold")
|| PROP_MATCH ("bold")
- || PROP_MATCH ("black"))
+ || PROP_MATCH ("ultra-bold")
+ || PROP_MATCH ("black")
+ || PROP_MATCH ("heavy")
+ || PROP_MATCH ("ultra-heavy"))
FONT_SET_STYLE (font, FONT_WEIGHT_INDEX, val);
else if (PROP_MATCH ("roman")
|| PROP_MATCH ("italic")
#ifdef HAVE_GTK3
-#define XG_WEIGHT_TO_SYMBOL(w) \
- (w <= PANGO_WEIGHT_THIN ? Qextra_light \
- : w <= PANGO_WEIGHT_ULTRALIGHT ? Qlight \
- : w <= PANGO_WEIGHT_LIGHT ? Qsemi_light \
- : w < PANGO_WEIGHT_MEDIUM ? Qnormal \
- : w <= PANGO_WEIGHT_SEMIBOLD ? Qsemi_bold \
- : w <= PANGO_WEIGHT_BOLD ? Qbold \
- : w <= PANGO_WEIGHT_HEAVY ? Qextra_bold \
- : Qultra_bold)
-
-#define XG_STYLE_TO_SYMBOL(s) \
- (s == PANGO_STYLE_OBLIQUE ? Qoblique \
- : s == PANGO_STYLE_ITALIC ? Qitalic \
- : Qnormal)
+static
+Lisp_Object xg_weight_to_symbol (PangoWeight w)
+{
+ return
+ (w <= PANGO_WEIGHT_THIN ? Qthin /* 100 */
+ : w <= PANGO_WEIGHT_ULTRALIGHT ? Qultra_light /* 200 */
+ : w <= PANGO_WEIGHT_LIGHT ? Qlight /* 300 */
+ : w <= PANGO_WEIGHT_SEMILIGHT ? Qsemi_light /* 350 */
+ : w <= PANGO_WEIGHT_BOOK ? Qbook /* 380 */
+ : w <= PANGO_WEIGHT_NORMAL ? Qnormal /* 400 */
+ : w <= PANGO_WEIGHT_MEDIUM ? Qmedium /* 500 */
+ : w <= PANGO_WEIGHT_SEMIBOLD ? Qsemi_bold /* 600 */
+ : w <= PANGO_WEIGHT_BOLD ? Qbold /* 700 */
+ : w <= PANGO_WEIGHT_ULTRABOLD ? Qultra_bold /* 800 */
+ : w <= PANGO_WEIGHT_HEAVY ? Qblack /* 900 */
+ : Qultra_heavy); /* 1000 */
+}
+
+static
+Lisp_Object xg_style_to_symbol (PangoStyle s)
+{
+ return
+ (s == PANGO_STYLE_OBLIQUE ? Qoblique
+ : s == PANGO_STYLE_ITALIC ? Qitalic
+ : Qnormal);
+}
#endif /* HAVE_GTK3 */
font = CALLN (Ffont_spec,
QCfamily, build_string (family),
QCsize, make_float (pango_units_to_double (size)),
- QCweight, XG_WEIGHT_TO_SYMBOL (weight),
- QCslant, XG_STYLE_TO_SYMBOL (style));
+ QCweight, xg_weight_to_symbol (weight),
+ QCslant, xg_style_to_symbol (style));
char *font_desc_str = pango_font_description_to_string (desc);
dupstring (&x_last_font_name, font_desc_str);
static Lisp_Object
w32_to_fc_weight (int n)
{
- if (n >= FW_HEAVY) return intern ("black");
+ if (n >= FW_HEAVY) return Qbold;
if (n >= FW_EXTRABOLD) return Qextra_bold;
if (n >= FW_BOLD) return Qbold;
if (n >= FW_SEMIBOLD) return intern ("demibold");
- if (n >= FW_NORMAL) return intern ("medium");
+ if (n >= FW_NORMAL) return Qmedium;
if (n >= FW_LIGHT) return Qlight;
if (n >= FW_EXTRALIGHT) return Qextra_light;
return intern ("thin");
DEFSYM (Qpressed_button, "pressed-button");
DEFSYM (Qflat_button, "flat-button");
DEFSYM (Qnormal, "normal");
+ DEFSYM (Qthin, "thin");
DEFSYM (Qextra_light, "extra-light");
+ DEFSYM (Qultra_light, "ultra-light");
DEFSYM (Qlight, "light");
DEFSYM (Qsemi_light, "semi-light");
+ DEFSYM (Qmedium, "medium");
DEFSYM (Qsemi_bold, "semi-bold");
+ DEFSYM (Qbook, "book");
DEFSYM (Qbold, "bold");
DEFSYM (Qextra_bold, "extra-bold");
DEFSYM (Qultra_bold, "ultra-bold");
+ DEFSYM (Qheavy, "heavy");
+ DEFSYM (Qultra_heavy, "ultra-heavy");
+ DEFSYM (Qblack, "black");
DEFSYM (Qoblique, "oblique");
DEFSYM (Qitalic, "italic");