Releases: german-one/wtswidth---Windows-Terminal-string-width
Releases · german-one/wtswidth---Windows-Terminal-string-width
wtswidth v1.3
Windows Terminal 1.26 introduces a new global compatibility setting. Users can now specify whether characters with ambiguous width occupy one column (narrow) or two columns (wide).
Therefore, a thin configuration layer has been added to the wtswidth library, allowing users to customize measuring, depending on their preferences.
Changes:
- add
wtsgetambwidth()andwtssetambwidth()functions to the API - use
intinstead ofsize_tto always make the length a 32-bit value; this simplifies interaction with managed code - releases for Windows now also contain the compiled library (DLL + LIB files)
- [app syntax] requires the first argument to be either 1 (narrow) or 2 (wide) for the ambiguous character width, before any string is passed to the app
Related Windows Terminal PR:
microsoft/terminal#19864
wtswidth v1.2
Changes:
- makes all gc=Cf, GCB=CN codepoints zero-width, but also
treats them as Extender codepoints - updates the tables to Unicode 16.0
Related Windows Terminal PR:
microsoft/terminal#18285
wtswidth v1.1
Changes:
- The tool now accepts several string arguments at once.
- (breaking) The string widths are written as list of numbers of character cells. Previously the return code has been used.
Reasons:- not more than one value can be returned at a time
- the return value on platforms other than Windows might be limited to 0..255, where the original value is narrowed to its 8 low order bits
- Incorporates the fix for spacing marks in Windows Terminal. (see Give spacing marks space)
wtswidth v1.0
These are builds from the initially committed code.
Pass a string to the utility. The return value is the width of the string as number of columns in the Windows Terminal window. Test scripts are included.