From: Eli Zaretskii Date: Fri, 3 Dec 2021 08:02:46 +0000 (+0200) Subject: Revert "Support display of non-ASCII characters with aligned columns" X-Git-Tag: emacs-29.0.90~3619^2~40^2 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1431fce67f75e5f0acaa77f508502a00603177de;p=emacs.git Revert "Support display of non-ASCII characters with aligned columns" This reverts commit 608267c71e11da9c757c269a5e22e62ef04d0bfe. --- diff --git a/src/xdisp.c b/src/xdisp.c index 80c8457795d..9f93799783d 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -28812,21 +28812,6 @@ normal_char_height (struct font *font, int c) return ascent + descent; } -/* Return the "standard" pixel width of a character from FACE's font, - if the font is fixed-pitch, zero otherwise. */ -static int -get_normal_width (struct face *face) -{ - struct font *ascii_font = face->ascii_face->font; - /* Heuristics: fixed-pitch fonts have the value of MAX-WIDTH not - much larger than AVERAGE-WIDTH. */ - bool fixed_pitch = - ascii_font->average_width == ascii_font->space_width - && ascii_font->average_width != 0 - && ascii_font->max_width < 3 * ascii_font->average_width; - return fixed_pitch ? ascii_font->space_width : 0; -} - /* EXPORT for RIF: Set *LEFT and *RIGHT to the left and right overhang of GLYPH on frame F. Overhangs of glyphs other than type CHAR_GLYPH are @@ -30924,17 +30909,6 @@ gui_produce_glyphs (struct it *it) it->phys_ascent = pcm->ascent + boff; it->phys_descent = pcm->descent - boff; it->pixel_width = pcm->width; - if (align_columns_display) - { - int unit_width = get_normal_width (face); - if (unit_width > 0) - { - int ncolumns = - (it->pixel_width - 1 + unit_width) / unit_width; - - it->pixel_width = ncolumns * unit_width; - } - } /* Don't use font-global values for ascent and descent if they result in an exceedingly large line height. */ if (it->override_ascent < 0) @@ -31512,17 +31486,6 @@ gui_produce_glyphs (struct it *it) it->glyph_row->contains_overlapping_glyphs_p = true; it->pixel_width = cmp->pixel_width; - if (align_columns_display) - { - int unit_width = get_normal_width (face); - if (unit_width > 0) - { - int ncolumns = - (it->pixel_width - 1 + unit_width) / unit_width; - - it->pixel_width = ncolumns * unit_width; - } - } it->ascent = it->phys_ascent = cmp->ascent; it->descent = it->phys_descent = cmp->descent; IT_APPLY_FACE_BOX(it, face); @@ -31568,17 +31531,6 @@ gui_produce_glyphs (struct it *it) it->glyph_row->contains_overlapping_glyphs_p = true; it->ascent = it->phys_ascent = metrics.ascent; it->descent = it->phys_descent = metrics.descent; - if (align_columns_display) - { - int unit_width = get_normal_width (face); - if (unit_width > 0) - { - int ncolumns = - (it->pixel_width - 1 + unit_width) / unit_width; - - it->pixel_width = ncolumns * unit_width; - } - } } IT_APPLY_FACE_BOX(it, face); @@ -35655,15 +35607,6 @@ variable are ignored and the default 0.25 is used instead. */); Value is a number or a cons (WIDTH-DPI . HEIGHT-DPI). */); Vdisplay_pixels_per_inch = make_float (72.0); - DEFVAR_BOOL ("align-columns-display", align_columns_display, - doc: /* Whether to align columns on GUI frames. -If this is non-nil characters displayed on GUI frames will be -aligned to produce straight columns. This is achieved by -enlarging the pixel width of characters to an integral -multiple of pixels taken by ASCII characters of the same face. -This affects only fixed-pitch fonts. */); - align_columns_display = false; - #ifdef GLYPH_DEBUG DEFVAR_INT ("debug-end-pos", debug_end_pos, doc: /* Don't ask. */); #endif