public static void SetFontDefn(this ClientTextBlock TextBlock, FontDefn FontDefn) { TextBlock.FontFamily = FontDefn.Family; TextBlock.FontSize = FontDefn.PointSize; TextBlock.FontWeight = FontDefn.Weight; TextBlock.Foreground = FontDefn.Foreground; }
/// <summary> /// set the font, color, etc of the TextBlock control that is on the Canvas. /// </summary> /// <param name="CharBoxDim"></param> /// <param name="KernDim"></param> /// <param name="FontDefn"></param> public void SetPaintDefn(Size CharBoxDim, Size KernDim, FontDefn FontDefn) { this.TextBlock.FontFamily = FontDefn.Family; this.TextBlock.FontSize = FontDefn.PointSize; this.TextBlock.FontWeight = FontDefn.Weight; this.TextBlock.Foreground = FontDefn.Foreground; this.TextBlock.ChangeSizeBasis(CharBoxDim, KernDim); }
public VisualTextBlock(string Text, ZeroRowCol RowCol, byte?AttrByte, Size CharBoxDim, Size KernDim, FontDefn FontDefn) : base(RowCol, AttrByte) { this.TextBlock = new ClientTextBlock(CharBoxDim, KernDim); SetPaintDefn(CharBoxDim, KernDim, FontDefn); this.ShowText = Text; }
/// <summary> /// set the font, color, etc of the TextBlock control that is on the Canvas. /// </summary> /// <param name="CharBoxDim"></param> /// <param name="KernDim"></param> /// <param name="FontDefn"></param> public void SetPaintDefn(Size CharBoxDim, Size KernDim, FontDefn FontDefn) { this.TextBlock.SetFontDefn(FontDefn); if (this.ForegroundBrush != null) { this.TextBlock.Foreground = this.ForegroundBrush; } this.TextBlock.ChangeSizeBasis(CharBoxDim, KernDim); }