コード例 #1
0
ファイル: fontSmoothing.cs プロジェクト: ru-ace/spark
        public override ApplyState Apply(ComputedStyle style, Value value)
        {
            // Get the text:
            TextRenderingProperty text = GetText(style);

            if (text == null)
            {
                // Ok!
                return(ApplyState.Ok);
            }

            bool auto = (value == null || value.IsAuto || value.Text == "anti-alias");

            if (auto)
            {
                text.Alias = float.MaxValue;
            }
            else
            {
                text.Alias = value.GetDecimal(style.RenderData, this);
            }

            // Clear dimensions so they get re-computed:
            text.ClearDimensions();

            // Request a redraw:
            style.RequestLayout();

            // Ok!
            return(ApplyState.Ok);
        }
コード例 #2
0
        public override ApplyState Apply(ComputedStyle style, Value value)
        {
            // Get the text:
            TextRenderingProperty text = GetText(style);

            if (text == null)
            {
                // Ok!
                return(ApplyState.Ok);
            }

            float adjust = -1f;

            if (value != null && value.Text != "none")
            {
                adjust = (float)value.GetDecimal(style.RenderData, this);
            }

            text.FontSizeAdjust = adjust;

            // Clear dimensions so they get re-computed:
            text.ClearDimensions();

            // Request a redraw:
            style.RequestLayout();

            // Ok!
            return(ApplyState.Ok);
        }