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; }
private static float CalcBaselineOffset(DW.TextLayout tl, DominantBaseline db) { var lm = tl.GetLineMetrics()[0]; switch (db) { case DominantBaseline.Middle: return((lm.Height + (lm.Height - lm.Baseline)) / 2); case DominantBaseline.Auto: case DominantBaseline.Baseline: return(lm.Baseline); default: return(lm.Height - lm.Baseline); } }
public Text( string label, double posX, double posY, TextAnchor anchor = TextAnchor.Middle, DominantBaseline baseline = DominantBaseline.Auto, TextStyle style = null, string[] classes = null) { RootName = "text"; Label = label; PosX = posX; PosY = posY; _style = style; Classes = classes; Anchor = anchor; DominantBaseline = baseline; }
/// <summary> /// /// </summary> public virtual TBuilder DominantBaseline(DominantBaseline dominantBaseline) { this.ToComponent().DominantBaseline = dominantBaseline; return(this as TBuilder); }
/// <summary> /// /// </summary> public virtual SpriteAttributes.Builder DominantBaseline(DominantBaseline dominantBaseline) { this.ToComponent().DominantBaseline = dominantBaseline; return(this as SpriteAttributes.Builder); }