예제 #1
0
        public override void Apply(ComputedStyle style, Value value)
        {
            // Get the text:
            TextRenderingProperty text = GetText(style);

            if (text == null)
            {
                return;
            }

            // Apply the property:
            if (value == null || value.Text == "normal")
            {
                text.Weight = 400;
            }
            else if (value.Text == "bold")
            {
                text.Weight = 700;
            }
            else if (value.PX != 0)
            {
                text.Weight = value.PX;
            }
            else
            {
                text.Weight = 400;
            }

            // Apply the changes:
            text.SetText();
        }
        public override void Apply(ComputedStyle style, Value value)
        {
            // Get the text:
            TextRenderingProperty text = GetText(style);

            if (text == null)
            {
                return;
            }

            if (value == null)
            {
                // No extrude:
                text.Extrude = 0f;
            }
            else
            {
                if (value.Single < 0f)
                {
                    text.Extrude = 0f;
                }
                else
                {
                    text.Extrude = value.Single;
                }
            }

            // Apply the changes:
            text.SetText();
        }
예제 #3
0
        public override void Apply(ComputedStyle style, Value value)
        {
            // Get the text:
            TextRenderingProperty text = GetText(style);

            if (text == null)
            {
                return;
            }

            // Apply the property:

            string fontName = value.Text;

            if (fontName == null)
            {
                return;
            }

            Find(fontName, text);

            if (text.FontToDraw == null)
            {
                // No fonts at all.
                // We're going to load and use the default one:
                text.FontToDraw = DynamicFont.GetDefaultFamily();
            }

            // Apply the changes:
            text.SetText();
        }
예제 #4
0
        public override void Apply(ComputedStyle style, Value value)
        {
            // Get the text:
            TextRenderingProperty text = GetText(style);

            if (text == null)
            {
                return;
            }

            // Apply the property:
            if (value == null)
            {
                text.Italic = false;
            }
            else
            {
                text.Italic = (value.Text == "italic" || value.Text == "oblique");
            }

            // Apply the changes:
            text.SetText();
        }