public static unsafe Font AddFontFromFileTTF(this FontAtlas atlas, string fileName, float pixelSize, FontConfig config, char[] glyphRanges)
        {
            NativeFontAtlas *atlasPtr = ImGui.GetIO().GetNativePointer()->FontAtlas;
            IntPtr           cfgPtr   = Marshal.AllocHGlobal(Marshal.SizeOf(config));

            Marshal.StructureToPtr(config, cfgPtr, false);
            fixed(char *glyphPtr = &glyphRanges[0])
            {
                NativeFont *fontPtr =
                    ImGuiNative.ImFontAtlas_AddFontFromFileTTF(atlasPtr, fileName, pixelSize, cfgPtr, glyphPtr);

                return(new Font(fontPtr));
            }
        }
示例#2
0
        public Font AddFontFromMemoryTTF(IntPtr ttfData, int ttfDataSize, float pixelSize, IntPtr fontConfig)
        {
            NativeFont *nativeFontPtr = ImGuiNative.ImFontAtlas_AddFontFromMemoryTTF(_atlasPtr, ttfData.ToPointer(), ttfDataSize, pixelSize, fontConfig, null);

            return(new Font(nativeFontPtr));
        }
示例#3
0
        public Font AddFontFromFileTTF(string fileName, float pixelSize)
        {
            NativeFont *nativeFontPtr = ImGuiNative.ImFontAtlas_AddFontFromFileTTF(_atlasPtr, fileName, pixelSize, IntPtr.Zero, null);

            return(new Font(nativeFontPtr));
        }
示例#4
0
        public Font AddDefaultFont()
        {
            NativeFont *nativeFontPtr = ImGuiNative.ImFontAtlas_AddFontDefault(_atlasPtr);

            return(new Font(nativeFontPtr));
        }
示例#5
0
        public Font GetCurrentFont()
        {
            NativeFont *nativeFontPtr = ImGuiNative.igGetFont();

            return(new Font(nativeFontPtr));
        }
示例#6
0
文件: Font.cs 项目: xposure/FFNez
 public Font(NativeFont *nativePtr)
 {
     NativeFont = nativePtr;
 }
示例#7
0
 static extern ImFontGlyph *igFontFindGlyph(NativeFont *font, char c);
示例#8
0
 public static extern void igPushFont(NativeFont *font);
示例#9
0
 public static extern void ImDrawList_AddTextExt(NativeDrawList *list, NativeFont *font, float font_size, Vector2 pos, uint col, byte *text_begin, byte *text_end, float wrap_width, Vector4 *cpu_fine_clip_rect);