Merged halo and font width from master
This commit is contained in:
Коммит
5c899d9193
|
@ -52,7 +52,8 @@ namespace SandboxDriver
|
|||
}
|
||||
|
||||
//string typefaceName = "Times New Roman";
|
||||
string typefaceName = "Segoe UI";
|
||||
string typefaceName = "Arial";
|
||||
//string typefaceName = "Segoe UI";
|
||||
//string typefaceName = "Segoe Script";
|
||||
|
||||
var styleNormal = new Style() { FontFamily = typefaceName, FontSize = 18 * Scale };
|
||||
|
@ -67,11 +68,14 @@ namespace SandboxDriver
|
|||
var styleStrike = styleNormal.Modify(strikeThrough: StrikeThroughStyle.Solid);
|
||||
var styleSubScript = styleNormal.Modify(fontVariant: FontVariant.SubScript);
|
||||
var styleSuperScript = styleNormal.Modify(fontVariant: FontVariant.SuperScript);
|
||||
var styleCondensed = styleNormal.Modify(fontWidth: SKFontStyleWidth.Condensed);
|
||||
var styleExpanded = styleNormal.Modify(fontWidth: SKFontStyleWidth.Expanded);
|
||||
var styleItalic = styleNormal.Modify(fontItalic: true);
|
||||
var styleBoldLarge = styleNormal.Modify(fontSize: 28 * Scale, fontWeight: 700);
|
||||
var styleRed = styleNormal.Modify(textColor: new SKColor(0xFFFF0000));
|
||||
var styleBlue = styleNormal.Modify(textColor: new SKColor(0xFF0000FF));
|
||||
var styleFontAwesome = new Style() { FontFamily = "FontAwesome", FontSize = 24 * Scale};
|
||||
var styleFontAwesome = new Style() { FontFamily = "FontAwesome", FontSize = 24 * Scale };
|
||||
var styleHalo = styleNormal.Modify(haloColor: SKColors.Gray, haloWidth: 5, haloBlur: 0);
|
||||
|
||||
|
||||
_textBlock.Clear();
|
||||
|
@ -101,7 +105,10 @@ namespace SandboxDriver
|
|||
_textBlock.AddText("2", styleSubScript);
|
||||
_textBlock.AddText("O), ", styleNormal);
|
||||
_textBlock.AddText("colored ", styleRed);
|
||||
_textBlock.AddText("text", styleBlue);
|
||||
_textBlock.AddText("text, ", styleBlue);
|
||||
_textBlock.AddText("condensed", styleCondensed);
|
||||
_textBlock.AddText(" and ", styleNormal);
|
||||
_textBlock.AddText("expanded", styleExpanded);
|
||||
_textBlock.AddText(" and ", styleNormal);
|
||||
_textBlock.AddText("mixed ", styleNormal);
|
||||
_textBlock.AddText("sizes", styleSmall);
|
||||
|
@ -111,6 +118,14 @@ namespace SandboxDriver
|
|||
_textBlock.AddText("Font fallback means emojis work: 🙍♀️ 🌐 🍪 🍕 🚀 and ", styleNormal);
|
||||
_textBlock.AddText("text shaping and bi-directional text support means complex scripts and languages like Arabic: مرحبا بالعالم, Japanese: ハローワールド, Chinese: 世界您好 and Hindi: हैलो वर्ल्ड are rendered correctly!\n\n", styleNormal);
|
||||
_textBlock.AddText("RichTextKit also supports left/center/right text alignment, word wrapping, truncation with ellipsis place-holder, text measurement, hit testing, painting a selection range, caret position & shape helpers.", styleNormal);
|
||||
_textBlock.AddText(".\n\n", styleNormal);
|
||||
_textBlock.AddText("RichTextKit ", styleHalo);
|
||||
styleHalo = styleHalo.Modify(haloColor: SKColors.Red, haloWidth: 2, haloBlur: 0);
|
||||
_textBlock.AddText("also", styleHalo);
|
||||
styleHalo = styleHalo.Modify(haloColor: SKColors.Green, haloWidth: 2, haloBlur: 1);
|
||||
_textBlock.AddText(" supports ", styleHalo);
|
||||
styleHalo = styleHalo.Modify(fontWeight: 700, haloColor: SKColors.Blue, haloWidth: 5, haloBlur: 5);
|
||||
_textBlock.AddText("halo.", styleHalo);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
|
|
|
@ -52,7 +52,7 @@ namespace Topten.RichTextKit
|
|||
return SKTypeface.FromFamilyName(
|
||||
style.FontFamily,
|
||||
(SKFontStyleWeight)(style.FontWeight + extraWeight),
|
||||
0,
|
||||
style.FontWidth,
|
||||
style.FontItalic ? SKFontStyleSlant.Italic : SKFontStyleSlant.Upright
|
||||
) ?? SKTypeface.CreateDefault();
|
||||
}
|
||||
|
|
|
@ -602,6 +602,7 @@ namespace Topten.RichTextKit
|
|||
|
||||
// Text
|
||||
using (var paint = new SKPaint())
|
||||
using (var paintHalo = new SKPaint())
|
||||
{
|
||||
// Work out font variant adjustments
|
||||
float glyphScale = 1;
|
||||
|
@ -620,6 +621,16 @@ namespace Topten.RichTextKit
|
|||
// Setup SKPaint
|
||||
paint.Color = Style.TextColor;
|
||||
|
||||
if (Style.HaloColor != SKColor.Empty)
|
||||
{
|
||||
paintHalo.Color = Style.HaloColor;
|
||||
paintHalo.Style = SKPaintStyle.Stroke;
|
||||
paintHalo.StrokeWidth = Style.HaloWidth;
|
||||
paintHalo.StrokeCap = SKStrokeCap.Square;
|
||||
if (Style.HaloBlur > 0)
|
||||
paintHalo.MaskFilter = SKMaskFilter.CreateBlur(SKBlurStyle.Normal, Style.HaloBlur);
|
||||
}
|
||||
|
||||
unsafe
|
||||
{
|
||||
fixed (ushort* pGlyphs = Glyphs.Underlying)
|
||||
|
@ -653,6 +664,7 @@ namespace Topten.RichTextKit
|
|||
// Work out underline metrics
|
||||
float underlineYPos = Line.YCoord + Line.BaseLine + (_font.Metrics.UnderlinePosition ?? 0);
|
||||
paint.StrokeWidth = _font.Metrics.UnderlineThickness ?? 1;
|
||||
paintHalo.StrokeWidth = paint.StrokeWidth + Style.HaloWidth;
|
||||
|
||||
if (Style.Underline == UnderlineStyle.Gapped)
|
||||
{
|
||||
|
@ -666,12 +678,16 @@ namespace Topten.RichTextKit
|
|||
float b = interceptPositions[i] - paint.StrokeWidth;
|
||||
if (x < b)
|
||||
{
|
||||
if (Style.HaloColor != SKColor.Empty)
|
||||
ctx.Canvas.DrawLine(new SKPoint(x, underlineYPos), new SKPoint(b, underlineYPos), paintHalo);
|
||||
ctx.Canvas.DrawLine(new SKPoint(x, underlineYPos), new SKPoint(b, underlineYPos), paint);
|
||||
}
|
||||
x = interceptPositions[i + 1] + paint.StrokeWidth;
|
||||
}
|
||||
if (x < XCoord + Width)
|
||||
{
|
||||
if (Style.HaloColor != SKColor.Empty)
|
||||
ctx.Canvas.DrawLine(new SKPoint(x, underlineYPos), new SKPoint(XCoord + Width, underlineYPos), paintHalo);
|
||||
ctx.Canvas.DrawLine(new SKPoint(x, underlineYPos), new SKPoint(XCoord + Width, underlineYPos), paint);
|
||||
}
|
||||
}
|
||||
|
@ -681,25 +697,42 @@ namespace Topten.RichTextKit
|
|||
{
|
||||
case UnderlineStyle.ImeInput:
|
||||
paint.PathEffect = SKPathEffect.CreateDash(new float[] { paint.StrokeWidth, paint.StrokeWidth }, paint.StrokeWidth);
|
||||
paintHalo.PathEffect = SKPathEffect.CreateDash(new float[] { paintHalo.StrokeWidth, paintHalo.StrokeWidth }, paintHalo.StrokeWidth);
|
||||
break;
|
||||
|
||||
case UnderlineStyle.ImeConverted:
|
||||
paint.PathEffect = SKPathEffect.CreateDash(new float[] { paint.StrokeWidth, paint.StrokeWidth }, paint.StrokeWidth);
|
||||
paintHalo.PathEffect = SKPathEffect.CreateDash(new float[] { paintHalo.StrokeWidth, paintHalo.StrokeWidth }, paintHalo.StrokeWidth);
|
||||
break;
|
||||
|
||||
case UnderlineStyle.ImeTargetConverted:
|
||||
paint.StrokeWidth *= 2;
|
||||
paintHalo.StrokeWidth *= 2;
|
||||
break;
|
||||
|
||||
case UnderlineStyle.ImeTargetNonConverted:
|
||||
break;
|
||||
}
|
||||
// Paint solid underline
|
||||
if (Style.HaloColor != SKColor.Empty)
|
||||
ctx.Canvas.DrawLine(new SKPoint(XCoord, underlineYPos), new SKPoint(XCoord + Width, underlineYPos), paintHalo);
|
||||
ctx.Canvas.DrawLine(new SKPoint(XCoord, underlineYPos), new SKPoint(XCoord + Width, underlineYPos), paint);
|
||||
paint.PathEffect = null;
|
||||
paintHalo.PathEffect = null;
|
||||
}
|
||||
}
|
||||
|
||||
if (Style.HaloColor != SKColor.Empty)
|
||||
{
|
||||
// Paint strikethrough
|
||||
if (Style.StrikeThrough != StrikeThroughStyle.None && RunKind == FontRunKind.Normal)
|
||||
{
|
||||
paint.StrokeWidth = _font.Metrics.StrikeoutThickness ?? 0;
|
||||
float strikeYPos = Line.YCoord + Line.BaseLine + (_font.Metrics.StrikeoutPosition ?? 0) + glyphVOffset;
|
||||
ctx.Canvas.DrawLine(new SKPoint(XCoord, strikeYPos), new SKPoint(XCoord + Width, strikeYPos), paintHalo);
|
||||
}
|
||||
ctx.Canvas.DrawText(_textBlob, 0, 0, paintHalo);
|
||||
}
|
||||
|
||||
ctx.Canvas.DrawText(_textBlob, 0, 0, paint);
|
||||
}
|
||||
|
|
|
@ -42,6 +42,11 @@ namespace Topten.RichTextKit
|
|||
/// </summary>
|
||||
int FontWeight { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The font weight for text in this run.
|
||||
/// </summary>
|
||||
SKFontStyleWidth FontWidth { get; }
|
||||
|
||||
/// <summary>
|
||||
/// True if the text in this run should be displayed in an italic
|
||||
/// font; otherwise False.
|
||||
|
@ -73,6 +78,21 @@ namespace Topten.RichTextKit
|
|||
/// </summary>
|
||||
SKColor BackgroundColor { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Color of the halo
|
||||
/// </summary>
|
||||
SKColor HaloColor { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Width of halo
|
||||
/// </summary>
|
||||
float HaloWidth { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Blur of halo
|
||||
/// </summary>
|
||||
float HaloBlur { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Extra spacing between each character
|
||||
/// </summary>
|
||||
|
|
|
@ -31,7 +31,7 @@ namespace Topten.RichTextKit
|
|||
/// <returns>A key string</returns>
|
||||
public static string Key(this IStyle This)
|
||||
{
|
||||
return $"{This.FontFamily}.{This.FontSize}.{This.FontWeight}.{This.FontItalic}.{This.Underline}.{This.StrikeThrough}.{This.LineHeight}.{This.TextColor}.{This.BackgroundColor}.{This.LetterSpacing}.{This.FontVariant}.{This.TextDirection}.{This.ReplacementCharacter}";
|
||||
return $"{This.FontFamily}.{This.FontSize}.{This.FontWeight}.{This.FontWidth}.{This.FontItalic}.{This.Underline}.{This.StrikeThrough}.{This.LineHeight}.{This.TextColor}.{This.BackgroundColor}.{This.LetterSpacing}.{This.FontVariant}.{This.TextDirection}.{This.ReplacementCharacter}";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -49,6 +49,8 @@ namespace Topten.RichTextKit
|
|||
return false;
|
||||
if (This.FontWeight != other.FontWeight)
|
||||
return false;
|
||||
if (This.FontWidth != other.FontWidth)
|
||||
return false;
|
||||
if (This.FontItalic != other.FontItalic)
|
||||
return false;
|
||||
if (This.LineHeight != other.LineHeight)
|
||||
|
|
|
@ -53,12 +53,16 @@ namespace Topten.RichTextKit
|
|||
/// <param name="fontFamily">The new font family</param>
|
||||
/// <param name="fontSize">The new font size</param>
|
||||
/// <param name="fontWeight">The new font weight</param>
|
||||
/// <param name="fontWidth">The new font width</param>
|
||||
/// <param name="fontItalic">The new font italic</param>
|
||||
/// <param name="underline">The new underline style</param>
|
||||
/// <param name="strikeThrough">The new strike-through style</param>
|
||||
/// <param name="lineHeight">The new line height</param>
|
||||
/// <param name="textColor">The new text color</param>
|
||||
/// <param name="backgroundColor">The new background color</param>
|
||||
/// <param name="haloColor">The new halo color</param>
|
||||
/// <param name="haloWidth">The new halo width</param>
|
||||
/// <param name="haloBlur">The new halo blur width</param>
|
||||
/// <param name="letterSpacing">The new character spacing</param>
|
||||
/// <param name="fontVariant">The new font variant</param>
|
||||
/// <param name="textDirection">The new text direction</param>
|
||||
|
@ -67,12 +71,16 @@ namespace Topten.RichTextKit
|
|||
string fontFamily = null,
|
||||
float? fontSize = null,
|
||||
int? fontWeight = null,
|
||||
SKFontStyleWidth? fontWidth = null,
|
||||
bool? fontItalic = null,
|
||||
UnderlineStyle? underline = null,
|
||||
StrikeThroughStyle? strikeThrough = null,
|
||||
float? lineHeight = null,
|
||||
SKColor? textColor = null,
|
||||
SKColor? backgroundColor = null,
|
||||
SKColor? haloColor = null,
|
||||
float? haloWidth = null,
|
||||
float? haloBlur = null,
|
||||
float? letterSpacing = null,
|
||||
FontVariant? fontVariant = null,
|
||||
TextDirection? textDirection = null
|
||||
|
@ -85,12 +93,16 @@ namespace Topten.RichTextKit
|
|||
if (fontFamily != null) FontFamily(fontFamily);
|
||||
if (fontSize.HasValue) FontSize(fontSize.Value);
|
||||
if (fontWeight.HasValue) FontWeight(fontWeight.Value);
|
||||
if (fontWidth.HasValue) FontWidth(fontWidth.Value);
|
||||
if (fontItalic.HasValue) FontItalic(fontItalic.Value);
|
||||
if (underline.HasValue) Underline(underline.Value);
|
||||
if (strikeThrough.HasValue) StrikeThrough(strikeThrough.Value);
|
||||
if (lineHeight.HasValue) LineHeight(lineHeight.Value);
|
||||
if (textColor.HasValue) TextColor(textColor.Value);
|
||||
if (backgroundColor.HasValue) BackgroundColor(backgroundColor.Value);
|
||||
if (haloColor.HasValue) HaloColor(haloColor.Value);
|
||||
if (haloWidth.HasValue) HaloWidth(haloWidth.Value);
|
||||
if (haloBlur.HasValue) HaloBlur(haloBlur.Value);
|
||||
if (fontVariant.HasValue) FontVariant(fontVariant.Value);
|
||||
if (letterSpacing.HasValue) LetterSpacing(letterSpacing.Value);
|
||||
if (textDirection.HasValue) TextDirection(textDirection.Value);
|
||||
|
@ -129,6 +141,13 @@ namespace Topten.RichTextKit
|
|||
/// <returns>A reference to the same RichString instance</returns>
|
||||
public RichString Bold(bool value = true) => Append(new FontWeightItem(value ? 700 : 400));
|
||||
|
||||
/// <summary>
|
||||
/// Changes the font width
|
||||
/// </summary>
|
||||
/// <param name="value">The new font width</param>
|
||||
/// <returns>A reference to the same RichString instance</returns>
|
||||
public RichString FontWidth(SKFontStyleWidth value) => Append(new FontWidthItem(value));
|
||||
|
||||
/// <summary>
|
||||
/// Changes the font italic setting
|
||||
/// </summary>
|
||||
|
@ -171,6 +190,27 @@ namespace Topten.RichTextKit
|
|||
/// <returns>A reference to the same RichString instance</returns>
|
||||
public RichString BackgroundColor(SKColor value) => Append(new BackgroundColorItem(value));
|
||||
|
||||
/// <summary>
|
||||
/// Changes the halo color
|
||||
/// </summary>
|
||||
/// <param name="value">The new halo color</param>
|
||||
/// <returns>A reference to the same RichString instance</returns>
|
||||
public RichString HaloColor(SKColor value) => Append(new HaloColorItem(value));
|
||||
|
||||
/// <summary>
|
||||
/// Changes the halo width
|
||||
/// </summary>
|
||||
/// <param name="value">The new halo width</param>
|
||||
/// <returns>A reference to the same RichString instance</returns>
|
||||
public RichString HaloWidth(float value) => Append(new HaloWidthItem(value));
|
||||
|
||||
/// <summary>
|
||||
/// Changes the halo blur width
|
||||
/// </summary>
|
||||
/// <param name="value">The new halo blur width</param>
|
||||
/// <returns>A reference to the same RichString instance</returns>
|
||||
public RichString HaloBlur(float value) => Append(new HaloBlurItem(value));
|
||||
|
||||
/// <summary>
|
||||
/// Changes the character spacing
|
||||
/// </summary>
|
||||
|
@ -1100,6 +1140,21 @@ namespace Topten.RichTextKit
|
|||
}
|
||||
}
|
||||
|
||||
class FontWidthItem : Item
|
||||
{
|
||||
public FontWidthItem(SKFontStyleWidth value)
|
||||
{
|
||||
_value = value;
|
||||
}
|
||||
|
||||
SKFontStyleWidth _value;
|
||||
|
||||
public override void Build(BuildContext ctx)
|
||||
{
|
||||
ctx.StyleManager.FontWidth(_value);
|
||||
}
|
||||
}
|
||||
|
||||
class FontItalicItem : Item
|
||||
{
|
||||
public FontItalicItem(bool value)
|
||||
|
@ -1190,6 +1245,51 @@ namespace Topten.RichTextKit
|
|||
}
|
||||
}
|
||||
|
||||
class HaloColorItem : Item
|
||||
{
|
||||
public HaloColorItem(SKColor value)
|
||||
{
|
||||
_value = value;
|
||||
}
|
||||
|
||||
SKColor _value;
|
||||
|
||||
public override void Build(BuildContext ctx)
|
||||
{
|
||||
ctx.StyleManager.HaloColor(_value);
|
||||
}
|
||||
}
|
||||
|
||||
class HaloWidthItem : Item
|
||||
{
|
||||
public HaloWidthItem(float value)
|
||||
{
|
||||
_value = value;
|
||||
}
|
||||
|
||||
float _value;
|
||||
|
||||
public override void Build(BuildContext ctx)
|
||||
{
|
||||
ctx.StyleManager.HaloWidth(_value);
|
||||
}
|
||||
}
|
||||
|
||||
class HaloBlurItem : Item
|
||||
{
|
||||
public HaloBlurItem(float value)
|
||||
{
|
||||
_value = value;
|
||||
}
|
||||
|
||||
float _value;
|
||||
|
||||
public override void Build(BuildContext ctx)
|
||||
{
|
||||
ctx.StyleManager.HaloBlur(_value);
|
||||
}
|
||||
}
|
||||
|
||||
class LetterSpacingItem : Item
|
||||
{
|
||||
public LetterSpacingItem(float value)
|
||||
|
|
|
@ -67,6 +67,15 @@ namespace Topten.RichTextKit
|
|||
set { CheckNotSealed(); _fontWeight = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The font width for text in this run (defaults to WidthStyle.Normal).
|
||||
/// </summary>
|
||||
public SKFontStyleWidth FontWidth
|
||||
{
|
||||
get => _fontWidth;
|
||||
set { CheckNotSealed(); _fontWidth = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// True if the text in this run should be displayed in an italic
|
||||
/// font; otherwise False (defaults to false).
|
||||
|
@ -126,6 +135,45 @@ namespace Topten.RichTextKit
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Color of the halo
|
||||
/// </summary>
|
||||
public SKColor HaloColor
|
||||
{
|
||||
get => _haloColor;
|
||||
set
|
||||
{
|
||||
CheckNotSealed();
|
||||
_haloColor = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Width of halo
|
||||
/// </summary>
|
||||
public float HaloWidth
|
||||
{
|
||||
get => _haloWidth;
|
||||
set
|
||||
{
|
||||
CheckNotSealed();
|
||||
_haloWidth = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Blur of halo
|
||||
/// </summary>
|
||||
public float HaloBlur
|
||||
{
|
||||
get => _haloBlur;
|
||||
set
|
||||
{
|
||||
CheckNotSealed();
|
||||
_haloBlur = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The character spacing for text in this run (defaults to 0).
|
||||
/// </summary>
|
||||
|
@ -165,12 +213,16 @@ namespace Topten.RichTextKit
|
|||
string _fontFamily = "Arial";
|
||||
float _fontSize = 16;
|
||||
int _fontWeight = 400;
|
||||
SKFontStyleWidth _fontWidth = SKFontStyleWidth.Normal;
|
||||
bool _fontItalic;
|
||||
UnderlineStyle _underlineStyle;
|
||||
StrikeThroughStyle _strikeThrough;
|
||||
float _lineHeight = 1.0f;
|
||||
SKColor _textColor = new SKColor(0xFF000000);
|
||||
SKColor _backgroundColor = SKColor.Empty;
|
||||
SKColor _haloColor = SKColor.Empty;
|
||||
float _haloWidth = 0f;
|
||||
float _haloBlur = 0f;
|
||||
float _letterSpacing;
|
||||
FontVariant _fontVariant;
|
||||
TextDirection _textDirection = TextDirection.Auto;
|
||||
|
@ -187,12 +239,16 @@ namespace Topten.RichTextKit
|
|||
/// <param name="fontFamily">The new font family</param>
|
||||
/// <param name="fontSize">The new font size</param>
|
||||
/// <param name="fontWeight">The new font weight</param>
|
||||
/// <param name="fontWidth">The new font width</param>
|
||||
/// <param name="fontItalic">The new font italic</param>
|
||||
/// <param name="underline">The new underline style</param>
|
||||
/// <param name="strikeThrough">The new strike-through style</param>
|
||||
/// <param name="lineHeight">The new line height</param>
|
||||
/// <param name="textColor">The new text color</param>
|
||||
/// <param name="backgroundColor">The new background color</param>
|
||||
/// <param name="haloColor">Color of the halo background</param>
|
||||
/// <param name="haloBlur">Blur amount for the halo background</param>
|
||||
/// <param name="haloWidth">Width of the halo background</param>
|
||||
/// <param name="letterSpacing">The new letterSpacing</param>
|
||||
/// <param name="fontVariant">The new font variant</param>
|
||||
/// <param name="textDirection">The new text direction</param>
|
||||
|
@ -202,12 +258,16 @@ namespace Topten.RichTextKit
|
|||
string fontFamily = null,
|
||||
float? fontSize = null,
|
||||
int? fontWeight = null,
|
||||
SKFontStyleWidth? fontWidth = null,
|
||||
bool? fontItalic = null,
|
||||
UnderlineStyle? underline = null,
|
||||
StrikeThroughStyle? strikeThrough = null,
|
||||
float? lineHeight = null,
|
||||
SKColor? textColor = null,
|
||||
SKColor? backgroundColor = null,
|
||||
SKColor? haloColor = null,
|
||||
float? haloWidth = null,
|
||||
float? haloBlur = null,
|
||||
float? letterSpacing = null,
|
||||
FontVariant? fontVariant = null,
|
||||
TextDirection? textDirection = null,
|
||||
|
@ -220,12 +280,16 @@ namespace Topten.RichTextKit
|
|||
FontFamily = fontFamily ?? this.FontFamily,
|
||||
FontSize = fontSize ?? this.FontSize,
|
||||
FontWeight = fontWeight ?? this.FontWeight,
|
||||
FontWidth = fontWidth ?? this.FontWidth,
|
||||
FontItalic = fontItalic ?? this.FontItalic,
|
||||
Underline = underline ?? this.Underline,
|
||||
StrikeThrough = strikeThrough ?? this.StrikeThrough,
|
||||
LineHeight = lineHeight ?? this.LineHeight,
|
||||
TextColor = textColor ?? this.TextColor,
|
||||
BackgroundColor = backgroundColor ?? this.BackgroundColor,
|
||||
HaloColor = haloColor ?? this.HaloColor,
|
||||
HaloWidth = haloWidth ?? this.HaloWidth,
|
||||
HaloBlur = haloBlur ?? this.HaloBlur,
|
||||
LetterSpacing = letterSpacing ?? this.LetterSpacing,
|
||||
FontVariant = fontVariant ?? this.FontVariant,
|
||||
TextDirection = textDirection ?? this.TextDirection,
|
||||
|
|
|
@ -14,9 +14,7 @@
|
|||
// under the License.
|
||||
|
||||
using SkiaSharp;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
|
||||
namespace Topten.RichTextKit
|
||||
|
@ -82,8 +80,9 @@ namespace Topten.RichTextKit
|
|||
if (IsOwned(value))
|
||||
return value;
|
||||
|
||||
return Update(value.FontFamily, value.FontSize, value.FontWeight, value.FontItalic,
|
||||
return Update(value.FontFamily, value.FontSize, value.FontWeight, value.FontWidth, value.FontItalic,
|
||||
value.Underline, value.StrikeThrough, value.LineHeight, value.TextColor, value.BackgroundColor,
|
||||
value.HaloColor, value.HaloWidth, value.HaloBlur,
|
||||
value.LetterSpacing, value.FontVariant, value.TextDirection, value.ReplacementCharacter);
|
||||
}
|
||||
|
||||
|
@ -134,7 +133,6 @@ namespace Topten.RichTextKit
|
|||
/// <returns>An IStyle for the new style</returns>
|
||||
public IStyle FontWeight(int fontWeight) => Update(fontWeight: fontWeight);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Changes the font weight and returns an update IStyle (short cut to FontWeight)
|
||||
/// </summary>
|
||||
|
@ -142,6 +140,13 @@ namespace Topten.RichTextKit
|
|||
/// <returns>An IStyle for the new style</returns>
|
||||
public IStyle Bold(bool bold) => Update(fontWeight: bold ? 700 : 400);
|
||||
|
||||
/// <summary>
|
||||
/// Changes the font width and returns an updated IStyle
|
||||
/// </summary>
|
||||
/// <param name="fontWidth">The new font width</param>
|
||||
/// <returns>An IStyle for the new style</returns>
|
||||
public IStyle FontWidth(SKFontStyleWidth fontWidth) => Update(fontWidth: fontWidth);
|
||||
|
||||
/// <summary>
|
||||
/// Changes the font italic setting and returns an updated IStyle
|
||||
/// </summary>
|
||||
|
@ -184,6 +189,27 @@ namespace Topten.RichTextKit
|
|||
/// <returns>An IStyle for the new style</returns>
|
||||
public IStyle BackgroundColor(SKColor backgroundColor) => Update(backgroundColor: backgroundColor);
|
||||
|
||||
/// <summary>
|
||||
/// Changes the halo color and returns an updated IStyle
|
||||
/// </summary>
|
||||
/// <param name="haloColor">The new halo color</param>
|
||||
/// <returns>An IStyle for the new style</returns>
|
||||
public IStyle HaloColor(SKColor haloColor) => Update(haloColor: haloColor);
|
||||
|
||||
/// <summary>
|
||||
/// Changes the halo width and returns an updated IStyle
|
||||
/// </summary>
|
||||
/// <param name="haloWidth">The new halo width</param>
|
||||
/// <returns>An IStyle for the new style</returns>
|
||||
public IStyle HaloWidth(float haloWidth) => Update(haloWidth: haloWidth);
|
||||
|
||||
/// <summary>
|
||||
/// Changes the halo blur width and returns an updated IStyle
|
||||
/// </summary>
|
||||
/// <param name="haloBlur">The new halo blur width</param>
|
||||
/// <returns>An IStyle for the new style</returns>
|
||||
public IStyle HaloBlur(float haloBlur) => Update(haloBlur: haloBlur);
|
||||
|
||||
/// <summary>
|
||||
/// Changes the character spacing and returns an updated IStyle
|
||||
/// </summary>
|
||||
|
@ -220,12 +246,16 @@ namespace Topten.RichTextKit
|
|||
/// <param name="fontFamily">The new font family</param>
|
||||
/// <param name="fontSize">The new font size</param>
|
||||
/// <param name="fontWeight">The new font weight</param>
|
||||
/// <param name="fontWidth">The new font width</param>
|
||||
/// <param name="fontItalic">The new font italic</param>
|
||||
/// <param name="underline">The new underline style</param>
|
||||
/// <param name="strikeThrough">The new strike-through style</param>
|
||||
/// <param name="lineHeight">The new line height</param>
|
||||
/// <param name="textColor">The new text color</param>
|
||||
/// <param name="backgroundColor">The new text color</param>
|
||||
/// <param name="haloColor">The new text color</param>
|
||||
/// <param name="haloWidth">The new halo width</param>
|
||||
/// <param name="haloBlur">The new halo blur width</param>
|
||||
/// <param name="letterSpacing">The new letterSpacing</param>
|
||||
/// <param name="fontVariant">The new font variant</param>
|
||||
/// <param name="textDirection">The new text direction</param>
|
||||
|
@ -235,12 +265,16 @@ namespace Topten.RichTextKit
|
|||
string fontFamily = null,
|
||||
float? fontSize = null,
|
||||
int? fontWeight = null,
|
||||
SKFontStyleWidth? fontWidth = 0,
|
||||
bool? fontItalic = null,
|
||||
UnderlineStyle? underline = null,
|
||||
StrikeThroughStyle? strikeThrough = null,
|
||||
float? lineHeight = null,
|
||||
SKColor? textColor = null,
|
||||
SKColor? backgroundColor = null,
|
||||
SKColor? haloColor = null,
|
||||
float? haloWidth = null,
|
||||
float? haloBlur = null,
|
||||
float? letterSpacing = null,
|
||||
FontVariant? fontVariant = null,
|
||||
TextDirection? textDirection = null,
|
||||
|
@ -251,19 +285,23 @@ namespace Topten.RichTextKit
|
|||
var rFontFamily = fontFamily ?? _currentStyle.FontFamily;
|
||||
var rFontSize = fontSize ?? _currentStyle.FontSize;
|
||||
var rFontWeight = fontWeight ?? _currentStyle.FontWeight;
|
||||
var rFontWidth = fontWidth ?? _currentStyle.FontWidth;
|
||||
var rFontItalic = fontItalic ?? _currentStyle.FontItalic;
|
||||
var rUnderline = underline ?? _currentStyle.Underline;
|
||||
var rStrikeThrough = strikeThrough ?? _currentStyle.StrikeThrough;
|
||||
var rLineHeight = lineHeight ?? _currentStyle.LineHeight;
|
||||
var rTextColor = textColor ?? _currentStyle.TextColor;
|
||||
var rBackgroundColor = backgroundColor ?? _currentStyle.BackgroundColor;
|
||||
var rHaloColor = haloColor ?? _currentStyle.HaloColor;
|
||||
var rHaloWidth = haloWidth ?? _currentStyle.HaloWidth;
|
||||
var rHaloBlur = haloBlur ?? _currentStyle.HaloBlur;
|
||||
var rLetterSpacing = letterSpacing ?? _currentStyle.LetterSpacing;
|
||||
var rFontVariant = fontVariant ?? _currentStyle.FontVariant;
|
||||
var rTextDirection = textDirection ?? _currentStyle.TextDirection;
|
||||
var rReplacementCharacter = replacementCharacter ?? _currentStyle.ReplacementCharacter;
|
||||
|
||||
// Format key
|
||||
var key = $"{rFontFamily}.{rFontSize}.{rFontWeight}.{rFontItalic}.{rUnderline}.{rStrikeThrough}.{rLineHeight}.{rTextColor}.{rBackgroundColor}.{rLetterSpacing}.{rFontVariant}.{rTextDirection}.{rReplacementCharacter}";
|
||||
var key = $"{rFontFamily}.{rFontSize}.{rFontWeight}.{fontWidth}.{rFontItalic}.{rUnderline}.{rStrikeThrough}.{rLineHeight}.{rTextColor}.{rBackgroundColor}.{rHaloColor}.{rHaloWidth}.{rHaloBlur}.{rLetterSpacing}.{rFontVariant}.{rTextDirection}.{rReplacementCharacter}";
|
||||
|
||||
// Look up...
|
||||
if (!_styleMap.TryGetValue(key, out var style))
|
||||
|
@ -275,12 +313,16 @@ namespace Topten.RichTextKit
|
|||
FontFamily = rFontFamily,
|
||||
FontSize = rFontSize,
|
||||
FontWeight = rFontWeight,
|
||||
FontWidth = rFontWidth,
|
||||
FontItalic = rFontItalic,
|
||||
Underline = rUnderline,
|
||||
StrikeThrough = rStrikeThrough,
|
||||
LineHeight = rLineHeight,
|
||||
TextColor = rTextColor,
|
||||
BackgroundColor = rBackgroundColor,
|
||||
HaloColor = rHaloColor,
|
||||
HaloWidth = rHaloWidth,
|
||||
HaloBlur = rHaloBlur,
|
||||
LetterSpacing = rLetterSpacing,
|
||||
FontVariant = rFontVariant,
|
||||
TextDirection = rTextDirection,
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit b9566c713c39eeefc4415f8a0a03a881ee005d59
|
||||
Subproject commit d3370d7b53a8096333f31c448c989d9e26c1f993
|
|
@ -154,6 +154,10 @@ navTree:
|
|||
- text: FontSize|./ref/Topten.RichTextKit.IStyle.FontSize
|
||||
- text: FontVariant|./ref/Topten.RichTextKit.IStyle.FontVariant
|
||||
- text: FontWeight|./ref/Topten.RichTextKit.IStyle.FontWeight
|
||||
- text: FontWidth|./ref/Topten.RichTextKit.IStyle.FontWidth
|
||||
- text: HaloBlur|./ref/Topten.RichTextKit.IStyle.HaloBlur
|
||||
- text: HaloColor|./ref/Topten.RichTextKit.IStyle.HaloColor
|
||||
- text: HaloWidth|./ref/Topten.RichTextKit.IStyle.HaloWidth
|
||||
- text: LetterSpacing|./ref/Topten.RichTextKit.IStyle.LetterSpacing
|
||||
- text: LineHeight|./ref/Topten.RichTextKit.IStyle.LineHeight
|
||||
- text: ReplacementCharacter|./ref/Topten.RichTextKit.IStyle.ReplacementCharacter
|
||||
|
@ -201,7 +205,11 @@ navTree:
|
|||
- text: FontSize|./ref/Topten.RichTextKit.RichString.FontSize
|
||||
- text: FontVariant|./ref/Topten.RichTextKit.RichString.FontVariant
|
||||
- text: FontWeight|./ref/Topten.RichTextKit.RichString.FontWeight
|
||||
- text: FontWidth|./ref/Topten.RichTextKit.RichString.FontWidth
|
||||
- text: GetCaretInfo|./ref/Topten.RichTextKit.RichString.GetCaretInfo
|
||||
- text: HaloBlur|./ref/Topten.RichTextKit.RichString.HaloBlur
|
||||
- text: HaloColor|./ref/Topten.RichTextKit.RichString.HaloColor
|
||||
- text: HaloWidth|./ref/Topten.RichTextKit.RichString.HaloWidth
|
||||
- text: HitTest|./ref/Topten.RichTextKit.RichString.HitTest
|
||||
- text: LetterSpacing|./ref/Topten.RichTextKit.RichString.LetterSpacing
|
||||
- text: LineHeight|./ref/Topten.RichTextKit.RichString.LineHeight
|
||||
|
@ -233,6 +241,10 @@ navTree:
|
|||
- text: FontSize|./ref/Topten.RichTextKit.Style.FontSize
|
||||
- text: FontVariant|./ref/Topten.RichTextKit.Style.FontVariant
|
||||
- text: FontWeight|./ref/Topten.RichTextKit.Style.FontWeight
|
||||
- text: FontWidth|./ref/Topten.RichTextKit.Style.FontWidth
|
||||
- text: HaloBlur|./ref/Topten.RichTextKit.Style.HaloBlur
|
||||
- text: HaloColor|./ref/Topten.RichTextKit.Style.HaloColor
|
||||
- text: HaloWidth|./ref/Topten.RichTextKit.Style.HaloWidth
|
||||
- text: LetterSpacing|./ref/Topten.RichTextKit.Style.LetterSpacing
|
||||
- text: LineHeight|./ref/Topten.RichTextKit.Style.LineHeight
|
||||
- text: ReplacementCharacter|./ref/Topten.RichTextKit.Style.ReplacementCharacter
|
||||
|
@ -290,7 +302,11 @@ navTree:
|
|||
- text: FontSize|./ref/Topten.RichTextKit.StyleManager.FontSize
|
||||
- text: FontVariant|./ref/Topten.RichTextKit.StyleManager.FontVariant
|
||||
- text: FontWeight|./ref/Topten.RichTextKit.StyleManager.FontWeight
|
||||
- text: FontWidth|./ref/Topten.RichTextKit.StyleManager.FontWidth
|
||||
- text: FromStyle|./ref/Topten.RichTextKit.StyleManager.FromStyle
|
||||
- text: HaloBlur|./ref/Topten.RichTextKit.StyleManager.HaloBlur
|
||||
- text: HaloColor|./ref/Topten.RichTextKit.StyleManager.HaloColor
|
||||
- text: HaloWidth|./ref/Topten.RichTextKit.StyleManager.HaloWidth
|
||||
- text: LetterSpacing|./ref/Topten.RichTextKit.StyleManager.LetterSpacing
|
||||
- text: LineHeight|./ref/Topten.RichTextKit.StyleManager.LineHeight
|
||||
- text: Pop|./ref/Topten.RichTextKit.StyleManager.Pop
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
---
|
||||
title: "IStyle.FontWidth"
|
||||
isMarkdown: false
|
||||
import: "../.common.page"
|
||||
---
|
||||
|
||||
<h1 data-nav-secondary-text="Definition" id="definition">IStyle.FontWidth Property</h1>
|
||||
|
||||
|
||||
<p>
|
||||
<small>
|
||||
Assembly: Topten.RichTextKit.dll<br />
|
||||
Namespace: <a href="./../ref/Topten.RichTextKit">Topten.RichTextKit</a><br />
|
||||
|
||||
Declaring Type: <a href="./../ref/Topten.RichTextKit.IStyle">IStyle</a><br />
|
||||
</small>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<p>The font weight for text in this run.</p>
|
||||
|
||||
|
||||
<pre class="language-csharp"><code class="language-csharp">public SkiaSharp.SKFontStyleWidth FontWidth { get; }</code></pre>
|
||||
|
||||
|
||||
<h2 id="property-type">Property Type</h2> <table class="name-description">
|
||||
<tr>
|
||||
<td>SkiaSharp.SKFontStyleWidth</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
---
|
||||
title: "IStyle.HaloBlur"
|
||||
isMarkdown: false
|
||||
import: "../.common.page"
|
||||
---
|
||||
|
||||
<h1 data-nav-secondary-text="Definition" id="definition">IStyle.HaloBlur Property</h1>
|
||||
|
||||
|
||||
<p>
|
||||
<small>
|
||||
Assembly: Topten.RichTextKit.dll<br />
|
||||
Namespace: <a href="./../ref/Topten.RichTextKit">Topten.RichTextKit</a><br />
|
||||
|
||||
Declaring Type: <a href="./../ref/Topten.RichTextKit.IStyle">IStyle</a><br />
|
||||
</small>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<p>Blur of halo</p>
|
||||
|
||||
|
||||
<pre class="language-csharp"><code class="language-csharp">public float HaloBlur { get; }</code></pre>
|
||||
|
||||
|
||||
<h2 id="property-type">Property Type</h2> <table class="name-description">
|
||||
<tr>
|
||||
<td><a href="https://docs.microsoft.com/dotnet/api/System.Single">float</a></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
---
|
||||
title: "IStyle.HaloColor"
|
||||
isMarkdown: false
|
||||
import: "../.common.page"
|
||||
---
|
||||
|
||||
<h1 data-nav-secondary-text="Definition" id="definition">IStyle.HaloColor Property</h1>
|
||||
|
||||
|
||||
<p>
|
||||
<small>
|
||||
Assembly: Topten.RichTextKit.dll<br />
|
||||
Namespace: <a href="./../ref/Topten.RichTextKit">Topten.RichTextKit</a><br />
|
||||
|
||||
Declaring Type: <a href="./../ref/Topten.RichTextKit.IStyle">IStyle</a><br />
|
||||
</small>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<p>Color of the halo</p>
|
||||
|
||||
|
||||
<pre class="language-csharp"><code class="language-csharp">public SkiaSharp.SKColor HaloColor { get; }</code></pre>
|
||||
|
||||
|
||||
<h2 id="property-type">Property Type</h2> <table class="name-description">
|
||||
<tr>
|
||||
<td>SkiaSharp.SKColor</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
---
|
||||
title: "IStyle.HaloWidth"
|
||||
isMarkdown: false
|
||||
import: "../.common.page"
|
||||
---
|
||||
|
||||
<h1 data-nav-secondary-text="Definition" id="definition">IStyle.HaloWidth Property</h1>
|
||||
|
||||
|
||||
<p>
|
||||
<small>
|
||||
Assembly: Topten.RichTextKit.dll<br />
|
||||
Namespace: <a href="./../ref/Topten.RichTextKit">Topten.RichTextKit</a><br />
|
||||
|
||||
Declaring Type: <a href="./../ref/Topten.RichTextKit.IStyle">IStyle</a><br />
|
||||
</small>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<p>Width of halo</p>
|
||||
|
||||
|
||||
<pre class="language-csharp"><code class="language-csharp">public float HaloWidth { get; }</code></pre>
|
||||
|
||||
|
||||
<h2 id="property-type">Property Type</h2> <table class="name-description">
|
||||
<tr>
|
||||
<td><a href="https://docs.microsoft.com/dotnet/api/System.Single">float</a></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -63,6 +63,26 @@ font; otherwise False.</p>
|
|||
<tr>
|
||||
<td><a href="./../ref/Topten.RichTextKit.IStyle.FontWeight">FontWeight</a></td>
|
||||
<td><p>The font weight for text in this run.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="./../ref/Topten.RichTextKit.IStyle.FontWidth">FontWidth</a></td>
|
||||
<td><p>The font weight for text in this run.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="./../ref/Topten.RichTextKit.IStyle.HaloBlur">HaloBlur</a></td>
|
||||
<td><p>Blur of halo</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="./../ref/Topten.RichTextKit.IStyle.HaloColor">HaloColor</a></td>
|
||||
<td><p>Color of the halo</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="./../ref/Topten.RichTextKit.IStyle.HaloWidth">HaloWidth</a></td>
|
||||
<td><p>Width of halo</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
|
|
@ -28,7 +28,7 @@ import: "../.common.page"
|
|||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="#Topten.RichTextKit-RichString.Add-System-String-System-String-System-Nullable-System-Single--System-Nullable-System-Int32--System-Nullable-System-Boolean--System-Nullable-Topten.RichTextKit-UnderlineStyle--System-Nullable-Topten.RichTextKit-StrikeThroughStyle--System-Nullable-System-Single--System-Nullable-SkiaSharp-SKColor--System-Nullable-SkiaSharp-SKColor--System-Nullable-System-Single--System-Nullable-Topten.RichTextKit-FontVariant--System-Nullable-Topten.RichTextKit-TextDirection-">Add(string, string, Nullable<float>, Nullable<int>, Nullable<bool>, Nullable<UnderlineStyle>, Nullable<StrikeThroughStyle>, Nullable<float>, Nullable<SkiaSharp.SKColor>, Nullable<SkiaSharp.SKColor>, Nullable<float>, Nullable<FontVariant>, Nullable<TextDirection>)</a></td>
|
||||
<td><a href="#Topten.RichTextKit-RichString.Add-System-String-System-String-System-Nullable-System-Single--System-Nullable-System-Int32--System-Nullable-SkiaSharp-SKFontStyleWidth--System-Nullable-System-Boolean--System-Nullable-Topten.RichTextKit-UnderlineStyle--System-Nullable-Topten.RichTextKit-StrikeThroughStyle--System-Nullable-System-Single--System-Nullable-SkiaSharp-SKColor--System-Nullable-SkiaSharp-SKColor--System-Nullable-SkiaSharp-SKColor--System-Nullable-System-Single--System-Nullable-System-Single--System-Nullable-System-Single--System-Nullable-Topten.RichTextKit-FontVariant--System-Nullable-Topten.RichTextKit-TextDirection-">Add(string, string, Nullable<float>, Nullable<int>, Nullable<SkiaSharp.SKFontStyleWidth>, Nullable<bool>, Nullable<UnderlineStyle>, Nullable<StrikeThroughStyle>, Nullable<float>, Nullable<SkiaSharp.SKColor>, Nullable<SkiaSharp.SKColor>, Nullable<SkiaSharp.SKColor>, Nullable<float>, Nullable<float>, Nullable<float>, Nullable<FontVariant>, Nullable<TextDirection>)</a></td>
|
||||
<td><p>Adds text with various style attributes changed</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -63,12 +63,12 @@ import: "../.common.page"
|
|||
|
||||
|
||||
|
||||
<h2 id="Topten.RichTextKit-RichString.Add-System-String-System-String-System-Nullable-System-Single--System-Nullable-System-Int32--System-Nullable-System-Boolean--System-Nullable-Topten.RichTextKit-UnderlineStyle--System-Nullable-Topten.RichTextKit-StrikeThroughStyle--System-Nullable-System-Single--System-Nullable-SkiaSharp-SKColor--System-Nullable-SkiaSharp-SKColor--System-Nullable-System-Single--System-Nullable-Topten.RichTextKit-FontVariant--System-Nullable-Topten.RichTextKit-TextDirection-">Add(string, string, Nullable<float>, Nullable<int>, Nullable<bool>, Nullable<UnderlineStyle>, Nullable<StrikeThroughStyle>, Nullable<float>, Nullable<SkiaSharp.SKColor>, Nullable<SkiaSharp.SKColor>, Nullable<float>, Nullable<FontVariant>, Nullable<TextDirection>)</h2>
|
||||
<h2 id="Topten.RichTextKit-RichString.Add-System-String-System-String-System-Nullable-System-Single--System-Nullable-System-Int32--System-Nullable-SkiaSharp-SKFontStyleWidth--System-Nullable-System-Boolean--System-Nullable-Topten.RichTextKit-UnderlineStyle--System-Nullable-Topten.RichTextKit-StrikeThroughStyle--System-Nullable-System-Single--System-Nullable-SkiaSharp-SKColor--System-Nullable-SkiaSharp-SKColor--System-Nullable-SkiaSharp-SKColor--System-Nullable-System-Single--System-Nullable-System-Single--System-Nullable-System-Single--System-Nullable-Topten.RichTextKit-FontVariant--System-Nullable-Topten.RichTextKit-TextDirection-">Add(string, string, Nullable<float>, Nullable<int>, Nullable<SkiaSharp.SKFontStyleWidth>, Nullable<bool>, Nullable<UnderlineStyle>, Nullable<StrikeThroughStyle>, Nullable<float>, Nullable<SkiaSharp.SKColor>, Nullable<SkiaSharp.SKColor>, Nullable<SkiaSharp.SKColor>, Nullable<float>, Nullable<float>, Nullable<float>, Nullable<FontVariant>, Nullable<TextDirection>)</h2>
|
||||
|
||||
<p>Adds text with various style attributes changed</p>
|
||||
|
||||
|
||||
<pre class="language-csharp"><code class="language-csharp">public RichString Add(string text, string fontFamily = null, Nullable<float> fontSize = null, Nullable<int> fontWeight = null, Nullable<bool> fontItalic = null, Nullable<UnderlineStyle> underline = null, Nullable<StrikeThroughStyle> strikeThrough = null, Nullable<float> lineHeight = null, Nullable<SkiaSharp.SKColor> textColor = null, Nullable<SkiaSharp.SKColor> backgroundColor = null, Nullable<float> letterSpacing = null, Nullable<FontVariant> fontVariant = null, Nullable<TextDirection> textDirection = null);</code></pre>
|
||||
<pre class="language-csharp"><code class="language-csharp">public RichString Add(string text, string fontFamily = null, Nullable<float> fontSize = null, Nullable<int> fontWeight = null, Nullable<SkiaSharp.SKFontStyleWidth> fontWidth = null, Nullable<bool> fontItalic = null, Nullable<UnderlineStyle> underline = null, Nullable<StrikeThroughStyle> strikeThrough = null, Nullable<float> lineHeight = null, Nullable<SkiaSharp.SKColor> textColor = null, Nullable<SkiaSharp.SKColor> backgroundColor = null, Nullable<SkiaSharp.SKColor> haloColor = null, Nullable<float> haloWidth = null, Nullable<float> haloBlur = null, Nullable<float> letterSpacing = null, Nullable<FontVariant> fontVariant = null, Nullable<TextDirection> textDirection = null);</code></pre>
|
||||
|
||||
|
||||
<h3>Parameters</h3> <table class="name-description">
|
||||
|
@ -107,6 +107,14 @@ import: "../.common.page"
|
|||
<tr>
|
||||
<td>
|
||||
|
||||
<a href="https://docs.microsoft.com/dotnet/api/System.Nullable-1">Nullable<SkiaSharp.SKFontStyleWidth></a> fontWidth
|
||||
= null </td>
|
||||
<td><p>The new font width</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
<a href="https://docs.microsoft.com/dotnet/api/System.Nullable-1">Nullable<bool></a> fontItalic
|
||||
= null </td>
|
||||
<td><p>The new font italic</p>
|
||||
|
@ -155,6 +163,30 @@ import: "../.common.page"
|
|||
<tr>
|
||||
<td>
|
||||
|
||||
<a href="https://docs.microsoft.com/dotnet/api/System.Nullable-1">Nullable<SkiaSharp.SKColor></a> haloColor
|
||||
= null </td>
|
||||
<td><p>The new halo color</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
<a href="https://docs.microsoft.com/dotnet/api/System.Nullable-1">Nullable<float></a> haloWidth
|
||||
= null </td>
|
||||
<td><p>The new halo width</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
<a href="https://docs.microsoft.com/dotnet/api/System.Nullable-1">Nullable<float></a> haloBlur
|
||||
= null </td>
|
||||
<td><p>The new halo blur width</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
<a href="https://docs.microsoft.com/dotnet/api/System.Nullable-1">Nullable<float></a> letterSpacing
|
||||
= null </td>
|
||||
<td><p>The new character spacing</p>
|
||||
|
|
|
@ -0,0 +1,55 @@
|
|||
---
|
||||
title: "RichString.FontWidth"
|
||||
isMarkdown: false
|
||||
import: "../.common.page"
|
||||
---
|
||||
|
||||
<h1 data-nav-secondary-text="Definition" id="definition">RichString.FontWidth Method</h1>
|
||||
|
||||
|
||||
<p>
|
||||
<small>
|
||||
Assembly: Topten.RichTextKit.dll<br />
|
||||
Namespace: <a href="./../ref/Topten.RichTextKit">Topten.RichTextKit</a><br />
|
||||
|
||||
Declaring Type: <a href="./../ref/Topten.RichTextKit.RichString">RichString</a><br />
|
||||
</small>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p>Changes the font width</p>
|
||||
|
||||
|
||||
<pre class="language-csharp"><code class="language-csharp">public RichString FontWidth(SkiaSharp.SKFontStyleWidth value);</code></pre>
|
||||
|
||||
|
||||
<h2 id="parameters">Parameters</h2> <table class="name-description">
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
SkiaSharp.SKFontStyleWidth value
|
||||
</td>
|
||||
<td><p>The new font width</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2 id="returns">Returns</h2> <table class="name-description">
|
||||
<tr>
|
||||
<td><a href="./../ref/Topten.RichTextKit.RichString">RichString</a></td>
|
||||
<td><p>A reference to the same RichString instance</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
---
|
||||
title: "RichString.HaloBlur"
|
||||
isMarkdown: false
|
||||
import: "../.common.page"
|
||||
---
|
||||
|
||||
<h1 data-nav-secondary-text="Definition" id="definition">RichString.HaloBlur Method</h1>
|
||||
|
||||
|
||||
<p>
|
||||
<small>
|
||||
Assembly: Topten.RichTextKit.dll<br />
|
||||
Namespace: <a href="./../ref/Topten.RichTextKit">Topten.RichTextKit</a><br />
|
||||
|
||||
Declaring Type: <a href="./../ref/Topten.RichTextKit.RichString">RichString</a><br />
|
||||
</small>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p>Changes the halo blur width</p>
|
||||
|
||||
|
||||
<pre class="language-csharp"><code class="language-csharp">public RichString HaloBlur(float value);</code></pre>
|
||||
|
||||
|
||||
<h2 id="parameters">Parameters</h2> <table class="name-description">
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
<a href="https://docs.microsoft.com/dotnet/api/System.Single">float</a> value
|
||||
</td>
|
||||
<td><p>The new halo blur width</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2 id="returns">Returns</h2> <table class="name-description">
|
||||
<tr>
|
||||
<td><a href="./../ref/Topten.RichTextKit.RichString">RichString</a></td>
|
||||
<td><p>A reference to the same RichString instance</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
---
|
||||
title: "RichString.HaloColor"
|
||||
isMarkdown: false
|
||||
import: "../.common.page"
|
||||
---
|
||||
|
||||
<h1 data-nav-secondary-text="Definition" id="definition">RichString.HaloColor Method</h1>
|
||||
|
||||
|
||||
<p>
|
||||
<small>
|
||||
Assembly: Topten.RichTextKit.dll<br />
|
||||
Namespace: <a href="./../ref/Topten.RichTextKit">Topten.RichTextKit</a><br />
|
||||
|
||||
Declaring Type: <a href="./../ref/Topten.RichTextKit.RichString">RichString</a><br />
|
||||
</small>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p>Changes the halo color</p>
|
||||
|
||||
|
||||
<pre class="language-csharp"><code class="language-csharp">public RichString HaloColor(SkiaSharp.SKColor value);</code></pre>
|
||||
|
||||
|
||||
<h2 id="parameters">Parameters</h2> <table class="name-description">
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
SkiaSharp.SKColor value
|
||||
</td>
|
||||
<td><p>The new halo color</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2 id="returns">Returns</h2> <table class="name-description">
|
||||
<tr>
|
||||
<td><a href="./../ref/Topten.RichTextKit.RichString">RichString</a></td>
|
||||
<td><p>A reference to the same RichString instance</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
---
|
||||
title: "RichString.HaloWidth"
|
||||
isMarkdown: false
|
||||
import: "../.common.page"
|
||||
---
|
||||
|
||||
<h1 data-nav-secondary-text="Definition" id="definition">RichString.HaloWidth Method</h1>
|
||||
|
||||
|
||||
<p>
|
||||
<small>
|
||||
Assembly: Topten.RichTextKit.dll<br />
|
||||
Namespace: <a href="./../ref/Topten.RichTextKit">Topten.RichTextKit</a><br />
|
||||
|
||||
Declaring Type: <a href="./../ref/Topten.RichTextKit.RichString">RichString</a><br />
|
||||
</small>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p>Changes the halo width</p>
|
||||
|
||||
|
||||
<pre class="language-csharp"><code class="language-csharp">public RichString HaloWidth(float value);</code></pre>
|
||||
|
||||
|
||||
<h2 id="parameters">Parameters</h2> <table class="name-description">
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
<a href="https://docs.microsoft.com/dotnet/api/System.Single">float</a> value
|
||||
</td>
|
||||
<td><p>The new halo width</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2 id="returns">Returns</h2> <table class="name-description">
|
||||
<tr>
|
||||
<td><a href="./../ref/Topten.RichTextKit.RichString">RichString</a></td>
|
||||
<td><p>A reference to the same RichString instance</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -130,7 +130,7 @@ constraints</p>
|
|||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="./../ref/Topten.RichTextKit.RichString.Add#Topten.RichTextKit-RichString.Add-System-String-System-String-System-Nullable-System-Single--System-Nullable-System-Int32--System-Nullable-System-Boolean--System-Nullable-Topten.RichTextKit-UnderlineStyle--System-Nullable-Topten.RichTextKit-StrikeThroughStyle--System-Nullable-System-Single--System-Nullable-SkiaSharp-SKColor--System-Nullable-SkiaSharp-SKColor--System-Nullable-System-Single--System-Nullable-Topten.RichTextKit-FontVariant--System-Nullable-Topten.RichTextKit-TextDirection-">Add(string, string, Nullable<float>, Nullable<int>, Nullable<bool>, Nullable<UnderlineStyle>, Nullable<StrikeThroughStyle>, Nullable<float>, Nullable<SkiaSharp.SKColor>, Nullable<SkiaSharp.SKColor>, Nullable<float>, Nullable<FontVariant>, Nullable<TextDirection>)</a></td>
|
||||
<td><a href="./../ref/Topten.RichTextKit.RichString.Add#Topten.RichTextKit-RichString.Add-System-String-System-String-System-Nullable-System-Single--System-Nullable-System-Int32--System-Nullable-SkiaSharp-SKFontStyleWidth--System-Nullable-System-Boolean--System-Nullable-Topten.RichTextKit-UnderlineStyle--System-Nullable-Topten.RichTextKit-StrikeThroughStyle--System-Nullable-System-Single--System-Nullable-SkiaSharp-SKColor--System-Nullable-SkiaSharp-SKColor--System-Nullable-SkiaSharp-SKColor--System-Nullable-System-Single--System-Nullable-System-Single--System-Nullable-System-Single--System-Nullable-Topten.RichTextKit-FontVariant--System-Nullable-Topten.RichTextKit-TextDirection-">Add(string, string, Nullable<float>, Nullable<int>, Nullable<SkiaSharp.SKFontStyleWidth>, Nullable<bool>, Nullable<UnderlineStyle>, Nullable<StrikeThroughStyle>, Nullable<float>, Nullable<SkiaSharp.SKColor>, Nullable<SkiaSharp.SKColor>, Nullable<SkiaSharp.SKColor>, Nullable<float>, Nullable<float>, Nullable<float>, Nullable<FontVariant>, Nullable<TextDirection>)</a></td>
|
||||
<td><p>Adds text with various style attributes changed</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -182,11 +182,31 @@ constraints</p>
|
|||
<tr>
|
||||
<td><a href="./../ref/Topten.RichTextKit.RichString.FontWeight">FontWeight(int)</a></td>
|
||||
<td><p>Changes the font weight</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="./../ref/Topten.RichTextKit.RichString.FontWidth">FontWidth(SkiaSharp.SKFontStyleWidth)</a></td>
|
||||
<td><p>Changes the font width</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="./../ref/Topten.RichTextKit.RichString.GetCaretInfo">GetCaretInfo(CaretPosition)</a></td>
|
||||
<td><p>Calculates useful information for displaying a caret</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="./../ref/Topten.RichTextKit.RichString.HaloBlur">HaloBlur(float)</a></td>
|
||||
<td><p>Changes the halo blur width</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="./../ref/Topten.RichTextKit.RichString.HaloColor">HaloColor(SkiaSharp.SKColor)</a></td>
|
||||
<td><p>Changes the halo color</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="./../ref/Topten.RichTextKit.RichString.HaloWidth">HaloWidth(float)</a></td>
|
||||
<td><p>Changes the halo width</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
---
|
||||
title: "Style.FontWidth"
|
||||
isMarkdown: false
|
||||
import: "../.common.page"
|
||||
---
|
||||
|
||||
<h1 data-nav-secondary-text="Definition" id="definition">Style.FontWidth Property</h1>
|
||||
|
||||
|
||||
<p>
|
||||
<small>
|
||||
Assembly: Topten.RichTextKit.dll<br />
|
||||
Namespace: <a href="./../ref/Topten.RichTextKit">Topten.RichTextKit</a><br />
|
||||
|
||||
Declaring Type: <a href="./../ref/Topten.RichTextKit.Style">Style</a><br />
|
||||
</small>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<p>The font width for text in this run (defaults to WidthStyle.Normal).</p>
|
||||
|
||||
|
||||
<pre class="language-csharp"><code class="language-csharp">public SkiaSharp.SKFontStyleWidth FontWidth { sealed get; set; }</code></pre>
|
||||
|
||||
|
||||
<h2 id="property-type">Property Type</h2> <table class="name-description">
|
||||
<tr>
|
||||
<td>SkiaSharp.SKFontStyleWidth</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
---
|
||||
title: "Style.HaloBlur"
|
||||
isMarkdown: false
|
||||
import: "../.common.page"
|
||||
---
|
||||
|
||||
<h1 data-nav-secondary-text="Definition" id="definition">Style.HaloBlur Property</h1>
|
||||
|
||||
|
||||
<p>
|
||||
<small>
|
||||
Assembly: Topten.RichTextKit.dll<br />
|
||||
Namespace: <a href="./../ref/Topten.RichTextKit">Topten.RichTextKit</a><br />
|
||||
|
||||
Declaring Type: <a href="./../ref/Topten.RichTextKit.Style">Style</a><br />
|
||||
</small>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<p>Blur of halo</p>
|
||||
|
||||
|
||||
<pre class="language-csharp"><code class="language-csharp">public float HaloBlur { sealed get; set; }</code></pre>
|
||||
|
||||
|
||||
<h2 id="property-type">Property Type</h2> <table class="name-description">
|
||||
<tr>
|
||||
<td><a href="https://docs.microsoft.com/dotnet/api/System.Single">float</a></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
---
|
||||
title: "Style.HaloColor"
|
||||
isMarkdown: false
|
||||
import: "../.common.page"
|
||||
---
|
||||
|
||||
<h1 data-nav-secondary-text="Definition" id="definition">Style.HaloColor Property</h1>
|
||||
|
||||
|
||||
<p>
|
||||
<small>
|
||||
Assembly: Topten.RichTextKit.dll<br />
|
||||
Namespace: <a href="./../ref/Topten.RichTextKit">Topten.RichTextKit</a><br />
|
||||
|
||||
Declaring Type: <a href="./../ref/Topten.RichTextKit.Style">Style</a><br />
|
||||
</small>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<p>Color of the halo</p>
|
||||
|
||||
|
||||
<pre class="language-csharp"><code class="language-csharp">public SkiaSharp.SKColor HaloColor { sealed get; set; }</code></pre>
|
||||
|
||||
|
||||
<h2 id="property-type">Property Type</h2> <table class="name-description">
|
||||
<tr>
|
||||
<td>SkiaSharp.SKColor</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
---
|
||||
title: "Style.HaloWidth"
|
||||
isMarkdown: false
|
||||
import: "../.common.page"
|
||||
---
|
||||
|
||||
<h1 data-nav-secondary-text="Definition" id="definition">Style.HaloWidth Property</h1>
|
||||
|
||||
|
||||
<p>
|
||||
<small>
|
||||
Assembly: Topten.RichTextKit.dll<br />
|
||||
Namespace: <a href="./../ref/Topten.RichTextKit">Topten.RichTextKit</a><br />
|
||||
|
||||
Declaring Type: <a href="./../ref/Topten.RichTextKit.Style">Style</a><br />
|
||||
</small>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<p>Width of halo</p>
|
||||
|
||||
|
||||
<pre class="language-csharp"><code class="language-csharp">public float HaloWidth { sealed get; set; }</code></pre>
|
||||
|
||||
|
||||
<h2 id="property-type">Property Type</h2> <table class="name-description">
|
||||
<tr>
|
||||
<td><a href="https://docs.microsoft.com/dotnet/api/System.Single">float</a></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -26,7 +26,7 @@ import: "../.common.page"
|
|||
<p>Modifies this style with one or more attribute changes and returns a new style</p>
|
||||
|
||||
|
||||
<pre class="language-csharp"><code class="language-csharp">public Style Modify(string fontFamily = null, Nullable<float> fontSize = null, Nullable<int> fontWeight = null, Nullable<bool> fontItalic = null, Nullable<UnderlineStyle> underline = null, Nullable<StrikeThroughStyle> strikeThrough = null, Nullable<float> lineHeight = null, Nullable<SkiaSharp.SKColor> textColor = null, Nullable<SkiaSharp.SKColor> backgroundColor = null, Nullable<float> letterSpacing = null, Nullable<FontVariant> fontVariant = null, Nullable<TextDirection> textDirection = null, Nullable<char> replacementCharacter = null);</code></pre>
|
||||
<pre class="language-csharp"><code class="language-csharp">public Style Modify(string fontFamily = null, Nullable<float> fontSize = null, Nullable<int> fontWeight = null, Nullable<SkiaSharp.SKFontStyleWidth> fontWidth = null, Nullable<bool> fontItalic = null, Nullable<UnderlineStyle> underline = null, Nullable<StrikeThroughStyle> strikeThrough = null, Nullable<float> lineHeight = null, Nullable<SkiaSharp.SKColor> textColor = null, Nullable<SkiaSharp.SKColor> backgroundColor = null, Nullable<SkiaSharp.SKColor> haloColor = null, Nullable<float> haloWidth = null, Nullable<float> haloBlur = null, Nullable<float> letterSpacing = null, Nullable<FontVariant> fontVariant = null, Nullable<TextDirection> textDirection = null, Nullable<char> replacementCharacter = null);</code></pre>
|
||||
|
||||
<h2 id="remarks">Remarks</h2><p>Note this method always creates a new style instance.To avoid creating excessive
|
||||
style instances, consider using the StyleManager which caches instances of styles
|
||||
|
@ -60,6 +60,14 @@ with the same attributes</p>
|
|||
<tr>
|
||||
<td>
|
||||
|
||||
<a href="https://docs.microsoft.com/dotnet/api/System.Nullable-1">Nullable<SkiaSharp.SKFontStyleWidth></a> fontWidth
|
||||
= null </td>
|
||||
<td><p>The new font width</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
<a href="https://docs.microsoft.com/dotnet/api/System.Nullable-1">Nullable<bool></a> fontItalic
|
||||
= null </td>
|
||||
<td><p>The new font italic</p>
|
||||
|
@ -108,6 +116,30 @@ with the same attributes</p>
|
|||
<tr>
|
||||
<td>
|
||||
|
||||
<a href="https://docs.microsoft.com/dotnet/api/System.Nullable-1">Nullable<SkiaSharp.SKColor></a> haloColor
|
||||
= null </td>
|
||||
<td><p>Color of the halo background</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
<a href="https://docs.microsoft.com/dotnet/api/System.Nullable-1">Nullable<float></a> haloWidth
|
||||
= null </td>
|
||||
<td><p>Width of the halo background</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
<a href="https://docs.microsoft.com/dotnet/api/System.Nullable-1">Nullable<float></a> haloBlur
|
||||
= null </td>
|
||||
<td><p>Blur amount for the halo background</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
<a href="https://docs.microsoft.com/dotnet/api/System.Nullable-1">Nullable<float></a> letterSpacing
|
||||
= null </td>
|
||||
<td><p>The new letterSpacing</p>
|
||||
|
|
|
@ -75,6 +75,26 @@ font; otherwise False (defaults to false).</p>
|
|||
<tr>
|
||||
<td><a href="./../ref/Topten.RichTextKit.Style.FontWeight">FontWeight</a></td>
|
||||
<td><p>The font weight for text in this run (defaults to 400).</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="./../ref/Topten.RichTextKit.Style.FontWidth">FontWidth</a></td>
|
||||
<td><p>The font width for text in this run (defaults to WidthStyle.Normal).</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="./../ref/Topten.RichTextKit.Style.HaloBlur">HaloBlur</a></td>
|
||||
<td><p>Blur of halo</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="./../ref/Topten.RichTextKit.Style.HaloColor">HaloColor</a></td>
|
||||
<td><p>Color of the halo</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="./../ref/Topten.RichTextKit.Style.HaloWidth">HaloWidth</a></td>
|
||||
<td><p>Width of halo</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -117,7 +137,7 @@ font; otherwise False (defaults to false).</p>
|
|||
<h2 id="methods">Methods</h2>
|
||||
<table class="name-description">
|
||||
<tr>
|
||||
<td><a href="./../ref/Topten.RichTextKit.Style.Modify">Modify(string, Nullable<float>, Nullable<int>, Nullable<bool>, Nullable<UnderlineStyle>, Nullable<StrikeThroughStyle>, Nullable<float>, Nullable<SkiaSharp.SKColor>, Nullable<SkiaSharp.SKColor>, Nullable<float>, Nullable<FontVariant>, Nullable<TextDirection>, Nullable<char>)</a></td>
|
||||
<td><a href="./../ref/Topten.RichTextKit.Style.Modify">Modify(string, Nullable<float>, Nullable<int>, Nullable<SkiaSharp.SKFontStyleWidth>, Nullable<bool>, Nullable<UnderlineStyle>, Nullable<StrikeThroughStyle>, Nullable<float>, Nullable<SkiaSharp.SKColor>, Nullable<SkiaSharp.SKColor>, Nullable<SkiaSharp.SKColor>, Nullable<float>, Nullable<float>, Nullable<float>, Nullable<FontVariant>, Nullable<TextDirection>, Nullable<char>)</a></td>
|
||||
<td><p>Modifies this style with one or more attribute changes and returns a new style</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -0,0 +1,55 @@
|
|||
---
|
||||
title: "StyleManager.FontWidth"
|
||||
isMarkdown: false
|
||||
import: "../.common.page"
|
||||
---
|
||||
|
||||
<h1 data-nav-secondary-text="Definition" id="definition">StyleManager.FontWidth Method</h1>
|
||||
|
||||
|
||||
<p>
|
||||
<small>
|
||||
Assembly: Topten.RichTextKit.dll<br />
|
||||
Namespace: <a href="./../ref/Topten.RichTextKit">Topten.RichTextKit</a><br />
|
||||
|
||||
Declaring Type: <a href="./../ref/Topten.RichTextKit.StyleManager">StyleManager</a><br />
|
||||
</small>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p>Changes the font width and returns an updated IStyle</p>
|
||||
|
||||
|
||||
<pre class="language-csharp"><code class="language-csharp">public IStyle FontWidth(SkiaSharp.SKFontStyleWidth fontWidth);</code></pre>
|
||||
|
||||
|
||||
<h2 id="parameters">Parameters</h2> <table class="name-description">
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
SkiaSharp.SKFontStyleWidth fontWidth
|
||||
</td>
|
||||
<td><p>The new font width</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2 id="returns">Returns</h2> <table class="name-description">
|
||||
<tr>
|
||||
<td><a href="./../ref/Topten.RichTextKit.IStyle">IStyle</a></td>
|
||||
<td><p>An IStyle for the new style</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
---
|
||||
title: "StyleManager.HaloBlur"
|
||||
isMarkdown: false
|
||||
import: "../.common.page"
|
||||
---
|
||||
|
||||
<h1 data-nav-secondary-text="Definition" id="definition">StyleManager.HaloBlur Method</h1>
|
||||
|
||||
|
||||
<p>
|
||||
<small>
|
||||
Assembly: Topten.RichTextKit.dll<br />
|
||||
Namespace: <a href="./../ref/Topten.RichTextKit">Topten.RichTextKit</a><br />
|
||||
|
||||
Declaring Type: <a href="./../ref/Topten.RichTextKit.StyleManager">StyleManager</a><br />
|
||||
</small>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p>Changes the halo blur width and returns an updated IStyle</p>
|
||||
|
||||
|
||||
<pre class="language-csharp"><code class="language-csharp">public IStyle HaloBlur(float haloBlur);</code></pre>
|
||||
|
||||
|
||||
<h2 id="parameters">Parameters</h2> <table class="name-description">
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
<a href="https://docs.microsoft.com/dotnet/api/System.Single">float</a> haloBlur
|
||||
</td>
|
||||
<td><p>The new halo blur width</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2 id="returns">Returns</h2> <table class="name-description">
|
||||
<tr>
|
||||
<td><a href="./../ref/Topten.RichTextKit.IStyle">IStyle</a></td>
|
||||
<td><p>An IStyle for the new style</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
---
|
||||
title: "StyleManager.HaloColor"
|
||||
isMarkdown: false
|
||||
import: "../.common.page"
|
||||
---
|
||||
|
||||
<h1 data-nav-secondary-text="Definition" id="definition">StyleManager.HaloColor Method</h1>
|
||||
|
||||
|
||||
<p>
|
||||
<small>
|
||||
Assembly: Topten.RichTextKit.dll<br />
|
||||
Namespace: <a href="./../ref/Topten.RichTextKit">Topten.RichTextKit</a><br />
|
||||
|
||||
Declaring Type: <a href="./../ref/Topten.RichTextKit.StyleManager">StyleManager</a><br />
|
||||
</small>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p>Changes the halo color and returns an updated IStyle</p>
|
||||
|
||||
|
||||
<pre class="language-csharp"><code class="language-csharp">public IStyle HaloColor(SkiaSharp.SKColor haloColor);</code></pre>
|
||||
|
||||
|
||||
<h2 id="parameters">Parameters</h2> <table class="name-description">
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
SkiaSharp.SKColor haloColor
|
||||
</td>
|
||||
<td><p>The new halo color</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2 id="returns">Returns</h2> <table class="name-description">
|
||||
<tr>
|
||||
<td><a href="./../ref/Topten.RichTextKit.IStyle">IStyle</a></td>
|
||||
<td><p>An IStyle for the new style</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
---
|
||||
title: "StyleManager.HaloWidth"
|
||||
isMarkdown: false
|
||||
import: "../.common.page"
|
||||
---
|
||||
|
||||
<h1 data-nav-secondary-text="Definition" id="definition">StyleManager.HaloWidth Method</h1>
|
||||
|
||||
|
||||
<p>
|
||||
<small>
|
||||
Assembly: Topten.RichTextKit.dll<br />
|
||||
Namespace: <a href="./../ref/Topten.RichTextKit">Topten.RichTextKit</a><br />
|
||||
|
||||
Declaring Type: <a href="./../ref/Topten.RichTextKit.StyleManager">StyleManager</a><br />
|
||||
</small>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p>Changes the halo width and returns an updated IStyle</p>
|
||||
|
||||
|
||||
<pre class="language-csharp"><code class="language-csharp">public IStyle HaloWidth(float haloWidth);</code></pre>
|
||||
|
||||
|
||||
<h2 id="parameters">Parameters</h2> <table class="name-description">
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
<a href="https://docs.microsoft.com/dotnet/api/System.Single">float</a> haloWidth
|
||||
</td>
|
||||
<td><p>The new halo width</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2 id="returns">Returns</h2> <table class="name-description">
|
||||
<tr>
|
||||
<td><a href="./../ref/Topten.RichTextKit.IStyle">IStyle</a></td>
|
||||
<td><p>An IStyle for the new style</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -27,7 +27,7 @@ import: "../.common.page"
|
|||
style.</p>
|
||||
|
||||
|
||||
<pre class="language-csharp"><code class="language-csharp">public IStyle Update(string fontFamily = null, Nullable<float> fontSize = null, Nullable<int> fontWeight = null, Nullable<bool> fontItalic = null, Nullable<UnderlineStyle> underline = null, Nullable<StrikeThroughStyle> strikeThrough = null, Nullable<float> lineHeight = null, Nullable<SkiaSharp.SKColor> textColor = null, Nullable<SkiaSharp.SKColor> backgroundColor = null, Nullable<float> letterSpacing = null, Nullable<FontVariant> fontVariant = null, Nullable<TextDirection> textDirection = null, Nullable<char> replacementCharacter = null);</code></pre>
|
||||
<pre class="language-csharp"><code class="language-csharp">public IStyle Update(string fontFamily = null, Nullable<float> fontSize = null, Nullable<int> fontWeight = null, Nullable<SkiaSharp.SKFontStyleWidth> fontWidth = 0, Nullable<bool> fontItalic = null, Nullable<UnderlineStyle> underline = null, Nullable<StrikeThroughStyle> strikeThrough = null, Nullable<float> lineHeight = null, Nullable<SkiaSharp.SKColor> textColor = null, Nullable<SkiaSharp.SKColor> backgroundColor = null, Nullable<SkiaSharp.SKColor> haloColor = null, Nullable<float> haloWidth = null, Nullable<float> haloBlur = null, Nullable<float> letterSpacing = null, Nullable<FontVariant> fontVariant = null, Nullable<TextDirection> textDirection = null, Nullable<char> replacementCharacter = null);</code></pre>
|
||||
|
||||
|
||||
<h2 id="parameters">Parameters</h2> <table class="name-description">
|
||||
|
@ -58,6 +58,14 @@ style.</p>
|
|||
<tr>
|
||||
<td>
|
||||
|
||||
<a href="https://docs.microsoft.com/dotnet/api/System.Nullable-1">Nullable<SkiaSharp.SKFontStyleWidth></a> fontWidth
|
||||
= 0 </td>
|
||||
<td><p>The new font width</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
<a href="https://docs.microsoft.com/dotnet/api/System.Nullable-1">Nullable<bool></a> fontItalic
|
||||
= null </td>
|
||||
<td><p>The new font italic</p>
|
||||
|
@ -106,6 +114,30 @@ style.</p>
|
|||
<tr>
|
||||
<td>
|
||||
|
||||
<a href="https://docs.microsoft.com/dotnet/api/System.Nullable-1">Nullable<SkiaSharp.SKColor></a> haloColor
|
||||
= null </td>
|
||||
<td><p>The new text color</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
<a href="https://docs.microsoft.com/dotnet/api/System.Nullable-1">Nullable<float></a> haloWidth
|
||||
= null </td>
|
||||
<td><p>The new halo width</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
<a href="https://docs.microsoft.com/dotnet/api/System.Nullable-1">Nullable<float></a> haloBlur
|
||||
= null </td>
|
||||
<td><p>The new halo blur width</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
<a href="https://docs.microsoft.com/dotnet/api/System.Nullable-1">Nullable<float></a> letterSpacing
|
||||
= null </td>
|
||||
<td><p>The new letterSpacing</p>
|
||||
|
|
|
@ -104,11 +104,31 @@ a particular style and then popping back to the previous style.</p>
|
|||
<tr>
|
||||
<td><a href="./../ref/Topten.RichTextKit.StyleManager.FontWeight">FontWeight(int)</a></td>
|
||||
<td><p>Changes the font weight and returns an updated IStyle</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="./../ref/Topten.RichTextKit.StyleManager.FontWidth">FontWidth(SkiaSharp.SKFontStyleWidth)</a></td>
|
||||
<td><p>Changes the font width and returns an updated IStyle</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="./../ref/Topten.RichTextKit.StyleManager.FromStyle">FromStyle(IStyle)</a></td>
|
||||
<td><p>Get a style that matches all the style attributes of the supplied style</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="./../ref/Topten.RichTextKit.StyleManager.HaloBlur">HaloBlur(float)</a></td>
|
||||
<td><p>Changes the halo blur width and returns an updated IStyle</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="./../ref/Topten.RichTextKit.StyleManager.HaloColor">HaloColor(SkiaSharp.SKColor)</a></td>
|
||||
<td><p>Changes the halo color and returns an updated IStyle</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="./../ref/Topten.RichTextKit.StyleManager.HaloWidth">HaloWidth(float)</a></td>
|
||||
<td><p>Changes the halo width and returns an updated IStyle</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -163,7 +183,7 @@ Push/Pop style stack to empty.</p>
|
|||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="./../ref/Topten.RichTextKit.StyleManager.Update">Update(string, Nullable<float>, Nullable<int>, Nullable<bool>, Nullable<UnderlineStyle>, Nullable<StrikeThroughStyle>, Nullable<float>, Nullable<SkiaSharp.SKColor>, Nullable<SkiaSharp.SKColor>, Nullable<float>, Nullable<FontVariant>, Nullable<TextDirection>, Nullable<char>)</a></td>
|
||||
<td><a href="./../ref/Topten.RichTextKit.StyleManager.Update">Update(string, Nullable<float>, Nullable<int>, Nullable<SkiaSharp.SKFontStyleWidth>, Nullable<bool>, Nullable<UnderlineStyle>, Nullable<StrikeThroughStyle>, Nullable<float>, Nullable<SkiaSharp.SKColor>, Nullable<SkiaSharp.SKColor>, Nullable<SkiaSharp.SKColor>, Nullable<float>, Nullable<float>, Nullable<float>, Nullable<FontVariant>, Nullable<TextDirection>, Nullable<char>)</a></td>
|
||||
<td><p>Update the current style by applying one or more changes to the current
|
||||
style.</p>
|
||||
</td>
|
||||
|
|
Загрузка…
Ссылка в новой задаче