private static GlyphRun CreateGlyphRun(Point origin, double fontSize, string unicodeString) { Uri fontUri = new Uri(EnvironmentWrapper.ExpandEnvironmentVariables(@"%windir%\fonts\cour.ttf")); GlyphTypeface glyphTypeface = new GlyphTypeface(fontUri); IList <ushort> glyphIndices = new List <ushort>(); for (int i = 0; i < unicodeString.Length; ++i) { glyphIndices.Add(glyphTypeface.CharacterToGlyphMap[unicodeString[i]]); } IList <double> advanceWidths = new List <double>(); for (int i = 0; i < glyphIndices.Count; ++i) { advanceWidths.Add(glyphTypeface.AdvanceWidths[glyphIndices[i]] * fontSize); } GlyphRun glyphRun = new GlyphRun(glyphTypeface, //glyph typeface 0, //bidi level false, //sideways fontSize, //font size glyphIndices, //glyph indices origin, //baseline origin advanceWidths, //advance widths null, //glyph offsets unicodeString.ToCharArray(), //test string null, //device font name null, //cmap null, //caret stop null //culture info ); return(glyphRun); }
private static void SetDefaults() { if (FileSystem == null) { FileSystem = new FileSystem(); } if (Environment == null) { Environment = new EnvironmentWrapper(); } if (WebClientFactory == null) { WebClientFactory = new WebClientFactory(); } }
public void Initialize() { environment = Substitute.For <EnvironmentWrapper>(); }
public MyClass(EnvironmentWrapper wrapper) { this.Environment = wrapper ?? new EnvironmentWrapper(); }
public ExitCommand(EnvironmentWrapper manager) { this.manager = manager; Description = "Exits from client."; }
public void Initialize() { environment = Substitute.For<EnvironmentWrapper>(); }
/// <summary> /// Applications the exit. /// </summary> protected void AppExit() { EnvironmentWrapper.Exit(0); }