2018-08-26 23:45:34 +02:00
|
|
|
# HG changeset patch
|
|
|
|
# Parent 682df5267f4b25286ab78bfbbfd91fe664cbbd21
|
|
|
|
|
2023-10-03 16:04:15 +02:00
|
|
|
Index: xterm-385/fontutils.c
|
- Patch #353 - 2020/02/01
- amend change in patch #352 for button-events to fix a case where some followup events were not processed soon enough (report/patch by Jimmy Aguilar Mena).
- handle MappingNotify X event, to improve recovery when switching keyboard configurations using xkbcomp (prompted by discussion with Frank Mosch, Debian #661295). There is more work needed here, possibly in the X libraries.
- improve discussion of mouse-mode in ctlseqs.ms (suggested by Igor van den Hoven).
- further improve checks for Xft max-advance-width to take into account fonts which use two cells for ambiguous width characters. Also improve the time used for these checks (reports by Yuri Pankov, Frank Mosch).
- fix a few spelling errors reported by codespell (report by Jens Schleusener).
- modify run-tic.sh to prefer development version of ncurses since changes to terminfo file in patch #345 rely upon bug-fixes in ncurses (prompted by discussion with Will Senn).
- Patch #352 - 2020/01/16
- adjust fontsize data to handle a minor inconsistency from recent Xft versions (Debian #880407, adapted from patch by Vincent Lefevre).
- add a table to the manual page description of forceBoxChars to alert the reader to the special characters aside from “line-drawing” which are drawn directly when this resource is set (Debian #931305).
- improve checkXft logic which attempts to detect fonts whose max-advance-width is inconsistent with the actual glyph widths. For some fonts, it is necessary to check additional characters (report/analysis by Jan Engelhardt).
- improve configure-checks for X headers and libraries on recent MacOS, which has moved those files under /usr/X11.
- improve portability of iconify/deiconify feature by taking into account some window managers which manipulate the EWMH _NET_WM_STATE property, adding/removing _NET_WM_STATE_HIDDEN rather than actually minimizing the window (prompted by discussion with Jörg Breitbart).
- improve workaround from patch #287 for the -iconic option when configured with toolbar by postponing the extra request for minimizing the window to the end of menu-initialization.
- modify xevents special-case for mouse-events to include button-events so that the meta key by itself can generate button-events (report/analysis by Mattias Engdegård).
- amend SGR-stack change from patch #348 to not associate bold attribute with background color (report by Nicholas Marriott).
- fix copy/paste error in manual page (patch by Larry Hynes).
- add definitions in xterm_io.h so that GNU/Hurd will use posix_openpty (patch by Samuel Thibault).
- build-fix in debug-tracing, for esctest.
- updated autoconf macros
- update config.guess
- Patch #351 - 2019/11/17
- correct logic in property_to_string for deciding when to fallback from UTF-8 decoding to ISO-8859-1 decoding, broken in xterm #350 (FreeBSD #241961).
- add -report-icons to help-message.
- improved autoconf macros:
- CF_ADD_LIBS: the change to filter out duplicates caused this to append rather than prepend. revise to fix that.
- CF_GCC_VERSION and CF_GCC_WARNINGS: move checks to distinguish icc/clang from gcc from the macro which handles the --enable-warnings option, to make this work without-warnings for the inline-checks.
- update config.guess, config.sub
- correct status in XTGETXRES replies when the resource was not found.
- fix some gcc, cppcheck, clang and coverity warnings.
OBS-URL: https://build.opensuse.org/package/show/X11:terminals/xterm?expand=0&rev=182
2020-03-26 13:24:55 +01:00
|
|
|
===================================================================
|
2023-10-03 16:04:15 +02:00
|
|
|
--- xterm-385.orig/fontutils.c
|
|
|
|
+++ xterm-385/fontutils.c
|
|
|
|
@@ -883,67 +883,19 @@ is_double_width_font(XFontStruct *fs)
|
2007-02-26 19:06:02 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if OPT_WIDE_CHARS && OPT_RENDERFONT && defined(HAVE_TYPE_FCCHAR32)
|
|
|
|
-#define HALF_WIDTH_TEST_STRING "1234567890"
|
- Patch #353 - 2020/02/01
- amend change in patch #352 for button-events to fix a case where some followup events were not processed soon enough (report/patch by Jimmy Aguilar Mena).
- handle MappingNotify X event, to improve recovery when switching keyboard configurations using xkbcomp (prompted by discussion with Frank Mosch, Debian #661295). There is more work needed here, possibly in the X libraries.
- improve discussion of mouse-mode in ctlseqs.ms (suggested by Igor van den Hoven).
- further improve checks for Xft max-advance-width to take into account fonts which use two cells for ambiguous width characters. Also improve the time used for these checks (reports by Yuri Pankov, Frank Mosch).
- fix a few spelling errors reported by codespell (report by Jens Schleusener).
- modify run-tic.sh to prefer development version of ncurses since changes to terminfo file in patch #345 rely upon bug-fixes in ncurses (prompted by discussion with Will Senn).
- Patch #352 - 2020/01/16
- adjust fontsize data to handle a minor inconsistency from recent Xft versions (Debian #880407, adapted from patch by Vincent Lefevre).
- add a table to the manual page description of forceBoxChars to alert the reader to the special characters aside from “line-drawing” which are drawn directly when this resource is set (Debian #931305).
- improve checkXft logic which attempts to detect fonts whose max-advance-width is inconsistent with the actual glyph widths. For some fonts, it is necessary to check additional characters (report/analysis by Jan Engelhardt).
- improve configure-checks for X headers and libraries on recent MacOS, which has moved those files under /usr/X11.
- improve portability of iconify/deiconify feature by taking into account some window managers which manipulate the EWMH _NET_WM_STATE property, adding/removing _NET_WM_STATE_HIDDEN rather than actually minimizing the window (prompted by discussion with Jörg Breitbart).
- improve workaround from patch #287 for the -iconic option when configured with toolbar by postponing the extra request for minimizing the window to the end of menu-initialization.
- modify xevents special-case for mouse-events to include button-events so that the meta key by itself can generate button-events (report/analysis by Mattias Engdegård).
- amend SGR-stack change from patch #348 to not associate bold attribute with background color (report by Nicholas Marriott).
- fix copy/paste error in manual page (patch by Larry Hynes).
- add definitions in xterm_io.h so that GNU/Hurd will use posix_openpty (patch by Samuel Thibault).
- build-fix in debug-tracing, for esctest.
- updated autoconf macros
- update config.guess
- Patch #351 - 2019/11/17
- correct logic in property_to_string for deciding when to fallback from UTF-8 decoding to ISO-8859-1 decoding, broken in xterm #350 (FreeBSD #241961).
- add -report-icons to help-message.
- improved autoconf macros:
- CF_ADD_LIBS: the change to filter out duplicates caused this to append rather than prepend. revise to fix that.
- CF_GCC_VERSION and CF_GCC_WARNINGS: move checks to distinguish icc/clang from gcc from the macro which handles the --enable-warnings option, to make this work without-warnings for the inline-checks.
- update config.guess, config.sub
- correct status in XTGETXRES replies when the resource was not found.
- fix some gcc, cppcheck, clang and coverity warnings.
OBS-URL: https://build.opensuse.org/package/show/X11:terminals/xterm?expand=0&rev=182
2020-03-26 13:24:55 +01:00
|
|
|
|
2007-02-26 19:06:02 +01:00
|
|
|
-/* '1234567890' in Chinese characters in UTF-8 */
|
|
|
|
-#define FULL_WIDTH_TEST_STRING "\xe4\xb8\x80\xe4\xba\x8c\xe4\xb8\x89" \
|
|
|
|
- "\xe5\x9b\x9b\xe4\xba\x94" \
|
|
|
|
- "\xef\xa7\x91\xe4\xb8\x83\xe5\x85\xab" \
|
|
|
|
- "\xe4\xb9\x9d\xef\xa6\xb2"
|
2013-05-29 16:46:55 +02:00
|
|
|
-
|
2007-02-26 19:06:02 +01:00
|
|
|
-/* '1234567890' in Korean script in UTF-8 */
|
|
|
|
-#define FULL_WIDTH_TEST_STRING2 "\xec\x9d\xbc\xec\x9d\xb4\xec\x82\xbc" \
|
|
|
|
- "\xec\x82\xac\xec\x98\xa4" \
|
|
|
|
- "\xec\x9c\xa1\xec\xb9\xa0\xed\x8c\x94" \
|
|
|
|
- "\xea\xb5\xac\xec\x98\x81"
|
|
|
|
-
|
2007-03-23 01:49:05 +01:00
|
|
|
-#define HALF_WIDTH_CHAR1 0x0031 /* '1' */
|
2007-02-26 19:06:02 +01:00
|
|
|
-#define HALF_WIDTH_CHAR2 0x0057 /* 'W' */
|
|
|
|
#define FULL_WIDTH_CHAR1 0x4E00 /* CJK Ideograph 'number one' */
|
|
|
|
#define FULL_WIDTH_CHAR2 0xAC00 /* Korean script syllable 'Ka' */
|
|
|
|
|
|
|
|
static Bool
|
Accepting request 232778 from home:pcerny:factory
- Patch #304 - 2014/05/03
* add debugging check for parsing table entries, fixed a few
inconsistencies.
* handle utmp/utmpx strings consistently with new function that
null-pads unused locations.
* build-fix for imake configuration with FreeBSD 9 and later,
to account for replacing utmp with utmpx.
* improve handling of the fontsel (font-selection) menu item:
+ initialize the menu entry differently if the toolbar
configuration is used, i.e., enabling it without attempting
to use the current selection as a font name. Because of the
way in which the toolbar is setup, this attempt usually
failed, and would result in a warning.
+ if the menu action fails, e.g., no font can be loaded for
the given selected name, then recover by resuming with the
current font. Before, the recovery went to the default
font. That was done to work around missing bitmap font in
patch #276.
* document OSC 119 in the control sequences listing (report by
Egmont Koblinger).
* modify special handling of XF86Paste or SunPaste keysyms (see
patch #227) to use the standard shift/lock modifiers in case
those are, for example, used in level 3 in an XKB file (patch
by Matthieu Herrb).
* configure macro updates:
+ drop the -no-gcc option from CF_INTEL_COMPILER
+ modify CF_XOPEN_SOURCE to suppress the check for defining
_XOPEN_SOURCE on Solaris
* reduce bss storage used for ReGIS/Sixel modules, as well as
cleanup storage usage in other modules.
OBS-URL: https://build.opensuse.org/request/show/232778
OBS-URL: https://build.opensuse.org/package/show/X11:terminals/xterm?expand=0&rev=92
2014-05-06 00:05:44 +02:00
|
|
|
is_double_width_font_xft(Display *dpy, XftFont *font)
|
2007-02-26 19:06:02 +01:00
|
|
|
{
|
|
|
|
- XGlyphInfo gi1, gi2;
|
|
|
|
- FcChar32 c1 = HALF_WIDTH_CHAR1, c2 = HALF_WIDTH_CHAR2;
|
2011-10-12 09:21:46 +02:00
|
|
|
- String fwstr = FULL_WIDTH_TEST_STRING;
|
|
|
|
- String hwstr = HALF_WIDTH_TEST_STRING;
|
2007-02-26 19:06:02 +01:00
|
|
|
-
|
Accepting request 232778 from home:pcerny:factory
- Patch #304 - 2014/05/03
* add debugging check for parsing table entries, fixed a few
inconsistencies.
* handle utmp/utmpx strings consistently with new function that
null-pads unused locations.
* build-fix for imake configuration with FreeBSD 9 and later,
to account for replacing utmp with utmpx.
* improve handling of the fontsel (font-selection) menu item:
+ initialize the menu entry differently if the toolbar
configuration is used, i.e., enabling it without attempting
to use the current selection as a font name. Because of the
way in which the toolbar is setup, this attempt usually
failed, and would result in a warning.
+ if the menu action fails, e.g., no font can be loaded for
the given selected name, then recover by resuming with the
current font. Before, the recovery went to the default
font. That was done to work around missing bitmap font in
patch #276.
* document OSC 119 in the control sequences listing (report by
Egmont Koblinger).
* modify special handling of XF86Paste or SunPaste keysyms (see
patch #227) to use the standard shift/lock modifiers in case
those are, for example, used in level 3 in an XKB file (patch
by Matthieu Herrb).
* configure macro updates:
+ drop the -no-gcc option from CF_INTEL_COMPILER
+ modify CF_XOPEN_SOURCE to suppress the check for defining
_XOPEN_SOURCE on Solaris
* reduce bss storage used for ReGIS/Sixel modules, as well as
cleanup storage usage in other modules.
OBS-URL: https://build.opensuse.org/request/show/232778
OBS-URL: https://build.opensuse.org/package/show/X11:terminals/xterm?expand=0&rev=92
2014-05-06 00:05:44 +02:00
|
|
|
- /* Some Korean fonts don't have Chinese characters at all. */
|
2007-02-26 19:06:02 +01:00
|
|
|
- if (!XftCharExists(dpy, font, FULL_WIDTH_CHAR1)) {
|
|
|
|
- if (!XftCharExists(dpy, font, FULL_WIDTH_CHAR2))
|
|
|
|
- return False; /* Not a CJK font */
|
|
|
|
- else /* a Korean font without CJK Ideographs */
|
|
|
|
- fwstr = FULL_WIDTH_TEST_STRING2;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- XftTextExtents32(dpy, font, &c1, 1, &gi1);
|
|
|
|
- XftTextExtents32(dpy, font, &c2, 1, &gi2);
|
|
|
|
- if (gi1.xOff != gi2.xOff) /* Not a fixed-width font */
|
|
|
|
- return False;
|
|
|
|
-
|
2011-10-12 09:21:46 +02:00
|
|
|
- XftTextExtentsUtf8(dpy,
|
|
|
|
- font,
|
|
|
|
- (_Xconst FcChar8 *) hwstr,
|
|
|
|
- (int) strlen(hwstr),
|
|
|
|
- &gi1);
|
|
|
|
- XftTextExtentsUtf8(dpy,
|
|
|
|
- font,
|
|
|
|
- (_Xconst FcChar8 *) fwstr,
|
|
|
|
- (int) strlen(fwstr),
|
|
|
|
- &gi2);
|
2007-02-26 19:06:02 +01:00
|
|
|
-
|
|
|
|
- /*
|
|
|
|
- * fontconfig and Xft prior to 2.2(?) set the width of half-width
|
|
|
|
- * characters identical to that of full-width character in CJK double-width
|
|
|
|
- * (bi-width / monospace) font even though the former is half as wide as
|
|
|
|
- * the latter. This was fixed sometime before the release of fontconfig
|
|
|
|
- * 2.2 in early 2003. See
|
|
|
|
- * http://bugzilla.mozilla.org/show_bug.cgi?id=196312
|
|
|
|
- * In the meantime, we have to check both possibilities.
|
|
|
|
- */
|
|
|
|
- return ((2 * gi1.xOff == gi2.xOff) || (gi1.xOff == gi2.xOff));
|
Accepting request 232778 from home:pcerny:factory
- Patch #304 - 2014/05/03
* add debugging check for parsing table entries, fixed a few
inconsistencies.
* handle utmp/utmpx strings consistently with new function that
null-pads unused locations.
* build-fix for imake configuration with FreeBSD 9 and later,
to account for replacing utmp with utmpx.
* improve handling of the fontsel (font-selection) menu item:
+ initialize the menu entry differently if the toolbar
configuration is used, i.e., enabling it without attempting
to use the current selection as a font name. Because of the
way in which the toolbar is setup, this attempt usually
failed, and would result in a warning.
+ if the menu action fails, e.g., no font can be loaded for
the given selected name, then recover by resuming with the
current font. Before, the recovery went to the default
font. That was done to work around missing bitmap font in
patch #276.
* document OSC 119 in the control sequences listing (report by
Egmont Koblinger).
* modify special handling of XF86Paste or SunPaste keysyms (see
patch #227) to use the standard shift/lock modifiers in case
those are, for example, used in level 3 in an XKB file (patch
by Matthieu Herrb).
* configure macro updates:
+ drop the -no-gcc option from CF_INTEL_COMPILER
+ modify CF_XOPEN_SOURCE to suppress the check for defining
_XOPEN_SOURCE on Solaris
* reduce bss storage used for ReGIS/Sixel modules, as well as
cleanup storage usage in other modules.
OBS-URL: https://build.opensuse.org/request/show/232778
OBS-URL: https://build.opensuse.org/package/show/X11:terminals/xterm?expand=0&rev=92
2014-05-06 00:05:44 +02:00
|
|
|
+ /* Some Korean fonts don't have Chinese characters at all. */
|
|
|
|
+ if (XftCharExists(dpy, font, FULL_WIDTH_CHAR1) ||
|
|
|
|
+ XftCharExists(dpy, font, FULL_WIDTH_CHAR2))
|
|
|
|
+ return True; /* CJK font */
|
|
|
|
+ else
|
|
|
|
+ return False; /* Not a CJK font */
|
2007-02-26 19:06:02 +01:00
|
|
|
}
|
|
|
|
#else
|
|
|
|
#define is_double_width_font_xft(dpy, xftfont) 0
|