// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Collections.Generic;
using System.Windows.Media;
using System.Windows.Media.TextFormatting;
using Tango.Scripting.Editors.Utils;
namespace Tango.Scripting.Editors.Rendering
{
sealed class TextViewCachedElements : IDisposable
{
TextFormatter formatter;
Dictionary<string, TextLine> nonPrintableCharacterTexts;
public TextLine GetTextForNonPrintableCharacter(string text, ITextRunConstructionContext context)
{
if (nonPrintableCharacterTexts == null)
nonPrintableCharacterTexts = new Dictionary<string, TextLine>();
TextLine textLine;
if (!nonPrintableCharacterTexts.TryGetValue(text, out textLine)) {
var p = new VisualLineElementTextRunProperties(contextMainView.xaml.cs