public FrameworkDebugOverlay(IFrameworkMessenger frameworkMessenger, IDebugAnalytics debugAnalytics, IFramesPerSecondMonitor fpsMonitor, ISystemComponents systemComponents, IDrawStageRenderer drawStageRenderer, IIdGenerator idGenerator, IDrawQueueFactory drawQueueFactory, IDrawQueueGroupFactory drawQueueGroupFactory, IQueueToBufferBlitter queueToBufferBlitter, IDrawStageBuffersFactory drawStageBuffersFactory, IDrawStageBatcherFactory drawStageBatcherFactory, IFontManager fontManager ) { _frameworkMessenger = frameworkMessenger; _debugAnalytics = debugAnalytics; _fpsMonitor = fpsMonitor; _systemComponents = systemComponents; _drawStageRenderer = drawStageRenderer; _idGenerator = idGenerator; _drawQueueFactory = drawQueueFactory; _drawQueueGroupFactory = drawQueueGroupFactory; _queueToBufferBlitter = queueToBufferBlitter; _drawStageBuffersFactory = drawStageBuffersFactory; _drawStageBatcherFactory = drawStageBatcherFactory; _fontManager = fontManager; Visible = false; ReInitialise(); }
public Graphics(IStartupPropertiesCache startUpPropertiesCache, ISystemComponents systemComponents, IRenderCommandQueue renderCommandQueue, ICommandProcessor commandProcessor, IRenderStageManager renderStageManager, IRenderStageVisitor renderStageVisitor, IGpuSurfaceManager surfaceManager, IViewportManager viewportManager, IFontManager fontManager, ICameraManager cameraManager, IFrameworkDebugOverlay debugOverlay) { _startUpPropertiesCache = startUpPropertiesCache; _systemComponents = systemComponents; _renderCommandQueue = renderCommandQueue; _commandProcessor = commandProcessor; _renderStageManager = renderStageManager; _renderStageVisitor = renderStageVisitor; _surfaceManager = surfaceManager; _viewportManager = viewportManager; _fontManager = fontManager; _cameraManager = cameraManager; _debugOverlay = debugOverlay; Initialise(); }
public static void UpdateFont(this TextElement nativeControl, Font font, IFontManager fontManager) { nativeControl.FontSize = fontManager.GetFontSize(font); nativeControl.FontFamily = fontManager.GetFontFamily(font); nativeControl.FontStyle = font.FontAttributes.ToFontStyle(); nativeControl.FontWeight = font.FontAttributes.ToFontWeight(); }
public static void UpdateFont(this MauiTextBox nativeControl, Font font, IFontManager fontManager) { nativeControl.FontSize = fontManager.GetFontSize(font); nativeControl.FontFamily = fontManager.GetFontFamily(font); nativeControl.FontStyle = font.ToFontStyle(); nativeControl.FontWeight = font.ToFontWeight(); }
public ShellPageRendererTracker(IShellContext context) { _context = context; _nSCache = new NSCache(); _context.Shell.PropertyChanged += HandleShellPropertyChanged; _fontManager = context.Shell.RequireFontManager(); }
public static NSAttributedString ToNSAttributedString( this FormattedString formattedString, IFontManager fontManager, double defaultLineHeight = 0d, // TODO: NET7 should be -1, but too late to change for net6 TextAlignment defaultHorizontalAlignment = TextAlignment.Start, Font?defaultFont = null, Color?defaultColor = null, TextTransform defaultTextTransform = TextTransform.Default) { if (formattedString == null) { return(new NSAttributedString(string.Empty)); } var attributed = new NSMutableAttributedString(); for (int i = 0; i < formattedString.Spans.Count; i++) { Span span = formattedString.Spans[i]; if (span.Text == null) { continue; } attributed.Append(span.ToNSAttributedString(fontManager, defaultLineHeight, defaultHorizontalAlignment, defaultFont, defaultColor, defaultTextTransform)); } return(attributed); }
protected virtual void LoadFonts(IFontManager fontManager) { using (var stream = typeof(Application).Assembly.GetManifestResourceStream("CrossX.Framework.Styles.Fonts.FluentSystemIcons-Filled.ttf")) { fontManager.LoadTTF(stream); } }
public static Tuple <Run, Color, Color> ToRunAndColorsTuple(this Span span, IFontManager fontManager, Font?defaultFont = null, Color?defaultColor = null, TextTransform defaultTextTransform = TextTransform.Default) { var transform = span.TextTransform != TextTransform.Default ? span.TextTransform : defaultTextTransform; var text = TextTransformUtilites.GetTransformedText(span.Text, transform); var run = new Run { Text = text ?? string.Empty }; var font = span.ToFont(); if (font.IsDefault && defaultFont.HasValue) { font = defaultFont.Value; } if (!font.IsDefault) { run.ApplyFont(font, fontManager); } if (span.IsSet(Span.TextDecorationsProperty)) { run.TextDecorations = (global::Windows.UI.Text.TextDecorations)span.TextDecorations; } run.CharacterSpacing = span.CharacterSpacing.ToEm(); return(Tuple.Create(run, span.TextColor, span.BackgroundColor)); }
internal static UIImage?GetPlatformImage(this IFontImageSource imageSource, IFontManager fontManager, float scale) { var font = fontManager.GetFont(imageSource.Font); var color = (imageSource.Color ?? Colors.White).ToPlatform(); var glyph = (NSString)imageSource.Glyph; var attString = new NSAttributedString(glyph, font, color); var imagesize = glyph.GetSizeUsingAttributes(attString.GetUIKitAttributes(0, out _)); UIGraphics.BeginImageContextWithOptions(imagesize, false, scale); var ctx = new NSStringDrawingContext(); var boundingRect = attString.GetBoundingRect(imagesize, 0, ctx); attString.DrawString(new CGRect( imagesize.Width / 2 - boundingRect.Size.Width / 2, imagesize.Height / 2 - boundingRect.Size.Height / 2, imagesize.Width, imagesize.Height)); var image = UIGraphics.GetImageFromCurrentImageContext(); UIGraphics.EndImageContext(); return(image.ImageWithRenderingMode(UIImageRenderingMode.AlwaysOriginal)); }
public static Run ToRun(this Span span, IFontManager fontManager) { var run = new Run { Text = span.Text ?? string.Empty }; if (span.TextColor.IsNotDefault()) { run.Foreground = span.TextColor.ToPlatform(); } var font = span.ToFont(); if (!font.IsDefault) { run.ApplyFont(font, fontManager); } if (span.IsSet(Span.TextDecorationsProperty)) { run.TextDecorations = (global::Windows.UI.Text.TextDecorations)span.TextDecorations; } run.CharacterSpacing = span.CharacterSpacing.ToEm(); return(run); }
public static void UpdateFont(this UILabel nativeLabel, ILabel label, IFontManager fontManager) { var uiFont = fontManager.GetFont(label.Font); nativeLabel.Font = uiFont; nativeLabel.UpdateCharacterSpacing(label); }
public FontSpan(Font font, Context?context, float characterSpacing, TextAlignment?horizontalTextAlignment, IFontManager fontManager) { Font = font; Context = context; CharacterSpacing = characterSpacing; FontManager = fontManager; HorizontalTextAlignment = horizontalTextAlignment; }
public static void UpdateFont(this TextBlock nativeControl, Font font, IFontManager fontManager) { nativeControl.FontSize = fontManager.GetFontSize(font); nativeControl.FontFamily = fontManager.GetFontFamily(font); nativeControl.FontStyle = font.ToFontStyle(); nativeControl.FontWeight = font.ToFontWeight(); nativeControl.IsTextScaleFactorEnabled = font.AutoScalingEnabled; }
public static void UpdateFont(this UILabel nativeLabel, ILabel label, IFontManager fontManager) { var font = label.GetFont(); var uiFont = fontManager.GetFont(font); nativeLabel.Font = uiFont; }
public static void UpdateFont(this Label platformLabel, ILabel label, IFontManager fontManager) { platformLabel.BatchBegin(); platformLabel.FontSize = label.Font.Size > 0 ? label.Font.Size : 25.ToDPFont(); platformLabel.FontAttributes = label.Font.GetFontAttributes(); platformLabel.FontFamily = fontManager.GetFontFamily(label.Font.Family) ?? ""; platformLabel.BatchCommit(); }
public static Typeface ToTypeface(this Font self, IFontManager fontManager) { if (self.IsDefault) { return(fontManager.DefaultTypeface); } return(fontManager.GetTypeface(self) ?? fontManager.DefaultTypeface); }
/// <summary> /// Method used to parse common properties vor various Font versions. /// </summary> /// <param name="font"></param> /// <param name="manager"></param> protected virtual void ProcessConfiguration(Font font, IFontManager manager) { var pointReader = NegumContainer.Resolve <IPointReader>(); font.Size = pointReader.ToPointAsync(manager.Def.Size).Result; font.Spacing = pointReader.ToPointAsync(manager.Def.Spacing).Result; font.Offset = pointReader.ToPointAsync(manager.Def.Offset).Result; font.Type = manager.Def.Type; }
public AllControlsApp(IDispatcher dispatcher, IIoCFactory objectFactory, IFilesRepository filesRepository, IFontManager fontManager, IGesturesService gesturesService) { this.dispatcher = dispatcher; this.objectFactory = objectFactory; this.filesRepository = filesRepository; this.fontManager = fontManager; gesturesService.Register(this); }
public static UIFont ToUIFont(this Font self, IFontManager fontManager) { if (self.IsDefault) { return(fontManager.DefaultFont); } return(fontManager.GetFont(self) ?? fontManager.DefaultFont); }
public static void UpdateFont(this TextView textView, Font font, IFontManager fontManager) { var tf = fontManager.GetTypeface(font); textView.Typeface = tf; var sp = fontManager.GetScaledPixel(font); textView.SetTextSize(ComplexUnitType.Sp, sp); }
public FontOptionsViewModel(IFontManager fontManager) { this.fontManager = fontManager; this.FontFamilies = Fonts.SystemFontFamilies.ToObservable(); this.GetCurrentFont(); this.AcceptCommand = new Command <ICloseable>(Accept); this.CancelCommand = new Command <ICloseable>(Cancel); }
/// <summary> /// Initializes a new instance of the <see cref="FontManagerPage"/> class. /// </summary> /// <param name="display">The display.</param> /// <param name="fontManager">The font manager.</param> public FontManagerPage(IDisplay display, IFontManager fontManager) { var stack = new StackLayout(); foreach (var namedSize in Enum.GetValues(typeof(NamedSize))) { var font = Font.SystemFontOfSize((NamedSize)namedSize); var height = fontManager.GetHeight(font); var heightRequest = display.HeightRequestInInches(height); var label = new Label() { Font = font, HeightRequest = heightRequest + 10, Text = string.Format("System font {0} is {1:0.000}in tall.", namedSize, height), XAlign = TextAlignment.Center }; stack.Children.Add(label); } var f = Font.SystemFontOfSize(24); var inchFont = fontManager.FindClosest(f.FontFamily, fontSize); stack.Children.Add(new Label() { Text = "The below text should be " + fontSize + "in height from its highest point to lowest.", XAlign = TextAlignment.Center }); stack.Children.Add(new Label() { Text = "FfTtLlGgJjPp", TextColor = Color.Lime, FontSize = inchFont.FontSize, // BackgroundColor = Color.Gray, // FontFamily = inchFont.FontFamily, XAlign = TextAlignment.Center, YAlign = TextAlignment.Start }); stack.Children.Add(new Label() { Text = fontSize + "in height = SystemFontOfSize(" + inchFont.FontSize + ")", XAlign = TextAlignment.Center, YAlign = TextAlignment.End }); this.Content = stack; }
public static void UpdateInlines( this TextBlock textBlock, IFontManager fontManager, FormattedString formattedString, double defaultLineHeight = 0d, // TODO: NET7 should be -1, but too late to change for net6 TextAlignment defaultHorizontalAlignment = TextAlignment.Start, Font?defaultFont = null, Color?defaultColor = null, TextTransform defaultTextTransform = TextTransform.Default) { textBlock.Inlines.Clear(); // Have to implement a measure here, otherwise inline.ContentStart and ContentEnd will be null, when used in RecalculatePositions textBlock.Measure(new global::Windows.Foundation.Size(double.MaxValue, double.MaxValue)); var runAndColorTuples = formattedString.ToRunAndColorsTuples(fontManager, defaultLineHeight, defaultHorizontalAlignment, defaultFont, defaultColor, defaultTextTransform); var heights = new List <double>(); int currentTextIndex = 0; foreach (var runAndColorTuple in runAndColorTuples) { Run run = runAndColorTuple.Item1; Color textColor = runAndColorTuple.Item2; Color background = runAndColorTuple.Item3; heights.Add(textBlock.FindDefaultLineHeight(run)); textBlock.Inlines.Add(run); int length = run.Text.Length; if (background != null || textColor != null) { TextHighlighter textHighlighter = new TextHighlighter { Ranges = { new TextRange(currentTextIndex, length) } }; if (background != null) { textHighlighter.Background = background.ToPlatform(); } else { textHighlighter.Background = Colors.Transparent.ToPlatform(); } if (textColor != null) { textHighlighter.Foreground = textColor.ToPlatform(); } textBlock.TextHighlighters.Add(textHighlighter); } currentTextIndex += length; } }
public static void UpdateFont(this TextView textView, ITextStyle textStyle, IFontManager fontManager) { var font = textStyle.Font; var tf = fontManager.GetTypeface(font); textView.Typeface = tf; var sp = fontManager.GetFontSize(font); textView.SetTextSize(ComplexUnitType.Sp, sp); }
public UIServices(IBindingService bindingService, IFontManager fontManager, IDispatcher dispatcher, IImageCache imageCache, IAppValues appValues, IObjectFactory objectFactory, ITooltipService tooltipService) { BindingService = bindingService; FontManager = fontManager; Dispatcher = dispatcher; ImageCache = imageCache; AppValues = appValues; ObjectFactory = objectFactory; TooltipService = tooltipService; }
public ResourcesReinitialiser( IGraphicsResourceReinitialiser graphicsResourceReinitialiser, IFontManager fontManager, IGpuSurfaceManager gpuSurfaceManager, IFrameworkDebugOverlay frameworkDebugOverlay ) { _graphicsResourceReinitialiser = graphicsResourceReinitialiser; _fontManager = fontManager; _gpuSurfaceManager = gpuSurfaceManager; _frameworkDebugOverlay = frameworkDebugOverlay; }
public Drawing(IFrameworkMessenger frameworkMessenger, IRenderStageManager renderStageManager, IRenderStageVisitor renderStageVisitor, IFontManager fontManager, IGpuSurfaceManager gpuSurfaceManager) { _frameworkMessenger = frameworkMessenger; _renderStageManager = renderStageManager; _renderStageVisitor = renderStageVisitor; _fontManager = fontManager; _gpuSurfaceManager = gpuSurfaceManager; }
public static void UpdateFont(this TextView textView, ITextStyle textStyle, IFontManager fontManager) { var font = textStyle.Font; var tf = fontManager.GetTypeface(font); textView.Typeface = tf; var fontSize = fontManager.GetFontSize(font); textView.SetTextSize(fontSize.Unit, fontSize.Value); }
public static void UpdateFont(this AppCompatEditText editText, IEntry entry, IFontManager fontManager) { var font = entry.Font; var tf = fontManager.GetTypeface(font); editText.Typeface = tf; var sp = fontManager.GetScaledPixel(font); editText.SetTextSize(ComplexUnitType.Sp, sp); }
public SpaceInvadersGame() { Content.RootDirectory = "Content"; r_GraphicsMgr = new GraphicsDeviceManager(this); r_InputManager = new InputManager(this); r_SoundManager = new SoundManager(this); r_FontManager = new FontManager(this, @"Fonts\Arial"); r_SettingsManager = new SettingsManager(this); r_CollisionsManager = new CollisionsManager(this); r_ScreensMananger = new ScreensMananger(this); r_ScreensMananger.SetCurrentScreen(new WelcomeScreen(this)); }
public ShellPageRendererTracker(IShellContext context) { _context = context; _nSCache = new NSCache(); _context.Shell.PropertyChanged += HandleShellPropertyChanged; if (_context.Shell.Toolbar != null) { _context.Shell.Toolbar.PropertyChanged += OnToolbarPropertyChanged; } _fontManager = context.Shell.RequireFontManager(); }
public CloudProcessor(Options options, IWordSource wordSource, IGrammarInfoParser grammarInfoParser, GrammarFormJoiner grammarFormJoiner, IWordFilter[] wordFilters, IFontManager fontManager, ICloudGenerator cloudGenerator, IColorManager colorManager, ICloudRenderer cloudRenderer) { this.wordSource = wordSource; this.grammarInfoParser = grammarInfoParser; this.grammarFormJoiner = grammarFormJoiner; this.wordFilters = wordFilters; wordCount = options.Count; this.fontManager = fontManager; this.cloudGenerator = cloudGenerator; this.colorManager = colorManager; this.cloudRenderer = cloudRenderer; }
public SettingsDialog(ITextView textView) { _settings = textView.Settings; _mouseCursorsRegions = textView.MouseCursorsRegions; _mouseCursors = textView.MouseCursors; _fontManager = textView.FontManager; _classificationStyler = textView.Document.ClassificationStyler; _appearance = textView.Appearance; _colorSchemeIndex = new IntSetting("ColorSchemeIndex", 0, _settings); _colorSchemeIndex.Changed += (sender, args) => SetClassificationColors(); _fontSizes = _fontManager.GetCurrentFontSizes(); _fontSizesNames = _fontSizes.Select(size => new GUIContent(size.ToString())).ToArray(); SetClassificationColors(); }
public TextViewAppearance(IFontManager fontManager, GUIStyle textStyle, GUIStyle backgroundStyle, Color lineNumberColor, Color selectionColor) { _fontManager = fontManager; _fontManager.Changed += (Sender, Args) => OnFontChanged(); _background = backgroundStyle; _text = textStyle; _lineNumberColor = lineNumberColor; _selectionColor = selectionColor; _lineNumber = new GUIStyle (_text) { richText = false, alignment = TextAnchor.UpperRight }; _text.font = _lineNumber.font = _fontManager.CurrentFont; }
public ITextViewAppearance AppearanceFor(ITextViewDocument document, IFontManager fontManager) { GUISkin skin = UnityEditorCompositionContainer.GetExportedValue<IGUISkinProvider>().GetGUISkin(); // Make a copy of guistyle to ensure we do not change the guistyle of the skin GUIStyle textStyle = new GUIStyle(skin.label) { richText = true, alignment = TextAnchor.UpperLeft, padding = { left = 0, right = 0 } }; textStyle.normal.textColor = Color.white; GUIStyle backgroundStyle = skin.GetStyle("InnerShadowBg"); Color lineNumberColor = new Color(1, 1, 1, 0.5f); Color selectionColor = new Color(80 / 255f, 80 / 255f, 80 / 255f, 1f); return new TextViewAppearance(fontManager, textStyle, backgroundStyle, lineNumberColor, selectionColor); }
public TextView( ITextViewDocument document, ITextViewAppearance appearance, ITextViewAdornments adornments, IMouseCursors mouseCursors, IMouseCursorRegions mouseCursorRegions, ITextViewWhitespace whitespace, ISettings settings, IFontManager fontManager) { _appearance = appearance; _adornments = adornments; _document = document; _mouseCursors = mouseCursors; _mouseCursorsRegions = mouseCursorRegions; _whitespace = whitespace; _settings = settings; _fontManager = fontManager; _selection = new Selection(document.Caret); _document.Caret.Moved += EnsureCursorIsVisible; }
public override void Initialize() { // ISSUE: object of a compiler-generated type is created // ISSUE: variable of a compiler-generated type SaveManagementLevel.\u003C\u003Ec__DisplayClassd cDisplayClassd = new SaveManagementLevel.\u003C\u003Ec__DisplayClassd(); // ISSUE: reference to a compiler-generated field cDisplayClassd.\u003C\u003E4__this = this; base.Initialize(); this.FontManager = ServiceHelper.Get<IFontManager>(); this.GameState = ServiceHelper.Get<IGameStateManager>(); this.ReloadSlots(); this.Title = "SaveManagementTitle"; // ISSUE: reference to a compiler-generated field cDisplayClassd.sf = this.FontManager.Small; // ISSUE: reference to a compiler-generated field cDisplayClassd.changeLevel = new MenuLevel() { Title = "SaveChangeSlot", AButtonString = "ChangeWithGlyph" }; // ISSUE: reference to a compiler-generated field // ISSUE: reference to a compiler-generated method cDisplayClassd.changeLevel.OnPostDraw = new Action<SpriteBatch, SpriteFont, GlyphTextRenderer, float>(cDisplayClassd.\u003CInitialize\u003Eb__4); // ISSUE: reference to a compiler-generated field cDisplayClassd.changeLevel.Parent = (MenuLevel) this; // ISSUE: reference to a compiler-generated field cDisplayClassd.changeLevel.Initialize(); // ISSUE: reference to a compiler-generated field cDisplayClassd.copySrcLevel = new MenuLevel() { Title = "SaveCopySourceTitle", AButtonString = "ChooseWithGlyph" }; // ISSUE: reference to a compiler-generated field cDisplayClassd.copySrcLevel.Parent = (MenuLevel) this; // ISSUE: reference to a compiler-generated field cDisplayClassd.copySrcLevel.Initialize(); this.CopyDestLevel = new MenuLevel() { Title = "SaveCopyDestTitle", AButtonString = "ChooseWithGlyph" }; // ISSUE: reference to a compiler-generated method this.CopyDestLevel.OnPostDraw = new Action<SpriteBatch, SpriteFont, GlyphTextRenderer, float>(cDisplayClassd.\u003CInitialize\u003Eb__5); // ISSUE: reference to a compiler-generated field this.CopyDestLevel.Parent = cDisplayClassd.copySrcLevel; this.CopyDestLevel.Initialize(); // ISSUE: reference to a compiler-generated field cDisplayClassd.clearLevel = new MenuLevel() { Title = "SaveClearTitle", AButtonString = "ChooseWithGlyph" }; // ISSUE: reference to a compiler-generated field // ISSUE: reference to a compiler-generated method cDisplayClassd.clearLevel.OnPostDraw = new Action<SpriteBatch, SpriteFont, GlyphTextRenderer, float>(cDisplayClassd.\u003CInitialize\u003Eb__6); // ISSUE: reference to a compiler-generated field cDisplayClassd.clearLevel.Parent = (MenuLevel) this; // ISSUE: reference to a compiler-generated field cDisplayClassd.clearLevel.Initialize(); // ISSUE: reference to a compiler-generated method this.AddItem("SaveChangeSlot", new Action(cDisplayClassd.\u003CInitialize\u003Eb__7), -1); // ISSUE: reference to a compiler-generated method this.AddItem("SaveCopyTitle", new Action(cDisplayClassd.\u003CInitialize\u003Eb__9), -1); // ISSUE: reference to a compiler-generated method this.AddItem("SaveClearTitle", new Action(cDisplayClassd.\u003CInitialize\u003Eb__b), -1); }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { MouseMgr = this.Services.GetService(typeof(IMouseInputManager)) as IMouseInputManager; FontMgr = this.Services.GetService(typeof(IFontManager)) as IFontManager; }
/// <summary> /// Initializes a new instance of the <see cref="FontManagerPage"/> class. /// </summary> /// <param name="display">The display.</param> /// <param name="fontManager">The font manager.</param> public FontManagerPage(IDisplay display, IFontManager fontManager) { var stack = new StackLayout(); foreach (var namedSize in Enum.GetValues(typeof(NamedSize))) { var font = Font.SystemFontOfSize((NamedSize)namedSize); var height = fontManager.GetHeight(font); var heightRequest = display.HeightRequestInInches(height); var label = new Label() { Font = font, HeightRequest = heightRequest + 10, Text = string.Format("System font {0} is {1:0.000}in tall.", namedSize, height), XAlign = TextAlignment.Center }; stack.Children.Add(label); } var f = Font.SystemFontOfSize(24); var inchFont = fontManager.FindClosest(f.FontFamily, FontSize); stack.Children.Add(new Label() { Text = "The below text should be " + FontSize + "in height from its highest point to lowest.", XAlign = TextAlignment.Center }); stack.Children.Add(new Label() { Text = "FfTtLlGgJjPp", TextColor = Color.Lime, FontSize = inchFont.FontSize, // BackgroundColor = Color.Gray, // FontFamily = inchFont.FontFamily, XAlign = TextAlignment.Center, YAlign = TextAlignment.Start }); stack.Children.Add(new Label() { Text = FontSize + "in height = SystemFontOfSize(" + inchFont.FontSize + ")", XAlign = TextAlignment.Center, YAlign = TextAlignment.End }); this.Children.Add(new ContentPage() { Title = "Sizes", Content = stack }); var listView = new ListView { ItemsSource = fontManager.AvailableFonts, ItemTemplate = new DataTemplate(() => { var label = new Label(); label.SetBinding(Label.TextProperty, "."); label.SetBinding(Label.FontFamilyProperty, "."); return new ViewCell { View = label}; }) }; this.Children.Add(new ContentPage { Title = "Fonts", Content = listView }); }
private ITextViewAppearance AppearanceFor(ITextViewDocument document, IFontManager fontManager) { return AppearanceProvider.AppearanceFor(document, fontManager); }
protected override void LoadContent() { #if !XBOX360 MouseMgr = this.Game.Services.GetService(typeof(IMouseInputManager)) as IMouseInputManager; #endif FontMgr = this.Game.Services.GetService(typeof(IFontManager)) as IFontManager; // TODO: Add your initialization logic here if (this.SpriteB == null) { this.SpriteB = new SpriteBatch(this.GraphicsDevice); } XnaGame xgcGame = this.Game as XnaGame; }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { #if !XBOX360 MouseMgr = this.Services.GetService(typeof(IMouseInputManager)) as IMouseInputManager; #endif FontMgr = this.Services.GetService(typeof(IFontManager)) as IFontManager; }