Fix for font fallback failing after embedded \n.
This commit is contained in:
Родитель
6a1aebd533
Коммит
f606f78539
|
@ -11,8 +11,8 @@ namespace SandboxDriver
|
|||
FontMapper.Default = new SandboxFontMapper();
|
||||
}
|
||||
|
||||
public int ContentModeCount = 14;
|
||||
public int ContentMode = 0;
|
||||
public int ContentModeCount = 15;
|
||||
public int ContentMode = 13;
|
||||
public TextDirection BaseDirection = TextDirection.LTR;
|
||||
public TextAlignment TextAlignment = TextAlignment.Auto;
|
||||
public float Scale = 1.0f;
|
||||
|
@ -240,6 +240,10 @@ namespace SandboxDriver
|
|||
break;
|
||||
|
||||
case 13:
|
||||
_textBlock.AddText("再起動に問題がある場合は次のオプションを使用して、通常の起動機能を無効にし\n制御を回復することをお勧めします。", styleNormal);
|
||||
break;
|
||||
|
||||
case 14:
|
||||
//_textBlock.AddText("Password \nAnother \n", stylePassword);
|
||||
_textBlock.AddText("Hello World\u2029", styleNormal);
|
||||
break;
|
||||
|
|
|
@ -108,7 +108,7 @@ namespace Topten.RichTextKit
|
|||
continue;
|
||||
|
||||
// Must be a cluster boundary
|
||||
if (!GraphemeClusterAlgorithm.IsBoundary(codePoints, i))
|
||||
if (!GraphemeClusterAlgorithm.IsBoundary(codePoints, i))
|
||||
continue;
|
||||
|
||||
// We can do font fallback...
|
||||
|
@ -141,6 +141,14 @@ namespace Topten.RichTextKit
|
|||
subSpanTypeface = CharacterMatcher.MatchCharacter(typeface.FamilyName, typeface.FontWeight, typeface.FontWidth, typeface.FontSlant, null, codePoints[unmatchedStart]);
|
||||
if (subSpanTypeface == null)
|
||||
{
|
||||
// Reset the glyphs in the rest of the range back to unknown
|
||||
// Fix for this text block string like this:
|
||||
// "再起動に問題がある場合は次のオプションを使用して、通常の起動機能を無効にし\n制御を回復することをお勧めします。"
|
||||
// not reverting to fallback font after the embedded carriage return:
|
||||
for (int j = unmatchedStart; j < unmatchedEnd; j++)
|
||||
{
|
||||
glyphs[j] = 0;
|
||||
}
|
||||
unmatchedEnd = unmatchedStart;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -656,6 +656,9 @@ namespace Topten.RichTextKit
|
|||
SKTextEncoding.GlyphId,
|
||||
_font,
|
||||
GlyphPositions.AsSpan());
|
||||
|
||||
if (_textBlob == null)
|
||||
return;
|
||||
}
|
||||
|
||||
// Paint underline
|
||||
|
|
Загрузка…
Ссылка в новой задаче