Beispiel #1
0
        public ImFontPtr AddFontDefault()
        {
            ImFontConfigNative *font_cfg = null;
            ImFont *            ret      = ImGuiNative.ImFontAtlas_AddFontDefault(NativePtr, font_cfg);

            return(new ImFontPtr(ret));
        }
Beispiel #2
0
        public ImFontPtr AddFontDefault(ImFontConfig font_cfg)
        {
            ImFontConfigNative *native_font_cfg = font_cfg.NativePtr;
            ImFont *            ret             = ImGuiNative.ImFontAtlas_AddFontDefault(NativePtr, native_font_cfg);

            return(new ImFontPtr(ret));
        }
Beispiel #3
0
        public int AddCustomRectFontGlyph(ImFontPtr font, ushort id, int width, int height, float advance_x, Vector2 offset)
        {
            ImFont *native_font = font.NativePtr;
            int     ret         = ImGuiNative.ImFontAtlas_AddCustomRectFontGlyph(NativePtr, native_font, id, width, height, advance_x, offset);

            return(ret);
        }
Beispiel #4
0
        public ImFontPtr AddFontFromMemoryTTF(IntPtr font_data, int font_size, float size_pixels, ImFontConfig font_cfg)
        {
            void *native_font_data = font_data.ToPointer();
            ImFontConfigNative *native_font_cfg = font_cfg.NativePtr;
            ushort *            glyph_ranges    = null;
            ImFont *            ret             = ImGuiNative.ImFontAtlas_AddFontFromMemoryTTF(NativePtr, native_font_data, font_size, size_pixels, native_font_cfg, glyph_ranges);

            return(new ImFontPtr(ret));
        }
Beispiel #5
0
        public ImFontPtr AddFontFromMemoryCompressedTTF(IntPtr compressed_font_data, int compressed_font_size, float size_pixels)
        {
            void *native_compressed_font_data = compressed_font_data.ToPointer();
            ImFontConfigNative *font_cfg      = null;
            ushort *            glyph_ranges  = null;
            ImFont *            ret           = ImGuiNative.ImFontAtlas_AddFontFromMemoryCompressedTTF(NativePtr, native_compressed_font_data, compressed_font_size, size_pixels, font_cfg, glyph_ranges);

            return(new ImFontPtr(ret));
        }
Beispiel #6
0
        public ImFontPtr AddFontFromMemoryCompressedTTF(IntPtr compressed_font_data, int compressed_font_size, float size_pixels, ImFontConfig font_cfg, ref ushort glyph_ranges)
        {
            void *native_compressed_font_data   = compressed_font_data.ToPointer();
            ImFontConfigNative *native_font_cfg = font_cfg.NativePtr;

            fixed(ushort *native_glyph_ranges = &glyph_ranges)
            {
                ImFont *ret = ImGuiNative.ImFontAtlas_AddFontFromMemoryCompressedTTF(NativePtr, native_compressed_font_data, compressed_font_size, size_pixels, native_font_cfg, native_glyph_ranges);

                return(new ImFontPtr(ret));
            }
        }
Beispiel #7
0
        public void AddText(ImFontPtr font, float font_size, Vector2 pos, uint col, string text_begin, float wrap_width, Vector4 clip_rect)
        {
            ImFont *native_font          = font.NativePtr;
            int     text_begin_byteCount = Encoding.UTF8.GetByteCount(text_begin);
            byte *  native_text_begin    = stackalloc byte[text_begin_byteCount + 1];

            fixed(char *text_begin_ptr = text_begin)
            {
                int native_text_begin_offset = Encoding.UTF8.GetBytes(text_begin_ptr, text_begin.Length, native_text_begin, text_begin_byteCount);

                native_text_begin[native_text_begin_offset] = 0;
            }

            byte *   native_text_end    = null;
            Vector4 *cpu_fine_clip_rect = &clip_rect;

            ImGuiNative.ImDrawList_AddTextFontPtr(NativePtr, native_font, font_size, pos, col, native_text_begin, native_text_end, wrap_width, cpu_fine_clip_rect);
        }
Beispiel #8
0
        public ImFontPtr AddFontFromMemoryCompressedBase85TTF(string compressed_font_data_base85, float size_pixels)
        {
            int   compressed_font_data_base85_byteCount = (compressed_font_data_base85 != null) ? Encoding.UTF8.GetByteCount(compressed_font_data_base85) : 0;
            byte *native_compressed_font_data_base85    = stackalloc byte[compressed_font_data_base85_byteCount + 1];

            fixed(char *compressed_font_data_base85_ptr = compressed_font_data_base85)
            {
                int native_compressed_font_data_base85_offset = (compressed_font_data_base85 != null) ? Encoding.UTF8.GetBytes(compressed_font_data_base85_ptr, compressed_font_data_base85.Length, native_compressed_font_data_base85, compressed_font_data_base85_byteCount) : 0;

                native_compressed_font_data_base85[native_compressed_font_data_base85_offset] = 0;
            }

            native_compressed_font_data_base85 = (compressed_font_data_base85 != null) ? native_compressed_font_data_base85 : null;
            ImFontConfigNative *font_cfg     = null;
            ushort *            glyph_ranges = null;
            ImFont *            ret          = ImGuiNative.ImFontAtlas_AddFontFromMemoryCompressedBase85TTF(NativePtr, native_compressed_font_data_base85, size_pixels, font_cfg, glyph_ranges);

            return(new ImFontPtr(ret));
        }
Beispiel #9
0
        public ImFontPtr AddFontFromFileTTF(string filename, float size_pixels, ImFontConfig font_cfg)
        {
            int   filename_byteCount = (filename != null) ? Encoding.UTF8.GetByteCount(filename) : 0;
            byte *native_filename    = stackalloc byte[filename_byteCount + 1];

            fixed(char *filename_ptr = filename)
            {
                int native_filename_offset = (filename != null) ? Encoding.UTF8.GetBytes(filename_ptr, filename.Length, native_filename, filename_byteCount) : 0;

                native_filename[native_filename_offset] = 0;
            }

            native_filename = (filename != null) ? native_filename : null;
            ImFontConfigNative *native_font_cfg = font_cfg.NativePtr;
            ushort *            glyph_ranges    = null;
            ImFont *            ret             = ImGuiNative.ImFontAtlas_AddFontFromFileTTF(NativePtr, native_filename, size_pixels, native_font_cfg, glyph_ranges);

            return(new ImFontPtr(ret));
        }
Beispiel #10
0
 public abstract ImFontGlyph *ImFont_FindGlyphNoFallback(ImFont *self, ushort c);
Beispiel #11
0
 public FontContainer(ImFont *atlas, string Name, int Size)
 {
     Atlas     = atlas;
     this.Name = Name;
     this.Size = Size;
 }
Beispiel #12
0
 public static extern ImFontGlyph *igFontFindGlyph(ImFont *font, uint c);
Beispiel #13
0
 public ImFontPtr(IntPtr nativePtr)
 {
     NativePtr = (ImFont *)nativePtr;
 }
Beispiel #14
0
 public abstract Vector2 ImFont_CalcTextSizeA(ImFont *self, float size, float max_width, float wrap_width, byte *text_begin, byte *text_end, byte **remaining);
Beispiel #15
0
 public abstract void ImFont_AddRemapChar(ImFont *self, ushort dst, ushort src, byte overwrite_dst);
Beispiel #16
0
 public abstract void ImFont_RenderChar(ImFont *self, ImDrawList *draw_list, float size, Vector2 pos, uint col, ushort c);
Beispiel #17
0
 public abstract ImFontGlyph *ImFont_FindGlyph(ImFont *self, ushort c);
Beispiel #18
0
 public abstract void ImFont_SetFallbackChar(ImFont *self, ushort c);
Beispiel #19
0
 public abstract float ImFont_GetCharAdvance(ImFont *self, ushort c);
Beispiel #20
0
 public abstract byte ImFont_IsLoaded(ImFont *self);
Beispiel #21
0
 public abstract void ImFont_RenderText(ImFont *self, ImDrawList *draw_list, float size, Vector2 pos, uint col, Vector4 clip_rect, byte *text_begin, byte *text_end, float wrap_width, byte cpu_fine_clip);
Beispiel #22
0
 public abstract void igPushFont(ImFont *font);
Beispiel #23
0
 public abstract void ImFont_GrowIndex(ImFont *self, int new_size);
Beispiel #24
0
 static extern ImFontGlyph *igFontFindGlyph(ImFont *font, char c);
Beispiel #25
0
 public abstract void ImFont_AddGlyph(ImFont *self, ushort c, float x0, float y0, float x1, float y1, float u0, float v0, float u1, float v1, float advance_x);
Beispiel #26
0
 public ImFontPtr(ImFont *nativePtr)
 {
     NativePtr = nativePtr;
 }
Beispiel #27
0
 public abstract void ImFont_ImFont(ImFont *self);
Beispiel #28
0
 public abstract byte *ImFont_CalcWordWrapPositionA(ImFont *self, float scale, byte *text, byte *text_end, float wrap_width);
Beispiel #29
0
 public ImFontPtr(ImFont *nativePtr) => NativePtr = nativePtr;
Beispiel #30
0
 public abstract int ImFontAtlas_AddCustomRectFontGlyph(ImFontAtlas *self, ImFont *font, ushort id, int width, int height, float advance_x, Vector2 offset);