public void Convert(
            MieFontHeader jp,
            MieFont.NFormatType formatType,
            bool forceAdjustAscender)
        {
            ////this.GameObjectFileID = jp.GameObjectFileID;
            ////this.GameObjectPathID = jp.GameObjectPathID;
            ////this.GameObjectEnables = jp.GameObjectEnables;

            ////this.ScriptFileID = jp.ScriptFileID;
            ////this.ScriptPathID = jp.ScriptPathID;
            ////this.FileNameLength = jp.FileNameLength;
            ////this.FileName = jp.FileName;

            ////this.FileNameHashCode = jp.FileNameHashCode;
            ////this.MaterialFileID = jp.MaterialFileID;
            ////this.MaterialPathID = jp.MaterialPathID;
            ////this.MaterialHashCode = jp.MaterialHashCode;
            ////this.FontAssetType = jp.FontAssetType;
            ////this.LengthOfFontName = jp.LengthOfFontName;

            ////this.InternalFileName = jp.InternalFileName;

            this.FontInfo.Convert(jp.FontInfo, formatType, forceAdjustAscender);

            ////this.AtlasFileID = jp.AtlasFileID;
            ////this.AtlasPathID = jp.AtlasPathID;
        }
        /// <summary>
        /// Reade Header.
        /// </summary>
        /// <param name="reader">reader</param>
        /// <param name="formatType">TMPのフォーマットタイプ。</param>
        /// <returns>Header</returns>
        public static MieFontHeader Read(BinaryReader reader, MieFont.NFormatType formatType)
        {
            var result = new MieFontHeader();

            result.GameObjectFileID  = reader.ReadInt32();
            result.GameObjectPathID  = reader.ReadInt64();
            result.GameObjectEnables = reader.ReadBoolean();
            MieFont.ReadPadding(reader);

            result.ScriptFileID = reader.ReadInt32();
            result.ScriptPathID = reader.ReadInt64();

            result.FileName = MieFont.ReadString(reader);

            result.FileNameHashCode = reader.ReadInt32();
            result.MaterialFileID   = reader.ReadInt32();
            result.MaterialPathID   = reader.ReadInt64();
            result.MaterialHashCode = reader.ReadInt32();
            result.FontAssetType    = reader.ReadInt32();

            result.FontInfo = new MieFontInfo(formatType);
            result.FontInfo.Read(reader, formatType);

            result.AtlasFileID = reader.ReadInt32();
            result.AtlasPathID = reader.ReadInt64();

            return(result);
        }
Beispiel #3
0
 public void Load(string path, NFormatType formatType)
 {
     using (BinaryReader br = new BinaryReader(File.OpenRead(path), Encoding.UTF8))
     {
         this.Header      = MieFontHeader.Read(br, formatType);
         this.FontEntries = MieFontEntries.Read(br);
         this.Footer      = MieFontFooter.Read(br, formatType);
     }
 }