static void InitWinform() { if (s_platform != null) { return; } //---------------------------------------------------- s_platform = new UIPlatformWinForm(); }
static void InitWinform() { if (s_platform != null) { return; } //---------------------------------------------------- s_platform = new UIPlatformWinForm(); var instTypefaces = new InstalledTypefaceCollection(); instTypefaces.LoadSystemFonts(); s_fontstore = instTypefaces; }
public UIPlatformWinForm() { //-------------------------------------------------------------------- //TODO: review here again //NOTE: this class load native dll images (GLES2) //since GLES2 that we use is x86, //so we must specific the file type to x86 *** //else this will error on TypeInitializer ( from BadImageFormatException); //-------------------------------------------------------------------- if (s_platform == null) { s_platform = this; SetAsDefaultPlatform(); UIMsgQueue.RegisterRunOnceImpl(runOnceDelegate => { UIPlatform.RegisterRunOnceTask(tt => runOnceDelegate()); }); } //var installedTypefaces = new Typography.FontManagement.InstalledTypefaceCollection(); //installedTypefaces.LoadSystemFonts(); try { //set up winform platform ////gdi+ //PixelFarm.Drawing.WinGdi.WinGdiPlusPlatform.SetInstalledTypefaceProvider(installedTypefaces); LayoutFarm.UI.Clipboard.SetUIPlatform(this); } catch (System.Exception ex) { } ////gles2 //OpenTK.Toolkit.Init(); //PixelFarm.Drawing.GLES2.GLES2Platform.SetFontLoader(YourImplementation.BootStrapOpenGLES2.myFontLoader); ////skia //if (!YourImplementation.BootStrapSkia.IsNativeLibAvailable()) //{ // //handle when native dll is not ready //} //else //{ // //when ready // PixelFarm.Drawing.Skia.SkiaGraphicsPlatform.SetFontLoader(YourImplementation.BootStrapSkia.myFontLoader); //} //_gdiPlusIFonts = new PixelFarm.Drawing.WinGdi.Gdi32IFonts(); }
public UIPlatformWinForm() { //-------------------------------------------------------------------- //TODO: review here again //NOTE: this class load native dll images (GLES2) //since GLES2 that we use is x86, //so we must specific the file type to x86 *** //else this will error on TypeInitializer ( from BadImageFormatException); //-------------------------------------------------------------------- if (platform == null) { platform = this; SetAsDefaultPlatform(); } var fontLoader = new Typography.TextServices.OpenFontStore(); try { //set up winform platform ////gdi+ PixelFarm.Drawing.WinGdi.WinGdiPlusPlatform.SetFontLoader(fontLoader); LayoutFarm.UI.Clipboard.SetUIPlatform(this); } catch (System.Exception ex) { } ////gles2 //OpenTK.Toolkit.Init(); //PixelFarm.Drawing.GLES2.GLES2Platform.SetFontLoader(YourImplementation.BootStrapOpenGLES2.myFontLoader); ////skia //if (!YourImplementation.BootStrapSkia.IsNativeLibAvailable()) //{ // //handle when native dll is not ready //} //else //{ // //when ready // PixelFarm.Drawing.Skia.SkiaGraphicsPlatform.SetFontLoader(YourImplementation.BootStrapSkia.myFontLoader); //} //_gdiPlusIFonts = new PixelFarm.Drawing.WinGdi.Gdi32IFonts(); }