public TextItem(float dx, float dy, Text.Font font, Fill fill, DominantBaseline dominantBaseline, string text) { Dx = dx; Dy = dy; Font = font; Text = text; Fill = fill; DominantBaseline = dominantBaseline; }
public DW.FontFace GetFontFace(Text.Font font) { var fontFamily = _fontDictionary.GetFontFamily(font.Family); var xFont = fontFamily.GetFirstMatchingFont( GetFontWeight(font.Weight), GetFontStretch(font.Stretch), GetFontStyle(font.Style) ); return(new DW.FontFace(xFont)); }
public DW.TextFormat GetTextFormat(Text.Font font) { var fontName = _fontDictionary.SelectFontFamilyName(font.Family, out var fontCollection); return(new DW.TextFormat( _factory, fontName, fontCollection, GetFontWeight(font.Weight), GetFontStyle(font.Style), GetFontStretch(font.Stretch), font.Size )); }
public DW.TextLayout GetTextLayout(Text.Font font, string text, float maxWidth) { var tl = new DW.TextLayout( _factory, text, GetTextFormat(font), maxWidth, 9999999 ); // ReSharper disable once SwitchStatementMissingSomeCases switch (font.TextDecoration) { case TextDecoration.LineThrough: tl.SetStrikethrough(true, new DW.TextRange(0, text.Length)); break; case TextDecoration.Underline: tl.SetUnderline(true, new DW.TextRange(0, text.Length)); break; } return(tl); }
public DW.TextLayout CreateTextLayout(Text.Font font, string text, float width) { return(_fontManager.GetTextLayout(font, text, width)); }