public Segment MakeSeg(UInt32 script, Featureval feats, string str, Bidirtl dir)
 {
     IntPtr strPtr = Marshal.StringToCoTaskMemUni(str);
     IntPtr error = new IntPtr(0);
     int numCodePoints = Graphite2Api.CountUnicodeCharacters(Encform.Utf16, strPtr, IntPtr.Zero, ref error);
     IntPtr segmentPtr = Graphite2Api.MakeSeg(_font, _face.FacePtr, script, feats.FeatureValPtr, Encform.Utf16, strPtr, numCodePoints, dir);
     Marshal.FreeCoTaskMem(strPtr);
     return new Segment(segmentPtr);
 }
Example #2
0
        public Segment MakeSeg(UInt32 script, Featureval feats, string str, Bidirtl dir)
        {
            IntPtr strPtr        = Marshal.StringToCoTaskMemUni(str);
            IntPtr error         = new IntPtr(0);
            int    numCodePoints = Graphite2Api.CountUnicodeCharacters(Encform.Utf16, strPtr, IntPtr.Zero, ref error);
            IntPtr segmentPtr    = Graphite2Api.MakeSeg(_font, _face.FacePtr, script, feats.FeatureValPtr, Encform.Utf16, strPtr, numCodePoints, dir);

            Marshal.FreeCoTaskMem(strPtr);
            return(new Segment(segmentPtr));
        }
 internal static extern /*gr_segment**/ IntPtr MakeSeg(/*gr_font**/ IntPtr font, /*gr_face**/ IntPtr face, UInt32 script, /*gr_feature_val**/ IntPtr pFeats, Encform enc, IntPtr pStart, int nChars, Bidirtl dir);
 internal static extern IntPtr MakeSeg(/*gr_font**/IntPtr font, /*gr_face**/IntPtr face, UInt32 script, /*gr_feature_val**/IntPtr pFeats, Encform enc, IntPtr pStart, int nChars, Bidirtl dir);