Beispiel #1
0
        public void SetGlyphToPath(FontHandle font, uint glyphIndex)
        {
            PathHandle path = PathHandle.Invalid;

            if (segments.Count != 0)
            {
                byte[]  segmentBytes = segments.Cast <byte>().ToArray();
                float[] coordsFloats = coords.ToArray();

                path = vg.CreatePath(
                    Constants.VG_PATH_FORMAT_STANDARD,
                    PathDatatype.VG_PATH_DATATYPE_F,
                    1.0f / 2048,
                    0.0f,
                    segmentBytes.Length,
                    coordsFloats.Length,
                    PathCapabilities.VG_PATH_CAPABILITY_ALL
                    );

                vg.AppendPathData(path, segmentBytes, coordsFloats);
            }

            var origin = new float[] { 0.0f, 0.0f };

            vg.SetGlyphToPath(font, glyphIndex, path, false, origin, escapement);

            if (path != PathHandle.Invalid)
            {
                vg.DestroyPath(path);
            }
        }
Beispiel #2
0
 public void Dispose()
 {
     // Destroy the OpenVG path resource:
     vg.DestroyPath(this.path);
 }