Пример #1
0
        /// <summary>
        /// Decompose the Doom 3 font into individual character images.
        /// It also applies The Dark Mod's code page conversion.
        /// To ignore any conversions and use iso-8859-1 code page choose "english" language.
        /// </summary>
        /// <param name="d3FontInputFileName">Doom 3 .dat font file.</param>
        /// <param name="dirWithFontTextures">Path to directory containing font textures, like "arial_0_48.dds".</param>
        /// <param name="lang">The Dark Mod's language to use. Can be "english", "polish", "german", etc.</param>
        /// <param name="dirWithLangMaps">Optional: Directory containing The Dark Mod's code page remapping maps, like "polish.map".</param>
        /// <param name="zeroSizeImage">Optional: image that have 0x0 size.</param>
        /// <param name="bmConfigFile">File to output BMFont's external image configuration to.</param>
        /// <param name="imageOutputDir">Directory into which output character images.</param>
        public static void decomposeD3(DecomposeD3Options options)
        {
            D3Font d3Font = new D3Font();

            d3Font.Load(options.d3FontInputFileName);

            if (!File.Exists(options.bmConfigFile))
            {
                File.Create(options.bmConfigFile).Dispose();
            }

            IList <string> bmIcons = D3FontDecompose.Decompose(
                d3Font,
                options.dirWithFontTextures,
                options.langs,
                options.dirWithLangMaps,
                options.zeroSizeImage,
                options.imageOutputDir
                );

            IList <string> bmConfig = File.ReadAllLines(options.bmConfigFile).ToList();

            var noIconsConfig = from line in bmConfig
                                where !line.StartsWith("icon=")
                                select line;

            var newConfig = (options.bmConfigAppend ? bmConfig : noIconsConfig).Union(bmIcons);

            File.WriteAllLines(options.bmConfigFile, newConfig);
        }
Пример #2
0
        /// <summary>
        /// Decompose the Doom 3 font into individual character images.
        /// It also applies The Dark Mod's code page conversion.
        /// To ignore any conversions and use iso-8859-1 code page choose "english" language.
        /// </summary>
        /// <param name="font">Doom 3 font</param>
        /// <param name="dirWithFontTextures">Path to directory containing font textures, like "arial_0_48.dds".</param>
        /// <param name="lang">The Dark Mod's language to use. Can be "english", "polish", "german", etc.</param>
        /// <param name="dirWithLangMaps">Optional: Directory containing The Dark Mod's code page remapping maps, like "polish.map".</param>
        /// <param name="zeroSizeImage">Optional: image that have 0x0 size.</param>
        /// <param name="bmConfigFile">File to output BMFont's external image configuration to.</param>
        /// <param name="imageOutputDir">Directory into which output character images.</param>
        public static IList <string> Decompose(D3Font font, string dirWithFontTextures, string[] langs, string dirWithLangMaps, string zeroSizeImage, string imageOutputDir)
        {
            var fontDecomposer = new D3FontDecompose(font, dirWithFontTextures, langs, dirWithLangMaps, zeroSizeImage, imageOutputDir);

            return(fontDecomposer.Decompose());
        }
Пример #3
0
 /// <summary>
 /// Decompose the Doom 3 font into individual character images.
 /// It also applies The Dark Mod's code page conversion.
 /// To ignore any conversions and use iso-8859-1 code page choose "english" language.
 /// </summary>
 /// <param name="font">Doom 3 font</param>
 /// <param name="dirWithFontTextures">Path to directory containing font textures, like "arial_0_48.dds".</param>
 /// <param name="lang">The Dark Mod's language to use. Can be "english", "polish", "german", etc.</param>
 /// <param name="dirWithLangMaps">Optional: Directory containing The Dark Mod's code page remapping maps, like "polish.map".</param>
 /// <param name="zeroSizeImage">Optional: image that have 0x0 size.</param>
 /// <param name="bmConfigFile">File to output BMFont's external image configuration to.</param>
 /// <param name="imageOutputDir">Directory into which output character images.</param>
 public static IList<string> Decompose(D3Font font, string dirWithFontTextures, string[] langs, string dirWithLangMaps, string zeroSizeImage, string imageOutputDir)
 {
     var fontDecomposer = new D3FontDecompose(font, dirWithFontTextures, langs, dirWithLangMaps, zeroSizeImage, imageOutputDir);
     return fontDecomposer.Decompose();
 }