コード例 #1
0
        void LoadFonts(FontsIni fonts, RichFontsIni rf, FileSystem fs, string dataPath)
        {
            var d = dataPath.Replace('\\', Path.DirectorySeparatorChar);

            foreach (var f in fonts.FontFiles)
            {
                Platform.AddTtfFile(fs.Resolve(Path.Combine(d, f)));
            }
            nicknames = new Dictionary <string, string>(StringComparer.OrdinalIgnoreCase);
            foreach (var id in fonts.UIFonts)
            {
                nicknames[id.Nickname] = id.Font;
            }
            infocardFonts = new Dictionary <int, FontDescription>();
            var v = new FontDescription()
            {
                FontName = "Agency FB", FontSize = 16
            };

            infocardFonts.Add(-1, v);
            foreach (var f in rf.Fonts)
            {
                var desc = new FontDescription()
                {
                    FontName = f.Name, FontSize = f.Size
                };
                infocardFonts.Add(f.Index, desc);
            }
            _loaded = true;
        }
コード例 #2
0
        void LoadFonts(FontsIni fonts, RichFontsIni rf, FileSystem fs, string dataPath)
        {
            foreach (var f in fonts.FontFiles)
            {
                var path = fs.Resolve(dataPath + f, false);
                if (path == null)
                {
                    FLLog.Error("Fonts", "Could not find ttf file " + dataPath + f);
                }
                Platform.AddTtfFile(path);
            }
            nicknames = new Dictionary <string, string>(StringComparer.OrdinalIgnoreCase);
            foreach (var id in fonts.UIFonts)
            {
                nicknames[id.Nickname] = id.Font;
            }
            infocardFonts = new Dictionary <int, FontDescription>();
            var v = new FontDescription()
            {
                FontName = "Agency FB", FontSize = 16
            };

            infocardFonts.Add(-1, v);
            foreach (var f in rf.Fonts)
            {
                var desc = new FontDescription()
                {
                    FontName = f.Name, FontSize = f.Size
                };
                infocardFonts.Add(f.Index, desc);
            }
            _loaded = true;
        }
コード例 #3
0
        public void LoadFontsFromIni(FreelancerIni fl, FileSystem fs)
        {
            var rf = new RichFontsIni();

            foreach (var file in fl.RichFontPaths)
            {
                rf.AddRichFontsIni(file, fs);
            }
            var fn = new FontsIni();

            foreach (var file in fl.FontPaths)
            {
                fn.AddFontsIni(file, fs);
            }
            LoadFonts(fn, rf, fs, fl.DataPath);
        }