GcWord lets you set following effects to your text:
GcWord lets you apply effects to your fonts by using the Font.Fill and Font.Line properties. You can set both Fill and Line properties to NoFill, Solid or Gradient type only through Type property. The Type property accepts values from FillType enumeration.
Font.Fill and Font.Color properties are interdependent. Following table demonstrates their dependency on each other:
Font.Fill | Font.Color |
---|---|
Not specified | Font.Fill takes the value from Font.Color as Solid type. |
Any of Font.Fill properties are specified. | Font.Color uses Font.Fill.SolidFill properties. |
Font.Fill type is specified as Gradient. | Font.Fill and Font.Color are independent of each other. GcWord uses Font.Fill to render the font. |
In addition, you can also set the Font.Line property to give your fonts an outline effect. Font.Line and Font.Color are independent of each other.
C# |
Copy Code |
---|---|
// Specify gradient fill for the font: var fill = style.Font.Fill; fill.Type = FillType.Gradient; var gradient = fill.GradientFill; gradient.Angle = 64; gradient.Stops[0].Color.RGB = Color.LightSeaGreen; gradient.Stops[1].Color.RGB = Color.Orange; // Specify the outline for the font: var line = style.Font.Line; line.Width = 1; fill = line.Fill; fill.Type = FillType.Solid; fill.SolidFill.RGB = Color.Blue; // Add sample text with the new style: doc.Body.Paragraphs.Add("Font Fill and Line styles.", style); |
The shadow effect adds additional depth to your text. GcWord allows you to apply shadow effects to text using built-in shadow effects and using custom shadow effects. To apply built-in shadow effect to a text, you can use ApplyBuiltInShadow method of the TextEffects class that accepts BuiltInShadowId enum as its parameter. However, for applying custom shadow effect to a text, you can use OuterShadow type of the TextEffects class and set its properties.
The code below shows how to apply built-in shadow to text using the ApplyBuiltInShadow method:
C# |
Copy Code |
---|---|
// apply top right offset shadow effect to the text style.Font.Effects.ApplyBuiltInShadow(BuiltInShadowId.OffsetTopRight); doc.Body.Paragraphs.Add("Font Shadow", style); |
The code below shows how to apply custom shadow to a text using the OuterShadow type:
C# |
Copy Code |
---|---|
// apply top right offset shadow effect to the text OuterShadow shadow = style.Font.Effects.Shadow; shadow.Alignment = RectangleAlignment.BottomLeft; shadow.Angle = 315f; shadow.Blur = 4f; shadow.Distance = 3f; shadow.ScaleX = 100f; shadow.ScaleY = 100f; shadow.SkewX = 0f; shadow.SkewY = 0f; shadow.Color.RGB = Color.Black; shadow.Color.Transparency = 0.6f; doc.Body.Paragraphs.Add("Font Shadow", style); |
Limitation
GcWord does not support export of font fill and line, and font shadow effects to PDF and images.
GcWord allows you to apply reflection effects to text using built-in reflection effects and custom reflection effects. To apply built-in reflection effect to a text, you can use ApplyBuiltInReflection method of the TextEffects class that accepts BuiltInReflectionId enum as its parameter. However, for applying custom reflection effect to a text, you can use Reflection type of the TextEffects class and set its properties.
The code below shows how to apply built-in reflection to text using the ApplyBuiltInReflection method:
C# |
Copy Code |
---|---|
// apply top half touching reflection effect to the text style1.Font.Effects.ApplyBuiltInReflection(BuiltInReflectionId.HalfTouching); doc.Body.Paragraphs.Add("Font Reflection.", style1); |
The code below show how to apply custom reflection to text using the Reflection type:
C# |
Copy Code |
---|---|
// Custom text reflection: var style0 = doc.Styles.Add("style0", StyleType.Paragraph); style0.Font.Size = 48; // apply top half touching reflection effect to the text Reflection reflection = style0.Font.Effects.Reflection; reflection.Distance = 0f; reflection.Angle = 90f; reflection.Blur = 0.5f; reflection.Alignment = RectangleAlignment.BottomLeft; reflection.ScaleX = 100f; reflection.ScaleY = -100f; reflection.SkewX = 0f; reflection.SkewY = 0f; reflection.StartOpacity = 60f; reflection.EndOpacity = 0.9f; reflection.StartOpacityPosition = 0f; reflection.EndOpacityPosition = 58f; reflection.OpacityAngle = 90f; doc.Body.Paragraphs.Add("Font Reflection.", style0); |
To view the code in action, see Reflection Effect demo sample.
GcWord allows you to apply glow effects to text using built-in glow effects and custom glow effects. To apply built-in glow effect to a text, you can use ApplyBuiltInGlow method of the TextEffects class that accepts BuiltInGlowId enum as its parameter. However, for applying custom glow effect to a text, you can use Glow type of the TextEffects class and set its properties.
The code below shows how to apply built-in glow to a shape using the ApplyBuiltInGlow method:
C# |
Copy Code |
---|---|
// apply 5 point accent 5 glow effect to the text style.Font.Effects.ApplyBuiltInGlow(BuiltInGlowId.Radius5Accent5); doc.Body.Paragraphs.Add("Font Glow", style); |
The code below shows how to apply custom glow effect to a shape:
C# |
Copy Code |
---|---|
// apply 5 point accent 6 glow effect to the text Glow glow = style.Font.Effects.Glow; glow.Radius = 5f; glow.Color.ThemeColor = ThemeColorId.Accent6; glow.Color.Transparency = 0.6f; doc.Body.Paragraphs.Add("Font Glow", style); |
To view the code in action, see Glow Effect Demo sample.
Limitation
GcWord does not support export of font fill and line, font shadow, reflection, and glow effects to PDF and images.