示例#1
0
 public void FaceNLanguages_Paduak_ReturnsExpectedNumberOfLanguages()
 {
     using (var face = new PaduakDisposableFace())
     {
         Assert.AreEqual(3, Graphite2Api.FaceNLanguages(face.Face));
     }
 }
示例#2
0
 public void FaceNGlyphs_PaduakFace_ReturnsExpectedNumber()
 {
     using (var face = new PaduakDisposableFace())
     {
         Assert.AreEqual(445, Graphite2Api.FaceNGlyphs(face.Face));
     }
 }
示例#3
0
 public void FaceNFref_PaduakFace_ReturnNineOrMoreFeatures()
 {
     using (var face = new PaduakDisposableFace())
     {
         int num = Graphite2Api.FaceNFref(face.Face);
         Assert.GreaterOrEqual(num, 9);
     }
 }
示例#4
0
 public void FaceFindFref_FindFreatureForkdotString_ReturnsNonNullFeatureRef()
 {
     using (var face = new PaduakDisposableFace())
     {
         IntPtr gr_feature_ref = Graphite2Api.FaceFindFref(face.Face, 1801744244);
         Assert.AreNotEqual(IntPtr.Zero, gr_feature_ref);
     }
 }
示例#5
0
 public void FaceLangByIndex_IndexZero_ReturnsNonZeroLangId()
 {
     using (var face = new PaduakDisposableFace())
     {
         uint langId = Graphite2Api.FaceLangByIndex(face.Face, 0);
         Assert.AreNotEqual(0, langId);
     }
 }
示例#6
0
        public void FaceFeaturevalForLang_PaduakFontWithEnLang_NonNullFeatureValReturned()
        {
            using (var face = new PaduakDisposableFace())
            {
                uint   lang           = Graphite2Api.StrToTag("en");
                IntPtr gr_feature_val = Graphite2Api.FaceFeaturevalForLang(face.Face, lang);
                Assert.AreNotEqual(IntPtr.Zero, gr_feature_val);

                Graphite2Api.FeatureValDestroy(gr_feature_val);
            }
        }
示例#7
0
 public void FaceFref_PaduakFace_ReturnsNonNullForEachFeature()
 {
     using (var face = new PaduakDisposableFace())
     {
         int num = Graphite2Api.FaceNFref(face.Face);
         for (ushort i = 0; i < num; ++i)
         {
             IntPtr gr_feature_ref = Graphite2Api.FaceFref(face.Face, i);
             Assert.AreNotEqual(IntPtr.Zero, gr_feature_ref);
         }
     }
 }
示例#8
0
        public void FrefSetFeatureValue_SettingsThekdotFeature_FailsWithZeroReturnCode()
        {
            using (var face = new PaduakDisposableFace())
            {
                uint   lang           = Graphite2Api.StrToTag("en");
                IntPtr gr_feature_val = Graphite2Api.FaceFeaturevalForLang(face.Face, lang);
                IntPtr gr_feature_ref = Graphite2Api.FaceFindFref(face.Face, 1801744244);
                int    ret            = Graphite2Api.FrefSetFeatureValue(gr_feature_ref, 12, gr_feature_val);
                Assert.AreEqual(0, ret);

                Graphite2Api.FeatureValDestroy(gr_feature_val);
            }
        }
示例#9
0
        public void FeaturevalClone_CloneAFeature_ReturnADifferentInstance()
        {
            using (var face = new PaduakDisposableFace())
            {
                uint   lang = Graphite2Api.StrToTag("en");
                IntPtr one  = Graphite2Api.FaceFeaturevalForLang(face.Face, lang);
                IntPtr two  = Graphite2Api.FeaturevalClone(one);
                Assert.NotNull(one, "one");
                Assert.NotNull(two, "two");
                Assert.AreNotEqual(one, two);

                Graphite2Api.FeatureValDestroy(one);
                Graphite2Api.FeatureValDestroy(two);
            }
        }
示例#10
0
        public void StartLogging_WithTestFaceAndValidLogFileLocation_FileShouldBeCreated()
        {
            int major, minor, bugfix;

            Graphite2Api.EngineVersion(out major, out minor, out bugfix);

            if (major <= 1 && minor < 2)
            {
                Assert.Ignore("Need newer engine to support logging");
            }

            using (var face = new PaduakDisposableFace())
            {
                string filename = Path.GetTempPath() + Guid.NewGuid().ToString();
                Assert.IsTrue(Graphite2Api.StartLogging(face.Face, filename));
                Assert.IsTrue(File.Exists(filename));
                Graphite2Api.StopLogging(face.Face);
                File.Delete(filename);
            }
        }
 public void FaceFref_PaduakFace_ReturnsNonNullForEachFeature()
 {
     using(var face = new PaduakDisposableFace())
     {
         int num = Graphite2Api.FaceNFref(face.Face);
         for(ushort i = 0; i < num; ++i)
         {
             IntPtr gr_feature_ref = Graphite2Api.FaceFref(face.Face, i);
             Assert.AreNotEqual(IntPtr.Zero, gr_feature_ref);
         }
     }
 }
 public void FaceNGlyphs_PaduakFace_ReturnsExpectedNumber()
 {
     using(var face = new PaduakDisposableFace())
     {
         Assert.AreEqual(445, Graphite2Api.FaceNGlyphs(face.Face));
     }
 }
 public void FaceFindFref_FindFreatureForkdotString_ReturnsNonNullFeatureRef()
 {
     using(var face = new PaduakDisposableFace())
     {
         IntPtr gr_feature_ref = Graphite2Api.FaceFindFref(face.Face, 1801744244);
         Assert.AreNotEqual(IntPtr.Zero, gr_feature_ref);
     }
 }
 public PaduakFeatureVal(ushort n)
 {
     _face = new PaduakDisposableFace();
     FeatureRef = Graphite2Api.FaceFref(_face.Face, n);
 }
 public PaduakDisposableFont()
 {
     _face = new PaduakDisposableFace();
     Font = Graphite2Api.MakeFont(20, _face.Face);
 }
        public void StartLogging_WithTestFaceAndValidLogFileLocation_FileShouldBeCreated()
        {
            int major, minor, bugfix;
            Graphite2Api.EngineVersion(out major, out minor, out bugfix);

            if (major <= 1 && minor < 2)
                Assert.Ignore("Need newer engine to support logging");

            using(var face = new PaduakDisposableFace())
            {
                string filename = Path.GetTempPath() + Guid.NewGuid().ToString();
                Assert.IsTrue(Graphite2Api.StartLogging(face.Face, filename));
                Assert.IsTrue(File.Exists(filename));
                Graphite2Api.StopLogging(face.Face);
                File.Delete(filename);
            }
        }
        public void FrefSetFeatureValue_SettingsThekdotFeature_FailsWithZeroReturnCode()
        {
            using(var face = new PaduakDisposableFace())
            {
                uint lang = Graphite2Api.StrToTag("en");
                IntPtr gr_feature_val =  Graphite2Api.FaceFeaturevalForLang(face.Face, lang);
                IntPtr gr_feature_ref = Graphite2Api.FaceFindFref(face.Face, 1801744244);
                int ret = Graphite2Api.FrefSetFeatureValue(gr_feature_ref, 12, gr_feature_val);
                Assert.AreEqual(0, ret);

                Graphite2Api.FeatureValDestroy(gr_feature_val);
            }
        }
        public void FeaturevalClone_CloneAFeature_ReturnADifferentInstance()
        {
            using(var face = new PaduakDisposableFace())
            {
                uint lang = Graphite2Api.StrToTag("en");
                IntPtr one =  Graphite2Api.FaceFeaturevalForLang(face.Face, lang);
                IntPtr two =  Graphite2Api.FeaturevalClone(one);
                Assert.NotNull(one, "one");
                Assert.NotNull(two, "two");
                Assert.AreNotEqual(one, two);

                Graphite2Api.FeatureValDestroy(one);
                Graphite2Api.FeatureValDestroy(two);
            }
        }
 public void FaceNLanguages_Paduak_ReturnsExpectedNumberOfLanguages()
 {
     using(var face = new PaduakDisposableFace())
     {
         Assert.AreEqual(3, Graphite2Api.FaceNLanguages(face.Face));
     }
 }
示例#20
0
 public PaduakDisposableFont()
 {
     _face = new PaduakDisposableFace();
     Font  = Graphite2Api.MakeFont(20, _face.Face);
 }
示例#21
0
 public PaduakFeatureVal(ushort n)
 {
     _face      = new PaduakDisposableFace();
     FeatureRef = Graphite2Api.FaceFref(_face.Face, n);
 }
 public void FaceLangByIndex_IndexZero_ReturnsNonZeroLangId()
 {
     using(var face = new PaduakDisposableFace())
     {
         uint langId = Graphite2Api.FaceLangByIndex(face.Face, 0);
         Assert.AreNotEqual(0, langId);
     }
 }
        public void FaceFeaturevalForLang_PaduakFontWithEnLang_NonNullFeatureValReturned()
        {
            using(var face = new PaduakDisposableFace())
            {
                uint lang = Graphite2Api.StrToTag("en");
                IntPtr gr_feature_val =  Graphite2Api.FaceFeaturevalForLang(face.Face, lang);
                Assert.AreNotEqual(IntPtr.Zero, gr_feature_val);

                Graphite2Api.FeatureValDestroy(gr_feature_val);
            }
        }
 public void FaceNFref_PaduakFace_ReturnNineOrMoreFeatures()
 {
     using(var face = new PaduakDisposableFace())
     {
         int num = Graphite2Api.FaceNFref(face.Face);
         Assert.GreaterOrEqual(num, 9);
     }
 }