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

            return(new ImFontPtr(ret));
        }
Example #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));
        }
Example #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);
        }
Example #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));
        }
Example #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));
        }
Example #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));
            }
        }
Example #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);
        }
Example #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));
        }
Example #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));
        }
Example #10
0
 public abstract ImFontGlyph *ImFont_FindGlyphNoFallback(ImFont *self, ushort c);
Example #11
0
 public FontContainer(ImFont *atlas, string Name, int Size)
 {
     Atlas     = atlas;
     this.Name = Name;
     this.Size = Size;
 }
Example #12
0
 public static extern ImFontGlyph *igFontFindGlyph(ImFont *font, uint c);
Example #13
0
 public ImFontPtr(IntPtr nativePtr)
 {
     NativePtr = (ImFont *)nativePtr;
 }
Example #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);
Example #15
0
 public abstract void ImFont_AddRemapChar(ImFont *self, ushort dst, ushort src, byte overwrite_dst);
Example #16
0
 public abstract void ImFont_RenderChar(ImFont *self, ImDrawList *draw_list, float size, Vector2 pos, uint col, ushort c);
Example #17
0
 public abstract ImFontGlyph *ImFont_FindGlyph(ImFont *self, ushort c);
Example #18
0
 public abstract void ImFont_SetFallbackChar(ImFont *self, ushort c);
Example #19
0
 public abstract float ImFont_GetCharAdvance(ImFont *self, ushort c);
Example #20
0
 public abstract byte ImFont_IsLoaded(ImFont *self);
Example #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);
Example #22
0
 public abstract void igPushFont(ImFont *font);
Example #23
0
 public abstract void ImFont_GrowIndex(ImFont *self, int new_size);
Example #24
0
 static extern ImFontGlyph *igFontFindGlyph(ImFont *font, char c);
Example #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);
Example #26
0
 public ImFontPtr(ImFont *nativePtr)
 {
     NativePtr = nativePtr;
 }
Example #27
0
 public abstract void ImFont_ImFont(ImFont *self);
Example #28
0
 public abstract byte *ImFont_CalcWordWrapPositionA(ImFont *self, float scale, byte *text, byte *text_end, float wrap_width);
Example #29
0
 public ImFontPtr(ImFont *nativePtr) => NativePtr = nativePtr;
Example #30
0
 public abstract int ImFontAtlas_AddCustomRectFontGlyph(ImFontAtlas *self, ImFont *font, ushort id, int width, int height, float advance_x, Vector2 offset);