private static IList <Glyph> ConstructGlyphListFromString(String text, TrueTypeFont font) { IList <Glyph> glyphList = new List <Glyph>(); char[] chars = text.ToCharArray(); foreach (char letter in chars) { glyphList.Add(font.GetGlyph(letter)); } return(glyphList); }
public virtual void TestThatNoTransformationsAppliedForNonRelevantGlyphs() { TrueTypeFont fontProgram = (TrueTypeFont)FontProgramFactory.CreateFont(RESOURCE_FOLDER + "NotoNaskhArabic-Regular.ttf" ); GlyphLine glyphLine = new GlyphLine(JavaUtil.ArraysAsList(fontProgram.GetGlyph('1'), fontProgram.GetGlyphByCode (75))); GlyphPositioningTableReader gposTableReader = fontProgram.GetGposTable(); GposLookupType5 lookup = (GposLookupType5)gposTableReader.GetLookupTable(3); glyphLine.idx = 1; lookup.TransformOne(glyphLine); NUnit.Framework.Assert.AreEqual(2, glyphLine.Size()); NUnit.Framework.Assert.AreEqual(1490, glyphLine.Get(0).GetCode()); NUnit.Framework.Assert.AreEqual(75, glyphLine.Get(1).GetCode()); NUnit.Framework.Assert.AreEqual(0, glyphLine.Get(1).GetAnchorDelta()); NUnit.Framework.Assert.AreEqual(0, glyphLine.Get(1).GetXPlacement()); }