public Form1() { InitializeComponent(); var dicProvider = new Typography.TextBreak.IcuSimpleTextFileDictionaryProvider() { DataDir = "../../../../../Typography.TextBreak/icu62/brkitr" }; Typography.TextBreak.CustomBreakerBuilder.Setup(dicProvider); this.Load += new System.EventHandler(this.Form1_Load); SetupWoffDecompressFunctions(); MemBitmapExtensions.DefaultMemBitmapIO = new PixelFarm.Drawing.WinGdi.GdiBitmapIO(); lstTextBaseline.Items.AddRange( new object[] { PixelFarm.Drawing.TextBaseline.Alphabetic, PixelFarm.Drawing.TextBaseline.Bottom, PixelFarm.Drawing.TextBaseline.Top, //TODO: implement other types }); lstTextBaseline.SelectedIndex = 0;//default lstTextBaseline.SelectedIndexChanged += (s, e) => UpdateRenderOutput(); }
static void Main(string[] args) { PixelFarm.Platforms.StorageService.RegisterProvider(new YourImplementation.LocalFileStorageProvider("")); //2.2 Icu Text Break info //test Typography's custom text break, //check if we have that data? //------------------------------------------- //string typographyDir = @"brkitr_src/dictionaries"; //string icu_datadir = YourImplementation.RelativePathBuilder.SearchBackAndBuildFolderPath(System.IO.Directory.GetCurrentDirectory(), "PixelFarm", @"..\Typography\Typography.TextBreak\icu62\brkitr"); string icu_datadir = "brkitr"; //see brkitr folder, we link data from Typography project and copy to output if newer if (!System.IO.Directory.Exists(icu_datadir)) { throw new System.NotSupportedException("dic"); } var dicProvider = new Typography.TextBreak.IcuSimpleTextFileDictionaryProvider() { DataDir = icu_datadir }; Typography.TextBreak.CustomBreakerBuilder.Setup(dicProvider); PixelFarm.CpuBlit.MemBitmapExt.DefaultMemBitmapIO = new PixelFarm.Drawing.WinGdi.GdiBitmapIO(); YourImplementation.TestBedStartup.Setup(); //------------------------------------------- //load demo list from specific asm YourImplementation.TestBedStartup.RunDemoList(typeof(LayoutFarm.Demo_SingleButton).Assembly); }
static void Main() { //---------- PixelFarm.Platforms.StorageService.RegisterProvider(new YourImplementation.LocalFileStorageProvider("")); string icu_datadir = YourImplementation.RelativePathBuilder.SearchBackAndBuildFolderPath(System.IO.Directory.GetCurrentDirectory(), "PixelFarm", @"..\Typography\Typography.TextBreak\icu62\brkitr"); if (!System.IO.Directory.Exists(icu_datadir)) { throw new System.NotSupportedException("dic"); } var dicProvider = new Typography.TextBreak.IcuSimpleTextFileDictionaryProvider() { DataDir = icu_datadir }; Typography.TextBreak.CustomBreakerBuilder.Setup(dicProvider); PixelFarm.CpuBlit.MemBitmapExt.DefaultMemBitmapIO = new PixelFarm.Drawing.WinGdi.GdiBitmapIO(); YourImplementation.TestBedStartup.Setup(); //--------------------------------------------------- //register image loader //---------------------------- //app specfic RootDemoPath.Path = @"..\Data";//*** //---------------------------- Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new FormDev()); }
static void Main(string[] args) { PixelFarm.Platforms.StorageService.RegisterProvider(new YourImplementation.LocalFileStorageProvider("")); //2.2 Icu Text Break info //test Typography's custom text break, //check if we have that data? //------------------------------------------- //string typographyDir = @"brkitr_src/dictionaries"; string icu_datadir = YourImplementation.RelativePathBuilder.SearchBackAndBuildFolderPath(System.IO.Directory.GetCurrentDirectory(), "PixelFarm", @"..\Typography\Typography.TextBreak\icu62\brkitr"); if (!System.IO.Directory.Exists(icu_datadir)) { throw new System.NotSupportedException("dic"); } var dicProvider = new Typography.TextBreak.IcuSimpleTextFileDictionaryProvider() { DataDir = icu_datadir }; Typography.TextBreak.CustomBreakerBuilder.Setup(dicProvider); YourImplementation.TestBedStartup.Setup(); //------------------------------------------- YourImplementation.TestBedStartup.RunDemoList(typeof(Program)); }
static void Main() { YourImplementation.FrameworkInitWinGDI.SetupDefaultValues(); #if GL_ENABLE YourImplementation.LocalFileStorageProvider file_storageProvider = new YourImplementation.LocalFileStorageProvider(""); PixelFarm.Platforms.StorageService.RegisterProvider(file_storageProvider); YourImplementation.FrameworkInitGLES.SetupDefaultValues(); //2.2 Icu Text Break info //test Typography's custom text break, //check if we have that data? //------------------------------------------- string icu_datadir = YourImplementation.RelativePathBuilder.SearchBackAndBuildFolderPath(System.IO.Directory.GetCurrentDirectory(), "HtmlRenderer", @"..\Typography\Typography.TextBreak\icu62\brkitr"); if (!System.IO.Directory.Exists(icu_datadir)) { throw new System.NotSupportedException("dic"); } var dicProvider = new Typography.TextBreak.IcuSimpleTextFileDictionaryProvider() { DataDir = icu_datadir }; Typography.TextBreak.CustomBreakerBuilder.Setup(dicProvider); #endif PixelFarm.CpuBlit.MemBitmapExtensions.DefaultMemBitmapIO = new PixelFarm.Drawing.WinGdi.GdiBitmapIO(); #if DEBUG PixelFarm.CpuBlit.Imaging.PngImageWriter.InstallImageSaveToFileService((IntPtr imgBuffer, int stride, int width, int height, string filename) => { using (System.Drawing.Bitmap newBmp = new System.Drawing.Bitmap(width, height, System.Drawing.Imaging.PixelFormat.Format32bppArgb)) { PixelFarm.CpuBlit.Imaging.BitmapHelper.CopyToGdiPlusBitmapSameSize(imgBuffer, newBmp); //save newBmp.Save(filename); } }); #endif //------------------------------- Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); //temp //TODO: fix this , //LayoutFarm.Composers.Default.TextBreaker = new LayoutFarm.Composers.MyManagedTextBreaker(); //LayoutFarm.Composers.Default.TextBreaker = new LayoutFarm.Composers.MyNativeTextBreaker(); ////------------------------------- formDemoList = new LayoutFarm.Dev.FormDemoList(); formDemoList.LoadDemoList(typeof(Program)); LoadHtmlSamples(formDemoList.SamplesTreeView); Application.Run(formDemoList); }
public Form1() { InitializeComponent(); var dicProvider = new Typography.TextBreak.IcuSimpleTextFileDictionaryProvider() { DataDir = "../../../../../Typography.TextBreak/icu62/brkitr" }; Typography.TextBreak.CustomBreakerBuilder.Setup(dicProvider); this.Load += new System.EventHandler(this.Form1_Load); }
public Form1() { InitializeComponent(); var dicProvider = new Typography.TextBreak.IcuSimpleTextFileDictionaryProvider() { DataDir = "../../../../../Typography.TextBreak/icu62/brkitr" }; Typography.TextBreak.CustomBreakerBuilder.Setup(dicProvider); this.Load += new System.EventHandler(this.Form1_Load); SetupWoffDecompressFunctions(); MemBitmapExtensions.DefaultMemBitmapIO = new PixelFarm.Drawing.WinGdi.GdiBitmapIO(); }
static void Main() { PixelFarm.Platforms.StorageService.RegisterProvider(new YourImplementation.LocalFileStorageProvider("")); //2.2 Icu Text Break info //test Typography's custom text break, //check if we have that data? //------------------------------------------- //string typographyDir = @"brkitr_src/dictionaries"; string icu_datadir = YourImplementation.RelativePathBuilder.SearchBackAndBuildFolderPath(System.IO.Directory.GetCurrentDirectory(), "PixelFarm", @"..\Typography\Typography.TextBreak\icu62\brkitr"); if (!System.IO.Directory.Exists(icu_datadir)) { throw new System.NotSupportedException("dic"); } var dicProvider = new Typography.TextBreak.IcuSimpleTextFileDictionaryProvider() { DataDir = icu_datadir }; Typography.TextBreak.CustomBreakerBuilder.Setup(dicProvider); //register image loader //default text breaker, this bridge between PixelFarm.CpuBlit.MemBitmapExtensions.DefaultMemBitmapIO = new PixelFarm.Drawing.WinGdi.GdiBitmapIO(); //PixelFarm.CpuBlit.MemBitmapExtensions.DefaultMemBitmapIO = new YourImplementation.ImgCodecMemBitmapIO(); //PixelFarm.CpuBlit.MemBitmap.LoadBitmap("test_img.png"); YourImplementation.TestBedStartup.Setup(); //--------------------------------------------------- //register image loader //---------------------------- //app specfic RootDemoPath.Path = @"..\Data";//*** //---------------------------- Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new FormDev()); }
static void Main() { YourImplementation.LocalFileStorageProvider file_storageProvider = new YourImplementation.LocalFileStorageProvider(""); PixelFarm.Platforms.StorageService.RegisterProvider(file_storageProvider); YourImplementation.FrameworkInitGLES.SetupDefaultValues(); //2.2 Icu Text Break info //test Typography's custom text break, //check if we have that data? //------------------------------------------- string icu_datadir = YourImplementation.RelativePathBuilder.SearchBackAndBuildFolderPath(System.IO.Directory.GetCurrentDirectory(), "HtmlRenderer", @"..\Typography\Typography.TextBreak\icu62\brkitr"); if (!System.IO.Directory.Exists(icu_datadir)) { throw new System.NotSupportedException("dic"); } var dicProvider = new Typography.TextBreak.IcuSimpleTextFileDictionaryProvider() { DataDir = icu_datadir }; Typography.TextBreak.CustomBreakerBuilder.Setup(dicProvider); PixelFarm.CpuBlit.MemBitmapExtensions.DefaultMemBitmapIO = new ImgCodecMemBitmapIO(); //PixelFarm.CpuBlit.MemBitmapExtensions.DefaultMemBitmapIO = new PixelFarm.Drawing.WinGdi.GdiBitmapIO(); if (!PixelFarm.GLFWPlatforms.Init()) { System.Diagnostics.Debug.WriteLine("can't init glfw"); return; } LayoutFarm.Demo_MixHtml mix1 = new LayoutFarm.Demo_MixHtml(); var myApp = new MyApp(mix1); myApp.CreateMainForm(800, 600); GlfwApp.RunMainLoop(); }
static void Main() { PixelFarm.Platforms.StorageService.RegisterProvider(new YourImplementation.LocalFileStorageProvider("")); YourImplementation.FrameworkInitWinGDI.SetupDefaultValues(); YourImplementation.FrameworkInitGLES.SetupDefaultValues(); string icu_datadir = YourImplementation.RelativePathBuilder.SearchBackAndBuildFolderPath(System.IO.Directory.GetCurrentDirectory(), "HtmlRenderer", @"..\Typography\Typography.TextBreak\icu62\brkitr"); if (!System.IO.Directory.Exists(icu_datadir)) { throw new System.NotSupportedException("dic"); } var dicProvider = new Typography.TextBreak.IcuSimpleTextFileDictionaryProvider() { DataDir = icu_datadir }; Typography.TextBreak.CustomBreakerBuilder.Setup(dicProvider); PixelFarm.CpuBlit.MemBitmapExt.DefaultMemBitmapIO = new PixelFarm.Drawing.WinGdi.GdiBitmapIO(); YourImplementation.TestBedStartup.Setup(); PixelFarm.Platforms.ImageIOSetupParameters pars = new PixelFarm.Platforms.ImageIOSetupParameters(); pars.SaveToPng = (IntPtr imgBuffer, int stride, int width, int height, string filename) => { using (System.Drawing.Bitmap newBmp = new System.Drawing.Bitmap(width, height, System.Drawing.Imaging.PixelFormat.Format32bppArgb)) { PixelFarm.CpuBlit.BitmapHelper.CopyToGdiPlusBitmapSameSize(imgBuffer, newBmp); //save newBmp.Save(filename); } }; pars.ReadFromMemStream = (System.IO.MemoryStream ms, string kind) => { //read //TODO: review here again using (System.Drawing.Bitmap gdiBmp = new System.Drawing.Bitmap(ms)) { PixelFarm.CpuBlit.MemBitmap memBmp = new PixelFarm.CpuBlit.MemBitmap(gdiBmp.Width, gdiBmp.Height); //#if DEBUG // memBmp._dbugNote = "img; //#endif PixelFarm.CpuBlit.BitmapHelper.CopyFromGdiPlusBitmapSameSizeTo32BitsBuffer(gdiBmp, memBmp); return(memBmp); } }; PixelFarm.Platforms.ImageIOPortal.Setup(pars); //------------------------------- Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); ////------------------------------- formDemoList = new LayoutFarm.Dev.FormDemoList(); formDemoList.LoadDemoList(typeof(Program).Assembly); LoadHtmlSamples(formDemoList.SamplesTreeView); Application.Run(formDemoList); }
public Form1() { InitializeComponent(); var dicProvider = new Typography.TextBreak.IcuSimpleTextFileDictionaryProvider() { DataDir = "../../../../../Typography.TextBreak/icu62/brkitr" }; Typography.TextBreak.CustomBreakerBuilder.Setup(dicProvider); this.Load += new System.EventHandler(this.Form1_Load); // //Woff WoffDefaultZlibDecompressFunc.DecompressHandler = (byte[] compressedBytes, byte[] decompressedResult) => { //ZLIB //**** //YOU can change to your prefer decode libs*** //**** bool result = false; try { var inflater = new ICSharpCode.SharpZipLib.Zip.Compression.Inflater(); inflater.SetInput(compressedBytes); inflater.Inflate(decompressedResult); #if DEBUG long outputLen = inflater.TotalOut; if (outputLen != decompressedResult.Length) { } #endif result = true; } catch (Exception ex) { } return(result); }; //Woff2 Woff2DefaultBrotliDecompressFunc.DecompressHandler = (byte[] compressedBytes, Stream output) => { //BROTLI //**** //YOU can change to your prefer decode libs*** //**** bool result = false; try { using (MemoryStream ms = new MemoryStream(compressedBytes)) { ms.Position = 0;//set to start pos DecompressAndCalculateCrc1(ms, output); // // //Decompress(ms, output); } //DecompressBrotli(compressedBytes, output); result = true; } catch (Exception ex) { } return(result); }; }