<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 9/7/19 11:25 PM, Tom Honermann via
Lib wrote:<br>
</div>
<blockquote type="cite"
cite="mid:b1808336-e314-20f9-4f5d-670a6db24ed2@honermann.net">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<div class="moz-cite-prefix">On 9/7/19 9:11 PM, Zach Laine wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CALOpkJCKBw=Pca+-qb5wgyJAuW+RcHnux8-mezAXhgPkD0x2Xg@mail.gmail.com">
<meta http-equiv="content-type" content="text/html;
charset=UTF-8">
<div dir="ltr">
<div dir="ltr">On Sat, Sep 7, 2019 at 7:31 PM Tom Honermann
via Lib <<a href="mailto:lib@lists.isocpp.org"
moz-do-not-send="true">lib@lists.isocpp.org</a>> wrote:<br>
</div>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF">
<div class="gmail-m_8939139310385341323moz-cite-prefix">On
9/7/19 8:27 PM, Tony V E wrote:<br>
</div>
<blockquote type="cite">
<div
style="width:100%;font-size:initial;font-family:Calibri,"Slate
Pro",sans-serif,sans-serif;color:rgb(31,73,125);text-align:initial;background-color:rgb(255,255,255)">I
think we would want it to be measured in glyphs. </div>
</blockquote>
I agree that would be ideal, but...<br>
</div>
</blockquote>
<div><br>
</div>
<div>Stop right there. If that's ideal, let's do that. Or
at least, let's leave room for it to be done at some
point. Specifying CUs now prevents the ideal from ever
being realized. <br>
</div>
</div>
</div>
</blockquote>
There are other options. For example, a future extension could
allow specifying what units are to be used for field width.<br>
<blockquote type="cite"
cite="mid:CALOpkJCKBw=Pca+-qb5wgyJAuW+RcHnux8-mezAXhgPkD0x2Xg@mail.gmail.com">
<div dir="ltr">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF">
<blockquote type="cite">
<div
style="width:100%;font-size:initial;font-family:Calibri,"Slate
Pro",sans-serif,sans-serif;color:rgb(31,73,125);text-align:initial;background-color:rgb(255,255,255)">Are
you suggesting code points because glyphs are too
hard?</div>
</blockquote>
I don't know how to achieve that. Field width doesn't
really work for alignment unless one assumes a monospace
font. We could measure in terms of extended grapheme
clusters, but EGCS width has changed over time (e.g.,
family emoji). That makes alignment dependent on both
display properties and Unicode version. And, of course,
this would drag in locale dependence as well.</div>
</blockquote>
<div><br>
</div>
<div>If you just count N=EGCs, you get the "right" answer.
if your terminal shows more or less than N characters, get
a new terminal. What I mean by this is that there should
be no consideration of fonts.</div>
</div>
</div>
</blockquote>
I see field width as either indicating storage (number of code
units) or alignment. The number of user perceived characters is
not useful for aligning text unless a monospace font is assumed.
Therefore, storage seems like the more useful measurement. This
also aligns with <tt>format_to_n</tt> and <tt>formatted_size</tt>
which, unless I'm mistaken, work in code units. (It would be nice
to clarify the wording for these as well; what is meant by "number
of characters in the character representation"?)<br>
</blockquote>
<p>Henri Sivonen just today posted a fantastic analysis of the
various ways in which we think about the length/width of a
string. Particularly relevant to this discussion is the "Display
Space" section, but I encourage everyone to read the entire
article. It's fascinating!<br>
- <a moz-do-not-send="true"
href="https://hsivonen.fi/string-length">https://hsivonen.fi/string-length</a></p>
<p>Tom.<br>
</p>
</body>
</html>