Skip to content

Commit 0cb3426

Browse files
authored
Give spacing marks space (#17826)
Spacing marks are called so, because they have a positive advance width, unlike their non-spacing neighbors (as the name indicates). After this we stop assigning such gc=Mc codepoints a zero width. Closes #17810
1 parent 1482fd4 commit 0cb3426

File tree

2 files changed

+463
-390
lines changed

2 files changed

+463
-390
lines changed

src/tools/GraphemeTableGen/Program.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@
161161
}
162162
buf.Append("};\n");
163163

164-
buf.Append($"constexpr uint{trie.Stages[^1].Bits}_t ucdLookup(const char32_t cp) noexcept\n");
164+
buf.Append("constexpr int ucdLookup(const char32_t cp) noexcept\n");
165165
buf.Append("{\n");
166166
foreach (var stage in trie.Stages)
167167
{
@@ -290,11 +290,10 @@ static Ucd ExtractValuesFromUcd(string path)
290290
};
291291

292292
// There's no "ea" attribute for "zero width" so we need to do that ourselves. This matches:
293-
// Mc: Mark, spacing combining
294293
// Me: Mark, enclosing
295294
// Mn: Mark, non-spacing
296295
// Cf: Control, format
297-
if (generalCategory.StartsWith("M") || generalCategory == "Cf")
296+
if (generalCategory == "Me" || generalCategory == "Mn" || generalCategory == "Cf")
298297
{
299298
width = CharacterWidth.ZeroWidth;
300299
}

0 commit comments

Comments
 (0)