テキストにアウトライン効果を追加する方法

This article was translated from English: Does it need improvement?
Translated
View the article in English

テキストのアウトラインエフェクトは、テキストの文字の周りに目に見える境界線を追加し、読みやすさや視覚的なインパクトを高める定義されたアウトラインを作成します。 この効果は、デザインの好みに合わせて色、厚み、スタイルをカスタマイズできる。 グラフィック、タイポグラフィ、デジタルデザインでよく使われ、背景に対してテキストを目立たせたり、スタイル化された外観を作り出したりする。

 用 C# NuGet ライブラリ

でインストール NuGet

Install-Package IronWord
 用 C# NuGet ライブラリ

でインストール NuGet

Install-Package IronWord
または
Java PDF JAR(ジャバPDF JAR)

ダウンロード DLL (ディーエルエル)

DLLをダウンロード

プロジェクトに手動でインストールする

今日からプロジェクトでIronPDFを使い始めましょう。無料のトライアルをお試しください。

最初のステップ:
green arrow pointer

チェックアウト IronWord オン Nuget 迅速なインストールと展開のために。8百万以上のダウンロード数により、をC#で変革しています。

 用 C# NuGet ライブラリ nuget.org/packages/IronWord/
Install-Package IronWord

テキスト・アウトライン効果の追加

テキストのアウトライン効果を指定するには、TextStyleオブジェクトを作成し、TextOutlineEffectプロパティにTextOutlineEffectオブジェクトを設定します。 最後に、TextEffectプロパティにTextStyleオブジェクトを代入して、スタイルを持つ新しいテキストを追加します。

:path=/static-assets/word/content-code-examples/how-to/text-effect-text-outline-effect.cs
using IronWord;
using IronWord.Models;

// Create new Word document
WordDocument doc = new WordDocument();

// Create and configure text style
TextStyle textStyle = new TextStyle();
textStyle.TextEffect = new TextEffect()
{
    TextOutlineEffect = TextOutlineEffect.DefaultEffect,
};

// Add text with style
doc.AddText("Hello World").Style = textStyle;

// Export new Word document
doc.SaveAs("textOutlineEffect.docx");
Imports IronWord
Imports IronWord.Models

' Create new Word document
Private doc As New WordDocument()

' Create and configure text style
Private textStyle As New TextStyle()
textStyle.TextEffect = New TextEffect() With {.TextOutlineEffect = TextOutlineEffect.DefaultEffect}

' Add text with style
doc.AddText("Hello World").Style = textStyle

' Export new Word document
doc.SaveAs("textOutlineEffect.docx")
VB   C#
テキストのアウトライン効果を追加する

テキストアウトライン効果のプロパティ

テキスト・アウトライン・エフェクトは、あらゆるデザインのニーズに合わせてカスタマイズ可能なさまざまなプロパティを提供します。 以下に物件とその説明を掲載する:

  • PenAlignment:アウトライン効果に使用されるペンの配置を取得または設定します。
  • LineCapType:アウトライン効果に使用されるラインキャップのタイプを取得または設定します。
  • LineWidth:アウトライン効果線の幅を取得または設定します。 (備考幅はポイントで指定 (1/72インチ).)
  • CompoundLineType:アウトライン効果に使用される複合線のタイプを取得または設定します。
  • LineJoin:アウトライン効果に使用されるストローク結合スタイルを取得または設定します。
  • Color:アウトライン効果の塗りつぶし色を取得または設定します。

  • presetLineDash:アウトライン効果のプリセットラインダッシュスタイルを取得または設定します。
:path=/static-assets/word/content-code-examples/how-to/text-effect-customized-text-outline-effect.cs
using IronWord;
using IronWord.Models;
using IronWord.Models.Enums;

// Create new Word document
WordDocument doc = new WordDocument();

// Create and configure text style
TextStyle textStyle = new TextStyle();
textStyle.TextEffect = new TextEffect()
{
    TextOutlineEffect = new TextOutlineEffect()
    {
        Color = IronWord.Models.Color.Red,
        CompoundLineType = CompoundLineValues.Double,
        LineCapType = LineCapValues.Round,
        LineJoin = StrokeJoinStyleValues.Bevel,
        LineWidth = 0.3,
        PenAlignment = PenAlignmentValues.Center,
        presetLineDash = PresetLineDashValues.Solid
    },
};

// Add text with style
doc.AddText("Customized text outline").Style = textStyle;

// Export new Word document
doc.SaveAs("customizedTextOutlineEffect.docx");
Imports IronWord
Imports IronWord.Models
Imports IronWord.Models.Enums

' Create new Word document
Private doc As New WordDocument()

' Create and configure text style
Private textStyle As New TextStyle()
textStyle.TextEffect = New TextEffect() With {
	.TextOutlineEffect = New TextOutlineEffect() With {
		.Color = IronWord.Models.Color.Red,
		.CompoundLineType = CompoundLineValues.Double,
		.LineCapType = LineCapValues.Round,
		.LineJoin = StrokeJoinStyleValues.Bevel,
		.LineWidth = 0.3,
		.PenAlignment = PenAlignmentValues.Center,
		.presetLineDash = PresetLineDashValues.Solid
	}
}

' Add text with style
doc.AddText("Customized text outline").Style = textStyle

' Export new Word document
doc.SaveAs("customizedTextOutlineEffect.docx")
VB   C#
テキストのアウトライン効果をカスタマイズ