Пример #1
0
        protected override void CreateResources()
        {
            string text = "Hello World From ... DirectWrite!";

            _blackBrush = RenderTarget.CreateSolidColorBrush(Color.Black);
            _textLayout = DirectWriteFactory.CreateTextLayout(text, _textFormat, RenderTarget.GetSize());

            // (21, 12) is the range around "DirectWrite!"
            _textLayout.SetFontSize(100, (21, 12));
            _typography = DirectWriteFactory.CreateTypography();
            _typography.AddFontFeature(new FontFeature(FontFeatureTag.StylisticSet7, 1));
            _textLayout.SetTypography(_typography, (0, text.Length));
            _textLayout.SetUnderline(true, (21, 12));
            _textLayout.SetFontWeight(FontWeight.Bold, (21, 12));
        }