using System;
using System.Runtime.InteropServices;
using Quik.Stb.TrueType;

namespace Quik.Stb
{
    public unsafe partial struct stbtt__buf
    {
        [NativeTypeName("unsigned char *")]
        public byte* data;

        public int cursor;

        public int size;
    }

    public partial struct stbtt_bakedchar
    {
        [NativeTypeName("unsigned short")]
        public ushort x0;

        [NativeTypeName("unsigned short")]
        public ushort y0;

        [NativeTypeName("unsigned short")]
        public ushort x1;

        [NativeTypeName("unsigned short")]
        public ushort y1;

        public float xoff;

        public float yoff;

        public float xadvance;
    }

    public partial struct stbtt_aligned_quad
    {
        public float x0;

        public float y0;

        public float s0;

        public float t0;

        public float x1;

        public float y1;

        public float s1;

        public float t1;
    }

    public partial struct stbtt_packedchar
    {
        [NativeTypeName("unsigned short")]
        public ushort x0;

        [NativeTypeName("unsigned short")]
        public ushort y0;

        [NativeTypeName("unsigned short")]
        public ushort x1;

        [NativeTypeName("unsigned short")]
        public ushort y1;

        public float xoff;

        public float yoff;

        public float xadvance;

        public float xoff2;

        public float yoff2;
    }

    public partial struct stbrp_rect
    {
    }

    public unsafe partial struct stbtt_pack_range
    {
        public float font_size;

        public int first_unicode_codepoint_in_range;

        public int* array_of_unicode_codepoints;

        public int num_chars;

        public stbtt_packedchar* chardata_for_range;

        [NativeTypeName("unsigned char")]
        public byte h_oversample;

        [NativeTypeName("unsigned char")]
        public byte v_oversample;
    }

    public unsafe partial struct stbtt_pack_context
    {
        public void* user_allocator_context;

        public void* pack_info;

        public int width;

        public int height;

        public int stride_in_bytes;

        public int padding;

        public int skip_missing;

        [NativeTypeName("unsigned int")]
        public uint h_oversample;

        [NativeTypeName("unsigned int")]
        public uint v_oversample;

        [NativeTypeName("unsigned char *")]
        public byte* pixels;

        public void* nodes;
    }

    public unsafe partial struct stbtt_fontinfo
    {
        public void* userdata;

        [NativeTypeName("unsigned char *")]
        public byte* data;

        public int fontstart;

        public int numGlyphs;

        public int loca;

        public int head;

        public int glyf;

        public int hhea;

        public int hmtx;

        public int kern;

        public int gpos;

        public int svg;

        public int index_map;

        public int indexToLocFormat;

        public stbtt__buf cff;

        public stbtt__buf charstrings;

        public stbtt__buf gsubrs;

        public stbtt__buf subrs;

        public stbtt__buf fontdicts;

        public stbtt__buf fdselect;
    }

    public partial struct stbtt_kerningentry
    {
        public int glyph1;

        public int glyph2;

        public int advance;
    }

    [NativeTypeName("unsigned int")]
    public enum StbttV : uint
    {
        STBTT_vmove = 1,
        STBTT_vline,
        STBTT_vcurve,
        STBTT_vcubic,
    }

    public partial struct stbtt_vertex
    {
        public short x;

        public short y;

        public short cx;

        public short cy;

        public short cx1;

        public short cy1;

        [NativeTypeName("unsigned char")]
        public byte type;

        [NativeTypeName("unsigned char")]
        public byte padding;
    }

    public unsafe partial struct stbtt__bitmap
    {
        public int w;

        public int h;

        public int stride;

        [NativeTypeName("unsigned char *")]
        public byte* pixels;
    }

    [NativeTypeName("unsigned int")]
    public enum StbttPlatform : uint
    {
        STBTT_PLATFORM_ID_UNICODE = 0,
        STBTT_PLATFORM_ID_MAC = 1,
        STBTT_PLATFORM_ID_ISO = 2,
        STBTT_PLATFORM_ID_MICROSOFT = 3,
    }

    [NativeTypeName("unsigned int")]
    public enum StbttUnicode : uint
    {
        STBTT_UNICODE_EID_UNICODE_1_0 = 0,
        STBTT_UNICODE_EID_UNICODE_1_1 = 1,
        STBTT_UNICODE_EID_ISO_10646 = 2,
        STBTT_UNICODE_EID_UNICODE_2_0_BMP = 3,
        STBTT_UNICODE_EID_UNICODE_2_0_FULL = 4,
    }

    [NativeTypeName("unsigned int")]
    public enum StbttMs : uint
    {
        STBTT_MS_EID_SYMBOL = 0,
        STBTT_MS_EID_UNICODE_BMP = 1,
        STBTT_MS_EID_SHIFTJIS = 2,
        STBTT_MS_EID_UNICODE_FULL = 10,
    }

    [NativeTypeName("unsigned int")]
    public enum StbttMac : uint
    {
        STBTT_MAC_EID_ROMAN = 0,
        STBTT_MAC_EID_ARABIC = 4,
        STBTT_MAC_EID_JAPANESE = 1,
        STBTT_MAC_EID_HEBREW = 5,
        STBTT_MAC_EID_CHINESE_TRAD = 2,
        STBTT_MAC_EID_GREEK = 6,
        STBTT_MAC_EID_KOREAN = 3,
        STBTT_MAC_EID_RUSSIAN = 7,
    }

    [NativeTypeName("unsigned int")]
    public enum StbttMsLang : uint
    {
        STBTT_MS_LANG_ENGLISH = 0x0409,
        STBTT_MS_LANG_ITALIAN = 0x0410,
        STBTT_MS_LANG_CHINESE = 0x0804,
        STBTT_MS_LANG_JAPANESE = 0x0411,
        STBTT_MS_LANG_DUTCH = 0x0413,
        STBTT_MS_LANG_KOREAN = 0x0412,
        STBTT_MS_LANG_FRENCH = 0x040c,
        STBTT_MS_LANG_RUSSIAN = 0x0419,
        STBTT_MS_LANG_GERMAN = 0x0407,
        STBTT_MS_LANG_SPANISH = 0x0409,
        STBTT_MS_LANG_HEBREW = 0x040d,
        STBTT_MS_LANG_SWEDISH = 0x041D,
    }

    [NativeTypeName("unsigned int")]
    public enum StbttMacLang : uint
    {
        STBTT_MAC_LANG_ENGLISH = 0,
        STBTT_MAC_LANG_JAPANESE = 11,
        STBTT_MAC_LANG_ARABIC = 12,
        STBTT_MAC_LANG_KOREAN = 23,
        STBTT_MAC_LANG_DUTCH = 4,
        STBTT_MAC_LANG_RUSSIAN = 32,
        STBTT_MAC_LANG_FRENCH = 1,
        STBTT_MAC_LANG_SPANISH = 6,
        STBTT_MAC_LANG_GERMAN = 2,
        STBTT_MAC_LANG_SWEDISH = 5,
        STBTT_MAC_LANG_HEBREW = 10,
        STBTT_MAC_LANG_CHINESE_SIMPLIFIED = 33,
        STBTT_MAC_LANG_ITALIAN = 3,
        STBTT_MAC_LANG_CHINESE_TRAD = 19,
    }

    public static unsafe partial class Stbtt
    {
        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
        public static extern void quik_stbtt_failed_assert_store([NativeTypeName("quik_failed_assert_cb_t")] IntPtr cb);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_BakeFontBitmap", ExactSpelling = true)]
        public static extern int BakeFontBitmap([NativeTypeName("const unsigned char *")] byte* data, int offset, float pixel_height, [NativeTypeName("unsigned char *")] byte* pixels, int pw, int ph, int first_char, int num_chars, stbtt_bakedchar* chardata);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_GetBakedQuad", ExactSpelling = true)]
        public static extern void GetBakedQuad([NativeTypeName("const stbtt_bakedchar *")] stbtt_bakedchar* chardata, int pw, int ph, int char_index, float* xpos, float* ypos, stbtt_aligned_quad* q, int opengl_fillrule);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_GetScaledFontVMetrics", ExactSpelling = true)]
        public static extern void GetScaledFontVMetrics([NativeTypeName("const unsigned char *")] byte* fontdata, int index, float size, float* ascent, float* descent, float* lineGap);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_PackBegin", ExactSpelling = true)]
        public static extern int PackBegin(stbtt_pack_context* spc, [NativeTypeName("unsigned char *")] byte* pixels, int width, int height, int stride_in_bytes, int padding, void* alloc_context);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_PackEnd", ExactSpelling = true)]
        public static extern void PackEnd(stbtt_pack_context* spc);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_PackFontRange", ExactSpelling = true)]
        public static extern int PackFontRange(stbtt_pack_context* spc, [NativeTypeName("const unsigned char *")] byte* fontdata, int font_index, float font_size, int first_unicode_char_in_range, int num_chars_in_range, stbtt_packedchar* chardata_for_range);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_PackFontRanges", ExactSpelling = true)]
        public static extern int PackFontRanges(stbtt_pack_context* spc, [NativeTypeName("const unsigned char *")] byte* fontdata, int font_index, stbtt_pack_range* ranges, int num_ranges);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_PackSetOversampling", ExactSpelling = true)]
        public static extern void PackSetOversampling(stbtt_pack_context* spc, [NativeTypeName("unsigned int")] uint h_oversample, [NativeTypeName("unsigned int")] uint v_oversample);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_PackSetSkipMissingCodepoints", ExactSpelling = true)]
        public static extern void PackSetSkipMissingCodepoints(stbtt_pack_context* spc, int skip);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_GetPackedQuad", ExactSpelling = true)]
        public static extern void GetPackedQuad([NativeTypeName("const stbtt_packedchar *")] stbtt_packedchar* chardata, int pw, int ph, int char_index, float* xpos, float* ypos, stbtt_aligned_quad* q, int align_to_integer);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_PackFontRangesGatherRects", ExactSpelling = true)]
        public static extern int PackFontRangesGatherRects(stbtt_pack_context* spc, [NativeTypeName("const stbtt_fontinfo *")] stbtt_fontinfo* info, stbtt_pack_range* ranges, int num_ranges, stbrp_rect* rects);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_PackFontRangesPackRects", ExactSpelling = true)]
        public static extern void PackFontRangesPackRects(stbtt_pack_context* spc, stbrp_rect* rects, int num_rects);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_PackFontRangesRenderIntoRects", ExactSpelling = true)]
        public static extern int PackFontRangesRenderIntoRects(stbtt_pack_context* spc, [NativeTypeName("const stbtt_fontinfo *")] stbtt_fontinfo* info, stbtt_pack_range* ranges, int num_ranges, stbrp_rect* rects);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_GetNumberOfFonts", ExactSpelling = true)]
        public static extern int GetNumberOfFonts([NativeTypeName("const unsigned char *")] byte* data);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_GetFontOffsetForIndex", ExactSpelling = true)]
        public static extern int GetFontOffsetForIndex([NativeTypeName("const unsigned char *")] byte* data, int index);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_InitFont", ExactSpelling = true)]
        public static extern int InitFont(stbtt_fontinfo* info, [NativeTypeName("const unsigned char *")] byte* data, int offset);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_FindGlyphIndex", ExactSpelling = true)]
        public static extern int FindGlyphIndex([NativeTypeName("const stbtt_fontinfo *")] stbtt_fontinfo* info, int unicode_codepoint);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_ScaleForPixelHeight", ExactSpelling = true)]
        public static extern float ScaleForPixelHeight([NativeTypeName("const stbtt_fontinfo *")] stbtt_fontinfo* info, float pixels);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_ScaleForMappingEmToPixels", ExactSpelling = true)]
        public static extern float ScaleForMappingEmToPixels([NativeTypeName("const stbtt_fontinfo *")] stbtt_fontinfo* info, float pixels);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_GetFontVMetrics", ExactSpelling = true)]
        public static extern void GetFontVMetrics([NativeTypeName("const stbtt_fontinfo *")] stbtt_fontinfo* info, int* ascent, int* descent, int* lineGap);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_GetFontVMetricsOS2", ExactSpelling = true)]
        public static extern int GetFontVMetricsOS2([NativeTypeName("const stbtt_fontinfo *")] stbtt_fontinfo* info, int* typoAscent, int* typoDescent, int* typoLineGap);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_GetFontBoundingBox", ExactSpelling = true)]
        public static extern void GetFontBoundingBox([NativeTypeName("const stbtt_fontinfo *")] stbtt_fontinfo* info, int* x0, int* y0, int* x1, int* y1);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_GetCodepointHMetrics", ExactSpelling = true)]
        public static extern void GetCodepointHMetrics([NativeTypeName("const stbtt_fontinfo *")] stbtt_fontinfo* info, int codepoint, int* advanceWidth, int* leftSideBearing);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_GetCodepointKernAdvance", ExactSpelling = true)]
        public static extern int GetCodepointKernAdvance([NativeTypeName("const stbtt_fontinfo *")] stbtt_fontinfo* info, int ch1, int ch2);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_GetCodepointBox", ExactSpelling = true)]
        public static extern int GetCodepointBox([NativeTypeName("const stbtt_fontinfo *")] stbtt_fontinfo* info, int codepoint, int* x0, int* y0, int* x1, int* y1);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_GetGlyphHMetrics", ExactSpelling = true)]
        public static extern void GetGlyphHMetrics([NativeTypeName("const stbtt_fontinfo *")] stbtt_fontinfo* info, int glyph_index, int* advanceWidth, int* leftSideBearing);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_GetGlyphKernAdvance", ExactSpelling = true)]
        public static extern int GetGlyphKernAdvance([NativeTypeName("const stbtt_fontinfo *")] stbtt_fontinfo* info, int glyph1, int glyph2);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_GetGlyphBox", ExactSpelling = true)]
        public static extern int GetGlyphBox([NativeTypeName("const stbtt_fontinfo *")] stbtt_fontinfo* info, int glyph_index, int* x0, int* y0, int* x1, int* y1);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_GetKerningTableLength", ExactSpelling = true)]
        public static extern int GetKerningTableLength([NativeTypeName("const stbtt_fontinfo *")] stbtt_fontinfo* info);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_GetKerningTable", ExactSpelling = true)]
        public static extern int GetKerningTable([NativeTypeName("const stbtt_fontinfo *")] stbtt_fontinfo* info, stbtt_kerningentry* table, int table_length);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_IsGlyphEmpty", ExactSpelling = true)]
        public static extern int IsGlyphEmpty([NativeTypeName("const stbtt_fontinfo *")] stbtt_fontinfo* info, int glyph_index);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_GetCodepointShape", ExactSpelling = true)]
        public static extern int GetCodepointShape([NativeTypeName("const stbtt_fontinfo *")] stbtt_fontinfo* info, int unicode_codepoint, stbtt_vertex** vertices);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_GetGlyphShape", ExactSpelling = true)]
        public static extern int GetGlyphShape([NativeTypeName("const stbtt_fontinfo *")] stbtt_fontinfo* info, int glyph_index, stbtt_vertex** vertices);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_FreeShape", ExactSpelling = true)]
        public static extern void FreeShape([NativeTypeName("const stbtt_fontinfo *")] stbtt_fontinfo* info, stbtt_vertex* vertices);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_FindSVGDoc", ExactSpelling = true)]
        [return: NativeTypeName("unsigned char *")]
        public static extern byte* FindSVGDoc([NativeTypeName("const stbtt_fontinfo *")] stbtt_fontinfo* info, int gl);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_GetCodepointSVG", ExactSpelling = true)]
        public static extern int GetCodepointSVG([NativeTypeName("const stbtt_fontinfo *")] stbtt_fontinfo* info, int unicode_codepoint, [NativeTypeName("const char **")] sbyte** svg);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_GetGlyphSVG", ExactSpelling = true)]
        public static extern int GetGlyphSVG([NativeTypeName("const stbtt_fontinfo *")] stbtt_fontinfo* info, int gl, [NativeTypeName("const char **")] sbyte** svg);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_FreeBitmap", ExactSpelling = true)]
        public static extern void FreeBitmap([NativeTypeName("unsigned char *")] byte* bitmap, void* userdata);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_GetCodepointBitmap", ExactSpelling = true)]
        [return: NativeTypeName("unsigned char *")]
        public static extern byte* GetCodepointBitmap([NativeTypeName("const stbtt_fontinfo *")] stbtt_fontinfo* info, float scale_x, float scale_y, int codepoint, int* width, int* height, int* xoff, int* yoff);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_GetCodepointBitmapSubpixel", ExactSpelling = true)]
        [return: NativeTypeName("unsigned char *")]
        public static extern byte* GetCodepointBitmapSubpixel([NativeTypeName("const stbtt_fontinfo *")] stbtt_fontinfo* info, float scale_x, float scale_y, float shift_x, float shift_y, int codepoint, int* width, int* height, int* xoff, int* yoff);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_MakeCodepointBitmap", ExactSpelling = true)]
        public static extern void MakeCodepointBitmap([NativeTypeName("const stbtt_fontinfo *")] stbtt_fontinfo* info, [NativeTypeName("unsigned char *")] byte* output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, int codepoint);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_MakeCodepointBitmapSubpixel", ExactSpelling = true)]
        public static extern void MakeCodepointBitmapSubpixel([NativeTypeName("const stbtt_fontinfo *")] stbtt_fontinfo* info, [NativeTypeName("unsigned char *")] byte* output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int codepoint);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_MakeCodepointBitmapSubpixelPrefilter", ExactSpelling = true)]
        public static extern void MakeCodepointBitmapSubpixelPrefilter([NativeTypeName("const stbtt_fontinfo *")] stbtt_fontinfo* info, [NativeTypeName("unsigned char *")] byte* output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int oversample_x, int oversample_y, float* sub_x, float* sub_y, int codepoint);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_GetCodepointBitmapBox", ExactSpelling = true)]
        public static extern void GetCodepointBitmapBox([NativeTypeName("const stbtt_fontinfo *")] stbtt_fontinfo* font, int codepoint, float scale_x, float scale_y, int* ix0, int* iy0, int* ix1, int* iy1);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_GetCodepointBitmapBoxSubpixel", ExactSpelling = true)]
        public static extern void GetCodepointBitmapBoxSubpixel([NativeTypeName("const stbtt_fontinfo *")] stbtt_fontinfo* font, int codepoint, float scale_x, float scale_y, float shift_x, float shift_y, int* ix0, int* iy0, int* ix1, int* iy1);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_GetGlyphBitmap", ExactSpelling = true)]
        [return: NativeTypeName("unsigned char *")]
        public static extern byte* GetGlyphBitmap([NativeTypeName("const stbtt_fontinfo *")] stbtt_fontinfo* info, float scale_x, float scale_y, int glyph, int* width, int* height, int* xoff, int* yoff);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_GetGlyphBitmapSubpixel", ExactSpelling = true)]
        [return: NativeTypeName("unsigned char *")]
        public static extern byte* GetGlyphBitmapSubpixel([NativeTypeName("const stbtt_fontinfo *")] stbtt_fontinfo* info, float scale_x, float scale_y, float shift_x, float shift_y, int glyph, int* width, int* height, int* xoff, int* yoff);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_MakeGlyphBitmap", ExactSpelling = true)]
        public static extern void MakeGlyphBitmap([NativeTypeName("const stbtt_fontinfo *")] stbtt_fontinfo* info, [NativeTypeName("unsigned char *")] byte* output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, int glyph);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_MakeGlyphBitmapSubpixel", ExactSpelling = true)]
        public static extern void MakeGlyphBitmapSubpixel([NativeTypeName("const stbtt_fontinfo *")] stbtt_fontinfo* info, [NativeTypeName("unsigned char *")] byte* output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int glyph);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_MakeGlyphBitmapSubpixelPrefilter", ExactSpelling = true)]
        public static extern void MakeGlyphBitmapSubpixelPrefilter([NativeTypeName("const stbtt_fontinfo *")] stbtt_fontinfo* info, [NativeTypeName("unsigned char *")] byte* output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int oversample_x, int oversample_y, float* sub_x, float* sub_y, int glyph);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_GetGlyphBitmapBox", ExactSpelling = true)]
        public static extern void GetGlyphBitmapBox([NativeTypeName("const stbtt_fontinfo *")] stbtt_fontinfo* font, int glyph, float scale_x, float scale_y, int* ix0, int* iy0, int* ix1, int* iy1);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_GetGlyphBitmapBoxSubpixel", ExactSpelling = true)]
        public static extern void GetGlyphBitmapBoxSubpixel([NativeTypeName("const stbtt_fontinfo *")] stbtt_fontinfo* font, int glyph, float scale_x, float scale_y, float shift_x, float shift_y, int* ix0, int* iy0, int* ix1, int* iy1);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_Rasterize", ExactSpelling = true)]
        public static extern void Rasterize(stbtt__bitmap* result, float flatness_in_pixels, stbtt_vertex* vertices, int num_verts, float scale_x, float scale_y, float shift_x, float shift_y, int x_off, int y_off, int invert, void* userdata);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_FreeSDF", ExactSpelling = true)]
        public static extern void FreeSDF([NativeTypeName("unsigned char *")] byte* bitmap, void* userdata);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_GetGlyphSDF", ExactSpelling = true)]
        [return: NativeTypeName("unsigned char *")]
        public static extern byte* GetGlyphSDF([NativeTypeName("const stbtt_fontinfo *")] stbtt_fontinfo* info, float scale, int glyph, int padding, [NativeTypeName("unsigned char")] byte onedge_value, float pixel_dist_scale, int* width, int* height, int* xoff, int* yoff);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_GetCodepointSDF", ExactSpelling = true)]
        [return: NativeTypeName("unsigned char *")]
        public static extern byte* GetCodepointSDF([NativeTypeName("const stbtt_fontinfo *")] stbtt_fontinfo* info, float scale, int codepoint, int padding, [NativeTypeName("unsigned char")] byte onedge_value, float pixel_dist_scale, int* width, int* height, int* xoff, int* yoff);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_FindMatchingFont", ExactSpelling = true)]
        public static extern int FindMatchingFont([NativeTypeName("const unsigned char *")] byte* fontdata, [NativeTypeName("const char *")] sbyte* name, int flags);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_CompareUTF8toUTF16_bigendian", ExactSpelling = true)]
        public static extern int CompareUTF8toUTF16_bigendian([NativeTypeName("const char *")] sbyte* s1, int len1, [NativeTypeName("const char *")] sbyte* s2, int len2);

        [DllImport("stbtt", CallingConvention = CallingConvention.Cdecl, EntryPoint = "stbtt_GetFontNameString", ExactSpelling = true)]
        [return: NativeTypeName("const char *")]
        public static extern sbyte* GetFontNameString([NativeTypeName("const stbtt_fontinfo *")] stbtt_fontinfo* font, int* length, int platformID, int encodingID, int languageID, int nameID);
    }
}
