예제 #1
0
파일: GameFont.cs 프로젝트: ByteChkR/Minor
        /// <summary>
        /// Creates the default font from embedded program resources
        /// </summary>
        /// <returns>The Default font</returns>
        private static GameFont GetDefaultFont()
        {
            Assembly asm = Assembly.GetExecutingAssembly();

            string[] paths = asm.GetManifestResourceNames();
            string   path  = asm.GetName().Name + "._DefaultResources.DefaultFont.ttf";

            using (Stream resourceStream = asm.GetManifestResourceStream(path))
            {
                if (resourceStream == null)
                {
                    Logger.Crash(new EngineException("Could not load default font"), false);
                    return(null);
                }

                GameFont f = FontLibrary.LoadFontInternal(resourceStream, 32, out string name);
                resourceStream.Close();
                return(f);
            }
        }
예제 #2
0
 /// <summary>
 /// Creates the default font from embedded program resources
 /// </summary>
 /// <returns>The Default font</returns>
 private static GameFont GetDefaultFont()
 {
     return(FontLibrary.LoadFontInternal(IOManager.GetStream(DefaultFontPath), 32, out string name));
 }