protected override void CreateDrawTextListMain(List <List <Tuple <Brush, GlyphRun> > > textDrawLists) { var ItemFontNormal = ItemFontCache.ItemFont(this.EpgStyle().FontName, false); var ItemFontTitle = ItemFontCache.ItemFont(this.EpgStyle().FontNameTitle, this.EpgStyle().FontBoldTitle); var DictionaryNormal = viewData.ReplaceDictionaryNormal; var DictionaryTitle = viewData.ReplaceDictionaryTitle; bool extraInfo = PopUpMode == true?this.EpgStyle().EpgExtInfoPopup : this.EpgStyle().EpgExtInfoTable; double sizeTitle = this.EpgStyle().FontSizeTitle; double sizeMin = Math.Max(sizeTitle - 1, Math.Min(sizeTitle, this.EpgStyle().FontSize)); double sizeNormal = this.EpgStyle().FontSize; double indentTitle = sizeMin * CulcRenderWidth("0", ItemFontNormal) * (2 + sizeTitle / sizeMin); string indentHours = new string(' ', 1 + (int)(CulcRenderWidth("00:", ItemFontNormal) / CulcRenderWidth(" ", ItemFontNormal))); double indentNormal = this.EpgStyle().EpgTitleIndent ? indentTitle : 0; foreach (ProgramViewItem info in Items) { var textDrawList = new List <Tuple <Brush, GlyphRun> >(); textDrawLists.Add(textDrawList); Rect drawRect = TextRenderRect(info); info.TitleDrawErr = sizeTitle > drawRect.Height; Brush colorTitle = info.Filtered ? this.EpgBrushCache().TitleFilteredColor : this.EpgBrushCache().TitleColor; Brush colorNormal = info.Filtered ? this.EpgBrushCache().NormalFilteredColor : this.EpgBrushCache().NormalColor; //分 string min = info.Data.StartTimeFlag == 0 ? "?" : info.Data.start_time.ToString(info.DrawHours ? "HH\\:mm" : "mm"); double useHeight = sizeNormal / 3 + RenderText(textDrawList, min, ItemFontTitle, sizeMin, drawRect, 0, 0, colorTitle); //番組情報 if (info.Data.ShortInfo != null) { string title = (info.DrawHours ? indentHours : null) + CommonManager.ReplaceText(info.Data.ShortInfo.event_name.TrimEnd(), DictionaryTitle); useHeight = sizeTitle / 3 + RenderText(textDrawList, title, ItemFontTitle, sizeTitle, drawRect, indentTitle, 0, colorTitle); //説明 if (useHeight < drawRect.Height) { string detail = info.Data.ShortInfo.text_char.TrimEnd('\r', '\n'); detail += extraInfo == false || info.Data.ExtInfo == null ? "" : "\r\n\r\n" + info.Data.ExtInfo.text_char; detail = CommonManager.ReplaceText(detail.TrimEnd(), DictionaryNormal); if (detail != "") { useHeight += sizeNormal / 3 + RenderText(textDrawList, detail, ItemFontNormal, sizeNormal, drawRect, indentNormal, useHeight, colorNormal); } } } SaveMaxRenderHeight(useHeight); } }
protected override void CreateDrawTextListMain(List <List <Tuple <Brush, GlyphRun> > > textDrawLists) { var ItemFontNormal = ItemFontCache.ItemFont(Settings.Instance.FontName, false); var ItemFontTitle = ItemFontCache.ItemFont(Settings.Instance.FontNameTitle, Settings.Instance.FontBoldTitle); double sizeTitle = Settings.Instance.FontSizeTitle; double sizeMin = Math.Max(sizeTitle - 1, Math.Min(sizeTitle, Settings.Instance.FontSize)); double sizeNormal = Settings.Instance.FontSize; double indentTitle = sizeMin * 1.7; double indentNormal = Settings.Instance.EpgTitleIndent ? indentTitle : 0; Brush colorTitle = CommonManager.Instance.CustTitle1Color; Brush colorNormal = CommonManager.Instance.CustTitle2Color; foreach (ProgramViewItem info in Items) { var textDrawList = new List <Tuple <Brush, GlyphRun> >(); textDrawLists.Add(textDrawList); Rect drawRect = TextRenderRect(info); info.TitleDrawErr = sizeTitle > drawRect.Height; //分 string min = info.Data.StartTimeFlag == 0 ? "?" : info.Data.start_time.Minute.ToString("d02"); double useHeight = sizeNormal / 3 + RenderText(textDrawList, min, ItemFontTitle, sizeMin, drawRect, 0, 0, colorTitle); //番組情報 if (info.Data.ShortInfo != null) { //タイトル string title = CommonManager.ReplaceText(info.Data.ShortInfo.event_name.TrimEnd(), ReplaceDictionaryTitle); useHeight = sizeTitle / 3 + RenderText(textDrawList, title, ItemFontTitle, sizeTitle, drawRect, indentTitle, 0, colorTitle); //説明 if (useHeight < drawRect.Height) { string detail = info.Data.ShortInfo.text_char.TrimEnd('\r', '\n'); detail += ExtInfoMode == false || info.Data.ExtInfo == null ? "" : "\r\n\r\n" + info.Data.ExtInfo.text_char; detail = CommonManager.ReplaceText(detail.TrimEnd(), ReplaceDictionaryNormal); if (detail != "") { useHeight += sizeNormal / 3 + RenderText(textDrawList, detail, ItemFontNormal, sizeNormal, drawRect, indentNormal, useHeight, colorNormal); } } } SaveMaxRenderHeight(useHeight); } }
protected override void CreateDrawTextListMain(List <List <Tuple <Brush, GlyphRun> > > textDrawLists) { var ItemFontNormal = ItemFontCache.ItemFont(Settings.Instance.TunerFontName, false); var ItemFontTitle = ItemFontCache.ItemFont(Settings.Instance.TunerFontNameService, Settings.Instance.TunerFontBoldService); EpgSetting set = Settings.Instance.EpgSettingList.FirstOrDefault(s => s.ApplyReplacePatternTuner); var DictionaryTitle = set != null?CommonManager.GetReplaceDictionaryTitle(set) : null; bool recSettingInfo = PopUpMode == true ? Settings.Instance.TunerPopupRecinfo : false; bool noWrap = PopUpMode == true ? false : Settings.Instance.TunerServiceNoWrap; double sizeTitle = Settings.Instance.TunerFontSizeService; double sizeMin = Math.Max(sizeTitle - 1, Math.Min(sizeTitle, Settings.Instance.TunerFontSize)); double sizeNormal = Settings.Instance.TunerFontSize; double indentTitle = recSettingInfo ? 0 : sizeMin *CulcRenderWidth("0", ItemFontNormal) * (2 + sizeTitle / sizeMin); double indentNormal = Settings.Instance.TunerTitleIndent ? indentTitle : 0; Brush colorNormal = Settings.BrushCache.CustTunerTextColor; //録画中のものを後で描画する Items = Items.Cast <TunerReserveViewItem>().OrderBy(info => info.Data.IsOnRec()).ToList(); foreach (TunerReserveViewItem info in Items) { var textDrawList = new List <Tuple <Brush, GlyphRun> >(); textDrawLists.Add(textDrawList); Rect drawRect = TextRenderRect(info); double useHeight = 0; //追加情報の表示 if (recSettingInfo == true) { var resItem = new ReserveItem(info.Data); string text = info.Status; if (text != "") { useHeight = sizeNormal / 5 + RenderText(textDrawList, text, ItemFontNormal, sizeNormal, drawRect, 0, 0, resItem.StatusColor); } text = resItem.StartTimeShort; text += "\r\n" + "優先度 : " + resItem.Priority; text += "\r\n" + "録画モード : " + resItem.RecMode; useHeight += sizeNormal / 2 + RenderText(textDrawList, text, ItemFontNormal, sizeNormal, drawRect, 0, useHeight, info.ServiceColor); } else { //分のみ RenderText(textDrawList, info.Data.StartTime.ToString("mm"), ItemFontNormal, sizeMin, drawRect, 0, 0, info.ServiceColor); } //サービス名 string serviceName = info.Data.StationName + "(" + CommonManager.ConvertNetworkNameText(info.Data.OriginalNetworkID) + ")"; serviceName = CommonManager.ReplaceText(serviceName, DictionaryTitle); useHeight += sizeTitle / 3 + RenderText(textDrawList, serviceName, ItemFontTitle, sizeTitle, drawRect, indentTitle, useHeight, info.ServiceColor, noWrap); //番組名 if (useHeight < drawRect.Height) { string title = CommonManager.ReplaceText(info.Data.Title.TrimEnd(), DictionaryTitle); if (title != "") { useHeight += sizeNormal / 3 + RenderText(textDrawList, title, ItemFontNormal, sizeNormal, drawRect, indentNormal, useHeight, colorNormal); } } SaveMaxRenderHeight(useHeight); } }