/// <summary> /// 新しいフォントマップから変換する。 /// </summary> /// <param name="jp">新しいフォントマップ</param> public void Convert(FsbBMFontMap jp) { //// 必要最低限の情報のみ変換する。 this.BMFontSize = jp.FontSize; this.BMFontBase = jp.FontBase; this.BMFontWidth = jp.ImageWidth; this.BMFontHeight = jp.ImageHeight; ////this.GameObjectFileID ////this.GameObjectPathID ////this.GameObjectEnables ////this.MaterialFileID ////this.MaterialPathID ////this.ScriptFileID ////this.ScriptPathID ////this.ScriptNameLength ////this.ScriptName ////this.SpriteNameLength ////this.SpriteName ////this.UVRectX ////this.UVRectY ////this.UVRectWidth ////this.UVRectHeight }
/// <summary> /// 座標情報(jp)に座標情報(en)をマージする。 /// </summary> /// <param name="en">座標情報(英語)</param> /// <param name="jp">座標情報(日本語)</param> /// <param name="replacedList">置換されたCharacterIDを格納</param> /// <param name="offsetX">オフセットX</param> /// <param name="offsetY">オフセットY</param> /// <returns>マージ後の座標情報</returns> public static FsbFont Merge( FsbFont en, FsbBMFontMap jp, StringBuilder replacedList, int offsetX, int offsetY) { var newFont = new FsbFont(); //// オリジナルのHeaderをセットする。 newFont.Header.SetHeader(en.Header); if (jp != null) { //// Headerの情報の一部を日本語のものに変換する。 newFont.Header.Convert(jp); //// 座標情報(日本語版)をセットする。 var rc = newFont.FontEntries.UpsertEntries(jp.Items, offsetX, offsetY); foreach (var characterID in rc) { //// 登録できなかったCharacterIDを記録する。 replacedList.AppendLine($"{characterID}"); } } //// オリジナルのFooterをセットする。 newFont.Footer.SetFooter(en.Footer); return(newFont); }