Ejemplo n.º 1
0
        public unsafe string GlyphToString(uint glyph)
        {
            var buffer = ArrayPool <char> .Shared.Rent(NameBufferLength);

            try
            {
                fixed(char *first = buffer)
                {
                    HarfBuzzApi.hb_font_glyph_to_string(Handle, glyph, first, buffer.Length);
                    return(new string (first));
                }
            } finally {
                ArrayPool <char> .Shared.Return(buffer);
            }
        }
Ejemplo n.º 2
0
        public unsafe string GlyphToString(uint glyph)
        {
            var buffer = ArrayPool <byte> .Shared.Rent(NameBufferLength);

            try
            {
                fixed(byte *first = buffer)
                {
                    HarfBuzzApi.hb_font_glyph_to_string(Handle, glyph, first, buffer.Length);
                    return(Marshal.PtrToStringAnsi((IntPtr)first));
                }
            } finally {
                ArrayPool <byte> .Shared.Return(buffer);
            }
        }