Browse Source

Fix text tokenization for inherited scripts

pull/5864/head
Benedikt Stebner 5 years ago
parent
commit
265518859a
  1. 21
      src/Avalonia.Visuals/Media/TextFormatting/TextCharacters.cs

21
src/Avalonia.Visuals/Media/TextFormatting/TextCharacters.cs

@ -161,30 +161,27 @@ namespace Avalonia.Media.TextFormatting
if (currentScript != script)
{
if (currentScript != Script.Inherited && currentScript != Script.Common)
if (script == Script.Inherited || script == Script.Common)
{
if (script == Script.Inherited || script == Script.Common)
{
script = currentScript;
}
else
script = currentScript;
}
else
{
if (currentScript != Script.Inherited && currentScript != Script.Common)
{
break;
}
}
}
if (isFallback)
if (currentScript != Script.Common && currentScript != Script.Inherited)
{
if (defaultFont.TryGetGlyph(grapheme.FirstCodepoint, out _))
if (isFallback && defaultFont.TryGetGlyph(grapheme.FirstCodepoint, out _))
{
break;
}
}
if (!font.TryGetGlyph(grapheme.FirstCodepoint, out _))
{
if (!grapheme.FirstCodepoint.IsWhiteSpace)
if (!font.TryGetGlyph(grapheme.FirstCodepoint, out _))
{
break;
}

Loading…
Cancel
Save