コード例 #1
0
 public void Convert(MieFontWeights en)
 {
     for (var i = 0; i < this.Items.Count; i++)
     {
         this.Items[i].ItalicTypeFaceFileID  = en.Items[i].ItalicTypeFaceFileID;
         this.Items[i].ItalicTypeFacePathID  = en.Items[i].ItalicTypeFacePathID;
         this.Items[i].RegularTypeFaceFildID = en.Items[i].RegularTypeFaceFildID;
         this.Items[i].RegularTypeFacePathID = en.Items[i].RegularTypeFacePathID;
     }
 }
コード例 #2
0
        public static MieFontWeights Read(BinaryReader reader)
        {
            MieFontWeights result = new MieFontWeights();

            result.NumOfFontWeights = reader.ReadInt32();
            for (int i = 0; i < result.NumOfFontWeights; i++)
            {
                MieFontWeightEntry entry = MieFontWeightEntry.Read(reader);
                result.Items.Add(entry);
            }

            return(result);
        }
コード例 #3
0
        public static MieFontFooter Read(BinaryReader br, MieFont.NFormatType formatType)
        {
            MieFontFooter result = new MieFontFooter();

            switch (formatType)
            {
            case MieFont.NFormatType.Unknown:
                break;

            case MieFont.NFormatType.Type1:
                break;

            case MieFont.NFormatType.Type2:
                //// 日本語データの構造
                result.KerningTable = MieFontKerningTable.Read(br, MieFont.NFormatType.Type2);

                result.KerningPairBase = new MieFontKerningPairType2();
                result.KerningPairBase.Read(br);

                result.FontFallbackFontAssets = MieFontFallbackFontAssets.Read(br);

                break;

            case MieFont.NFormatType.Type3:
                break;

            case MieFont.NFormatType.Type4:
                break;

            case MieFont.NFormatType.Type5:
                break;

            case MieFont.NFormatType.PoE2:
                //// オリジナルのデータ構造
                result.KerningTable = MieFontKerningTable.Read(br, MieFont.NFormatType.PoE2);

                result.KerningPairBase = new MieFontKerningPairPoE2();
                result.KerningPairBase.Read(br);

                result.LigaturesFileID = br.ReadInt32();
                result.LigaturesPathID = br.ReadInt64();

                result.InumStartAt   = br.ReadInt32();
                result.IsIlluminated = br.ReadBoolean();
                MieFont.ReadPadding(br);

                result.FontFallbackFontAssets = MieFontFallbackFontAssets.Read(br);

                break;

            default:
                throw new Exception($"Unknown format type({formatType}).");
            }

            ////

            result.FontCreationSetting = MieFontCreationSetting.Read(br);

            ////

            result.FontWeights = MieFontWeights.Read(br);

            result.NormalStyle          = br.ReadSingle();
            result.NormalSpaceingOffset = br.ReadSingle();
            result.BoldStyle            = br.ReadSingle();
            result.BoldSpacing          = br.ReadSingle();
            result.ItalicStyle          = br.ReadInt32();
            result.TabSize = br.ReadInt32();

            return(result);
        }