public override float DrawChar(DrawingHandleScreen handle, Rune rune, Vector2 baseline, float scale, Color color, bool fallback = true) { var metrics = Handle.GetCharMetrics(rune, scale); if (!metrics.HasValue) { if (fallback && !Rune.IsWhiteSpace(rune)) { rune = new Rune('�'); metrics = Handle.GetCharMetrics(rune, scale); if (!metrics.HasValue) { return(0); } } else { return(0); } } var texture = Handle.GetCharTexture(rune, scale); if (texture == null) { return(metrics.Value.Advance); } baseline += new Vector2(metrics.Value.BearingX, -metrics.Value.BearingY); handle.DrawTexture(texture, baseline, color); return(metrics.Value.Advance); }
public override float DrawChar(DrawingHandleScreen handle, char chr, Vector2 baseline, float scale, Color color) { var metrics = Handle.GetCharMetrics(chr, scale); if (!metrics.HasValue) { return(0); } var texture = Handle.GetCharTexture(chr, scale); if (texture == null) { return(metrics.Value.Advance); } baseline += new Vector2(metrics.Value.BearingX, -metrics.Value.BearingY); handle.DrawTexture(texture, baseline, color); return(metrics.Value.Advance); }