예제 #1
0
        private static void ConsoleMode(string[] args)
        {
            bool processed = false;
            NftrFont font;

            // Import mode
            if (args[0] == "-i" && args.Length == 4) {
                processed = true;
                Console.WriteLine("Importing from:\n\t{0}\n\t{1}\nto:\n\t{2}", args[1], args[2], args[3]);
                font = new NftrFont(args[1], args[2]);
                font.Write(args[3]);
            }

            // Export mode
            if (args[0] == "-e" && args.Length == 4) {
                processed = true;
                Console.WriteLine("Exporting from:\n\t{0}\nto:\n\t{1}\n\t{2}", args[1], args[2], args[3]);
                font = new NftrFont(args[1]);
                font.Export(args[2], args[3]);
            }

            // Export to basic json
            if (args[0] == "-ejson" && args.Length == 3) {
                processed = true;
                Console.WriteLine("Exporting from:\n\t{0}\nto:\n\t{1}", args[1], args[2]);
                font = new NftrFont(args[1]);
                font.ExportInfoIntoJson(args[2]);
            }

            if (!processed)
                PrintHelp();

            Console.WriteLine();
            Console.WriteLine("Done!");
        }
예제 #2
0
        public NftrLabel(LabelInfo info)
            : base(info)
        {
            font      = new NftrFont(info.Fontpath.FixPath());
            extraGap  = 2;  // Constant present (at least in Ninokuni game).
            extraGap += 3;  // Furigana font box height (Hard coded for Spanish trans).
            alignment = info.Alignment;

            Text = info.DefaultText;
            Text = Text.Replace("{!SP}", " ");
        }
예제 #3
0
        private static void TestSingle()
        {
            string fontPath = "/var/run/media/benito/2038A2E238A2B5E6";
            fontPath += "/nds/projects/NDS/NerdFontTerminatoR/files/";
            fontPath += "Ninokuni [CLEAN]/4096_font_b9.NFTR";

            string outPath = "/home/benito/";
            outPath += "test";

            NftrFont font = new NftrFont(fontPath);
            font.Export(outPath + ".xml", outPath + ".png");

            font = new NftrFont(outPath + ".xml", outPath + ".png");
            font.Write(outPath + ".new");

            Console.WriteLine("{0} written.",
                              CompareFiles(fontPath, outPath + ".new") ? "Successfully" : "Unsuccessfully");
        }
예제 #4
0
        private static void TestWork()
        {
            //string fin   = @"C:\Users\Benito\Documents\My Dropbox\Ninokuni español\Fuentes\"; //@"G:\nds\projects\ninokuni\";
            string fout  = @"C:\Users\Benito\Documents\My Dropbox\Ninokuni español\Fuentes\"; //@"G:\nds\projects\ninokuni\";
            string fname = "font_b16";

            //NftrFont fold = new NftrFont(fin + fname + ".NFTR");
            //fold.Export(fout + fname + ".xml", fout + fname + ".png");

            NftrFont fnew = new NftrFont(fout + fname + ".xml", fout + fname + "_VERSION1.png");
            fnew.Write(fout + fname + "_new.NFTR");
        }
예제 #5
0
        private static void TestFull()
        {
            string fontPath = "/var/run/media/benito/2038A2E238A2B5E6";
            fontPath += "/nds/projects/NDS/NerdFontTerminatoR/files/";

            string outPath = "/home/benito/Proyectos/Fonts";

            foreach (string dir in Directory.GetDirectories(fontPath)) {
                string fontDirOut = Path.Combine(outPath, new DirectoryInfo(dir).Name);
                if (!Directory.Exists(fontDirOut))
                    Directory.CreateDirectory(fontDirOut);

                foreach (string f in Directory.GetFiles(dir)) {
                    string fontOut = Path.Combine(fontDirOut, Path.GetFileNameWithoutExtension(f));
                    Console.WriteLine(fontOut);
                    //if (File.Exists(fontOut + ".png"))
                    //	continue;

                    try {
                        NftrFont font = new NftrFont(f);
                        if (!font.Check())
                            return;
                        //font.Export(fontOut + ".xml", fontOut + ".png");

                        //MemoryStream ms = new MemoryStream();
                        //font.Write(ms);
                        //font.Write(fontOut + ".new");
                        //if (!CompareFiles(fontOut + ".new", f))
                        //	return;
                    } catch (Exception ex) {
                        Console.WriteLine("--> ERROR: {0}\n{1}", ex.Message, ex.StackTrace);
                    }
                }
            }
        }