OpenSiv3D  v0.6.5
C++20 framework for creative coding
s3d::Font Class Reference

フォント More...

#include <Font.hpp>

Inherits s3d::AssetHandle< Font >.

Inherited by s3d::FontAsset.

Public Member Functions

SIV3D_NODISCARD_CXX20 Font ()
 デフォルトコンストラクタ More...
 
SIV3D_NODISCARD_CXX20 Font (int32 fontSize, FilePathView path, FontStyle style=FontStyle::Default)
 フォントを作成します。 More...
 
SIV3D_NODISCARD_CXX20 Font (int32 fontSize, FilePathView path, size_t faceIndex, FontStyle style=FontStyle::Default)
 フォントを作成します。 More...
 
SIV3D_NODISCARD_CXX20 Font (int32 fontSize, Typeface typeface=Typeface::Regular, FontStyle style=FontStyle::Default)
 フォントを作成します。 More...
 
SIV3D_NODISCARD_CXX20 Font (FontMethod fontMethod, int32 fontSize, FilePathView path, FontStyle style=FontStyle::Default)
 フォントを作成します。 More...
 
SIV3D_NODISCARD_CXX20 Font (FontMethod fontMethod, int32 fontSize, FilePathView path, size_t faceIndex, FontStyle style=FontStyle::Default)
 フォントを作成します。 More...
 
SIV3D_NODISCARD_CXX20 Font (FontMethod fontMethod, int32 fontSize, Typeface typeface=Typeface::Regular, FontStyle style=FontStyle::Default)
 フォントを作成します。 More...
 
virtual ~Font ()
 デストラクタ More...
 
bool addFallback (const Font &font) const
 フォールバッグフォントを追加します。 More...
 
bool addFallback (Font &&font) const =delete
 
const StringfamilyName () const
 ロードしたフォントのファミリーネームを返します。 More...
 
const StringstyleName () const
 ロードしたフォントのスタイルネームを返します。 More...
 
bool hasColor () const
 フォントが色情報を持つかを返します。 More...
 
FontStyle style () const
 フォントのスタイルを返します。 More...
 
FontMethod method () const
 フォントのレンダリング方式を返します。 More...
 
int32 fontSize () const
 フォトの基本サイズを返します。 More...
 
int32 ascender () const
 フォントのアセンダーの高さ(ピクセル)を返します。 More...
 
int32 descender () const
 フォントのディセンダーの高さ(ピクセル)を返します。 More...
 
int32 height () const
 フォントの高さ(ピクセル)を返します。 More...
 
double height (double size) const
 指定したフォントサイズでテキストを描画するときのフォントの高さ(ピクセル)を返します。 More...
 
double spaceWidth () const
 半角スペースの幅(ピクセル)を返します。 More...
 
int32 indentSize () const
 インデントに含まれるスペースの数を返します。 More...
 
const FontsetIndentSize (int32 indentSize) const
 インデントに含まれるスペースの数を設定します。 More...
 
const FontsetBufferThickness (int32 thickness) const
 レンダリング方式が SDF, MSDF の場合にキャッシュテクスチャに保存する文字の周囲の余白を設定します。 More...
 
int32 getBufferThickness () const
 レンダリング方式が SDF, MSDF の場合にキャッシュテクスチャに保存する文字の周囲の余白を返します。 More...
 
bool hasGlyph (char32 ch) const
 指定した文字のグリフを持つかを返します。 More...
 
bool hasGlyph (StringView ch) const
 指定した文字のグリフを持つかを返します。 More...
 
uint32 num_glyphs () const
 フォントが持つグリフの数を返します。 More...
 
GlyphIndex getGlyphIndex (char32 ch) const
 指定した文字の、このフォント内でのグリフインデックスを返します。 More...
 
GlyphIndex getGlyphIndex (StringView ch) const
 指定した文字の、このフォント内でのグリフインデックスを返します。 More...
 
Array< GlyphClustergetGlyphClusters (StringView s, UseFallback useFallback=UseFallback::Yes, Ligature ligature=Ligature::Yes) const
 文字列に対応するグリフクラスターを返します。 More...
 
GlyphInfo getGlyphInfo (char32 ch) const
 指定した文字のグリフ情報を返します。 More...
 
GlyphInfo getGlyphInfo (StringView ch) const
 指定した文字のグリフ情報を返します。 More...
 
GlyphInfo getGlyphInfoByGlyphIndex (GlyphIndex glyphIndex) const
 指定した文字のグリフ情報を返します。 More...
 
OutlineGlyph renderOutline (char32 ch, CloseRing closeRing=CloseRing::No) const
 指定した文字の輪郭グリフを作成して返します。 More...
 
OutlineGlyph renderOutline (StringView ch, CloseRing closeRing=CloseRing::No) const
 指定した文字の輪郭グリフを作成して返します。 More...
 
OutlineGlyph renderOutlineByGlyphIndex (GlyphIndex glyphIndex, CloseRing closeRing=CloseRing::No) const
 指定した文字の輪郭グリフを作成して返します。 More...
 
Array< OutlineGlyphrenderOutlines (StringView s, CloseRing closeRing=CloseRing::No, Ligature ligature=Ligature::Yes) const
 指定した文字列のすべての文字の輪郭グリフの配列を作成して返します。 More...
 
PolygonGlyph renderPolygon (char32 ch) const
 指定した文字のポリゴングリフを作成して返します。 More...
 
PolygonGlyph renderPolygon (StringView ch) const
 指定した文字のポリゴングリフを作成して返します。 More...
 
PolygonGlyph renderPolygonByGlyphIndex (GlyphIndex glyphIndex) const
 指定した文字のポリゴングリフを作成して返します。 More...
 
Array< PolygonGlyphrenderPolygons (StringView s, Ligature ligature=Ligature::Yes) const
 指定した文字列のすべての文字のポリゴングリフの配列を作成して返します。 More...
 
MeshGlyph createMesh (char32 ch, double size=1.0) const
 指定した文字のメッシュグリフを作成して返します。 More...
 
MeshGlyph createMesh (StringView ch, double size=1.0) const
 指定した文字のメッシュグリフを作成して返します。 More...
 
MeshGlyph createMeshByGlyphIndex (GlyphIndex glyphIndex, double size=1.0) const
 指定した文字のメッシュグリフを作成して返します。 More...
 
Array< MeshGlyphcreateMeshes (StringView s, double size=1.0, Ligature ligature=Ligature::Yes) const
 指定した文字列のすべての文字のメッシュグリフの配列を作成して返します。 More...
 
BitmapGlyph renderBitmap (char32 ch) const
 指定した文字の Bitmap グリフを作成して返します。 More...
 
BitmapGlyph renderBitmap (StringView ch) const
 指定した文字の Bitmap グリフを作成して返します。 More...
 
BitmapGlyph renderBitmapByGlyphIndex (GlyphIndex glyphIndex) const
 指定した文字の Bitmap グリフを作成して返します。 More...
 
SDFGlyph renderSDF (char32 ch, int32 buffer=3) const
 指定した文字の SDF グリフを作成して返します。 More...
 
SDFGlyph renderSDF (StringView ch, int32 buffer=3) const
 指定した文字の SDF グリフを作成して返します。 More...
 
SDFGlyph renderSDFByGlyphIndex (GlyphIndex glyphIndex, int32 buffer=3) const
 指定した文字の SDF グリフを作成して返します。 More...
 
MSDFGlyph renderMSDF (char32 ch, int32 buffer=3) const
 指定した文字の MSDF グリフを作成して返します。 More...
 
MSDFGlyph renderMSDF (StringView ch, int32 buffer=3) const
 指定した文字の MSDF グリフを作成して返します。 More...
 
MSDFGlyph renderMSDFByGlyphIndex (GlyphIndex glyphIndex, int32 buffer=3) const
 指定した文字の MSDF グリフを作成して返します。 More...
 
bool preload (StringView chars) const
 指定した文字列のためのグリフを事前生成します。 More...
 
const TexturegetTexture () const
 フォントの内部でキャッシュされているテクスチャを返します。 More...
 
Glyph getGlyph (char32 ch) const
 指定した文字の描画用のグリフを返します。 More...
 
Glyph getGlyph (StringView ch) const
 指定した文字の描画用のグリフを返します。 More...
 
Array< GlyphgetGlyphs (StringView s, Ligature ligature=Ligature::No) const
 指定した文字列の描画用のグリフ配列を返します。 More...
 
DrawableText operator() (const String &text) const
 フォントを描画するために必要な DrawableText を、文字列から構築します。 More...
 
DrawableText operator() (String &&text) const
 フォントを描画するために必要な DrawableText を、文字列から構築します。 More...
 
template<class ... Args>
DrawableText operator() (const Args &... args) const
 フォントを描画するために必要な DrawableText を、一連の引数を文字列に変換することで構築します。 More...
 
void swap (Font &other) noexcept
 
- Public Member Functions inherited from s3d::AssetHandle< Font >
SIV3D_NODISCARD_CXX20 AssetHandle ()
 
SIV3D_NODISCARD_CXX20 AssetHandle (std::shared_ptr< AssetIDWrapperType > &&id)
 
IDType id () const noexcept
 アセットの内部管理 ID を返します。 More...
 
bool isEmpty () const noexcept
 アセットが空であるかを返します。 More...
 
 operator bool () const noexcept
 アセットが空でないかを返します。 More...
 
bool operator== (const AssetHandle &other) const noexcept
 2 つのアセットが同じオブジェクトであるかを返します。 More...
 
bool operator!= (const AssetHandle &other) const noexcept
 2 つのアセットが異なるオブジェクトであるかを返します。 More...
 
void release ()
 このハンドルが管理するアセットを解放します。 More...
 

Static Public Member Functions

static const PixelShaderGetPixelShader (FontMethod method, TextStyle::Type type=TextStyle::Type::Default, HasColor hasColor=HasColor::No)
 テキスト描画用の標準ピクセルシェーダを返します。 More...
 
static bool IsAvailable (Typeface typeface)
 

Additional Inherited Members

- Public Types inherited from s3d::AssetHandle< Font >
using AssetIDWrapperType = AssetIDWrapper< AssetHandle >
 アセット ID ラッパー型 More...
 
using IDType = typename AssetIDWrapperType::IDType
 アセット ID 型 More...
 
- Protected Attributes inherited from s3d::AssetHandle< Font >
std::shared_ptr< AssetIDWrapperTypem_handle
 

Detailed Description

フォント

Constructor & Destructor Documentation

◆ Font() [1/7]

SIV3D_NODISCARD_CXX20 s3d::Font::Font ( )

デフォルトコンストラクタ

◆ Font() [2/7]

SIV3D_NODISCARD_CXX20 s3d::Font::Font ( int32  fontSize,
FilePathView  path,
FontStyle  style = FontStyle::Default 
)

フォントを作成します。

Parameters
fontSizeフォントの基本サイズ
pathロードするフォントファイルのパス
styleフォントのスタイル

◆ Font() [3/7]

SIV3D_NODISCARD_CXX20 s3d::Font::Font ( int32  fontSize,
FilePathView  path,
size_t  faceIndex,
FontStyle  style = FontStyle::Default 
)

フォントを作成します。

Parameters
fontSizeフォントの基本サイズ
pathロードするフォントファイルのパス
faceIndexフォントファイルが複数のフォントコレクションを含む場合のインデックス
styleフォントのスタイル

◆ Font() [4/7]

SIV3D_NODISCARD_CXX20 s3d::Font::Font ( int32  fontSize,
Typeface  typeface = Typeface::Regular,
FontStyle  style = FontStyle::Default 
)

フォントを作成します。

Parameters
fontSizeフォントの基本サイズ
typefaceフォントの種類
styleフォントのスタイル

◆ Font() [5/7]

SIV3D_NODISCARD_CXX20 s3d::Font::Font ( FontMethod  fontMethod,
int32  fontSize,
FilePathView  path,
FontStyle  style = FontStyle::Default 
)

フォントを作成します。

Parameters
fontMethodフォントのレンダリング方式
fontSizeフォントの基本サイズ
pathロードするフォントファイルのパス
styleフォントのスタイル

◆ Font() [6/7]

SIV3D_NODISCARD_CXX20 s3d::Font::Font ( FontMethod  fontMethod,
int32  fontSize,
FilePathView  path,
size_t  faceIndex,
FontStyle  style = FontStyle::Default 
)

フォントを作成します。

Parameters
fontMethodフォントのレンダリング方式
fontSizeフォントの基本サイズ
pathロードするフォントファイルのパス
faceIndexフォントファイルが複数のフォントコレクションを含む場合のインデックス
styleフォントのスタイル

◆ Font() [7/7]

SIV3D_NODISCARD_CXX20 s3d::Font::Font ( FontMethod  fontMethod,
int32  fontSize,
Typeface  typeface = Typeface::Regular,
FontStyle  style = FontStyle::Default 
)

フォントを作成します。

Parameters
fontMethodフォントのレンダリング方式
fontSizeフォントの基本サイズ
typefaceフォントの種類
styleフォントのスタイル

◆ ~Font()

virtual s3d::Font::~Font ( )
virtual

デストラクタ

Member Function Documentation

◆ addFallback() [1/2]

bool s3d::Font::addFallback ( const Font font) const

フォールバッグフォントを追加します。

Parameters
fontフォールバックとして追加するフォント
Returns
追加に成功した場合 true, それ以外の場合は false

◆ addFallback() [2/2]

bool s3d::Font::addFallback ( Font &&  font) const
delete

◆ ascender()

int32 s3d::Font::ascender ( ) const

フォントのアセンダーの高さ(ピクセル)を返します。

Returns
フォントのアセンダーの高さ(ピクセル)

◆ createMesh() [1/2]

MeshGlyph s3d::Font::createMesh ( char32  ch,
double  size = 1.0 
) const

指定した文字のメッシュグリフを作成して返します。

Parameters
ch文字
sizeフォントのサイズ
Returns
文字のポリゴングリフ

◆ createMesh() [2/2]

MeshGlyph s3d::Font::createMesh ( StringView  ch,
double  size = 1.0 
) const

指定した文字のメッシュグリフを作成して返します。

Parameters
ch文字
sizeフォントのサイズ
Remarks
char32 型の要素 1 つでは表現できない文字のための関数です。
Returns
文字のポリゴングリフ

◆ createMeshByGlyphIndex()

MeshGlyph s3d::Font::createMeshByGlyphIndex ( GlyphIndex  glyphIndex,
double  size = 1.0 
) const

指定した文字のメッシュグリフを作成して返します。

Parameters
glyphIndex文字のグリフインデックス
sizeフォントのサイズ
Returns
文字のポリゴングリフ

◆ createMeshes()

Array<MeshGlyph> s3d::Font::createMeshes ( StringView  s,
double  size = 1.0,
Ligature  ligature = Ligature::Yes 
) const

指定した文字列のすべての文字のメッシュグリフの配列を作成して返します。

Parameters
s文字列
sizeフォントのサイズ
ligatureリガチャ(合字)を有効にするか
Returns
文字のメッシュグリフの配列

◆ descender()

int32 s3d::Font::descender ( ) const

フォントのディセンダーの高さ(ピクセル)を返します。

Returns
フォントのディセンダーの高さ(ピクセル)

◆ familyName()

const String& s3d::Font::familyName ( ) const

ロードしたフォントのファミリーネームを返します。

Returns
ロードしたフォントのファミリーネーム

◆ fontSize()

int32 s3d::Font::fontSize ( ) const

フォトの基本サイズを返します。

Returns
フォントの基本サイズ

◆ getBufferThickness()

int32 s3d::Font::getBufferThickness ( ) const

レンダリング方式が SDF, MSDF の場合にキャッシュテクスチャに保存する文字の周囲の余白を返します。

Returns
レンダリング方式が SDF, MSDF の場合にキャッシュテクスチャに保存する文字の周囲の余白

◆ getGlyph() [1/2]

Glyph s3d::Font::getGlyph ( char32  ch) const

指定した文字の描画用のグリフを返します。

Parameters
ch文字
Returns
描画用グリフ

◆ getGlyph() [2/2]

Glyph s3d::Font::getGlyph ( StringView  ch) const

指定した文字の描画用のグリフを返します。

Parameters
ch文字
Remarks
char32 型の要素 1 つでは表現できない文字のための関数です。
Returns
描画用グリフ

◆ getGlyphClusters()

Array<GlyphCluster> s3d::Font::getGlyphClusters ( StringView  s,
UseFallback  useFallback = UseFallback::Yes,
Ligature  ligature = Ligature::Yes 
) const

文字列に対応するグリフクラスターを返します。

Parameters
s文字列
useFallbackフォールバックフォントを使用するか
ligatureリガチャ(合字)を有効にするか
Returns
文字列に対応するグリフクラスター

◆ getGlyphIndex() [1/2]

GlyphIndex s3d::Font::getGlyphIndex ( char32  ch) const

指定した文字の、このフォント内でのグリフインデックスを返します。

Parameters
ch文字
Returns
このフォント内でのグリフインデックス

◆ getGlyphIndex() [2/2]

GlyphIndex s3d::Font::getGlyphIndex ( StringView  ch) const

指定した文字の、このフォント内でのグリフインデックスを返します。

Parameters
ch文字
Remarks
char32 型の要素 1 つでは表現できない文字のための関数です。
Returns
このフォント内でのグリフインデックス

◆ getGlyphInfo() [1/2]

GlyphInfo s3d::Font::getGlyphInfo ( char32  ch) const

指定した文字のグリフ情報を返します。

Parameters
ch文字
Returns
文字のグリフ情報

◆ getGlyphInfo() [2/2]

GlyphInfo s3d::Font::getGlyphInfo ( StringView  ch) const

指定した文字のグリフ情報を返します。

Parameters
ch文字
Remarks
char32 型の要素 1 つでは表現できない文字のための関数です。
Returns
文字のグリフ情報

◆ getGlyphInfoByGlyphIndex()

GlyphInfo s3d::Font::getGlyphInfoByGlyphIndex ( GlyphIndex  glyphIndex) const

指定した文字のグリフ情報を返します。

Parameters
glyphIndex文字のグリフインデックス
Returns
文字のグリフ情報

◆ getGlyphs()

Array<Glyph> s3d::Font::getGlyphs ( StringView  s,
Ligature  ligature = Ligature::No 
) const

指定した文字列の描画用のグリフ配列を返します。

Parameters
s文字列
ligatureリガチャ(合字)を有効にするか
Returns
指定した文字列の描画用のグリフ配列

◆ GetPixelShader()

static const PixelShader& s3d::Font::GetPixelShader ( FontMethod  method,
TextStyle::Type  type = TextStyle::Type::Default,
HasColor  hasColor = HasColor::No 
)
static

テキスト描画用の標準ピクセルシェーダを返します。

Parameters
methodフォントのレンダリング方式
typeテキストのスタイル
hasColorカラー情報をもつフォント(カラー絵文字など)であるか
Returns
指定した設定でのテキスト描画用の標準ピクセルシェーダ

◆ getTexture()

const Texture& s3d::Font::getTexture ( ) const

フォントの内部でキャッシュされているテクスチャを返します。

Returns
フォントの内部でキャッシュされているテクスチャ

◆ hasColor()

bool s3d::Font::hasColor ( ) const

フォントが色情報を持つかを返します。

Returns
フォントが色情報を持つ場合 true, それ以外の場合は false

◆ hasGlyph() [1/2]

bool s3d::Font::hasGlyph ( char32  ch) const

指定した文字のグリフを持つかを返します。

Parameters
ch文字
Returns
グリフを持つ場合 true, それ以外の場合は false

◆ hasGlyph() [2/2]

bool s3d::Font::hasGlyph ( StringView  ch) const

指定した文字のグリフを持つかを返します。

Parameters
ch文字
Remarks
char32 型の要素 1 つでは表現できない文字のための関数です。
Returns
グリフを持つ場合 true, それ以外の場合は false

◆ height() [1/2]

int32 s3d::Font::height ( ) const

フォントの高さ(ピクセル)を返します。

Remarks
ascender() + descender() と一致します。
Returns
フォントの高さ(ピクセル)

◆ height() [2/2]

double s3d::Font::height ( double  size) const

指定したフォントサイズでテキストを描画するときのフォントの高さ(ピクセル)を返します。

Parameters
size描画するフォントサイズ
Returns
フォントの高さ(ピクセル)

◆ indentSize()

int32 s3d::Font::indentSize ( ) const

インデントに含まれるスペースの数を返します。

Returns
インデントに含まれるスペースの数

◆ IsAvailable()

static bool s3d::Font::IsAvailable ( Typeface  typeface)
static

◆ method()

FontMethod s3d::Font::method ( ) const

フォントのレンダリング方式を返します。

Returns
フォントのレンダリング方式

◆ num_glyphs()

uint32 s3d::Font::num_glyphs ( ) const

フォントが持つグリフの数を返します。

Returns
フォントが持つグリフの数。

◆ operator()() [1/3]

template<class ... Args>
DrawableText s3d::Font::operator() ( const Args &...  args) const
inline

フォントを描画するために必要な DrawableText を、一連の引数を文字列に変換することで構築します。

Template Parameters
...Args引数の型
Parameters
...args文字列に変換する値
Returns
DrawableText

◆ operator()() [2/3]

DrawableText s3d::Font::operator() ( const String text) const

フォントを描画するために必要な DrawableText を、文字列から構築します。

Parameters
text文字列
Returns
DrawableText

◆ operator()() [3/3]

DrawableText s3d::Font::operator() ( String &&  text) const

フォントを描画するために必要な DrawableText を、文字列から構築します。

Parameters
text文字列
Returns
DrawableText

◆ preload()

bool s3d::Font::preload ( StringView  chars) const

指定した文字列のためのグリフを事前生成します。

Parameters
chars文字列
Remarks
新しいグリフをキャッシュするための処理でゲーム中のフレームレートが低下するようなことを防げます。
Returns
事前生成に成功した場合 true, それ以外の場合は false

◆ renderBitmap() [1/2]

BitmapGlyph s3d::Font::renderBitmap ( char32  ch) const

指定した文字の Bitmap グリフを作成して返します。

Parameters
ch文字
Remarks
フォント自身のレンダリング方式に関わらずこの関数を使用できますが、結果を内部にキャッシュすることはしません。
Returns
文字の Bitmap グリフ

◆ renderBitmap() [2/2]

BitmapGlyph s3d::Font::renderBitmap ( StringView  ch) const

指定した文字の Bitmap グリフを作成して返します。

Parameters
ch文字
Remarks
char32 型の要素 1 つでは表現できない文字のための関数です。
フォント自身のレンダリング方式に関わらずこの関数を使用できますが、結果を内部にキャッシュすることはしません。
Returns
文字の Bitmap グリフ

◆ renderBitmapByGlyphIndex()

BitmapGlyph s3d::Font::renderBitmapByGlyphIndex ( GlyphIndex  glyphIndex) const

指定した文字の Bitmap グリフを作成して返します。

Parameters
glyphIndex文字のグリフインデックス
Remarks
フォント自身のレンダリング方式に関わらずこの関数を使用できますが、結果を内部にキャッシュすることはしません。
Returns
文字の Bitmap グリフ

◆ renderMSDF() [1/2]

MSDFGlyph s3d::Font::renderMSDF ( char32  ch,
int32  buffer = 3 
) const

指定した文字の MSDF グリフを作成して返します。

Parameters
ch文字
buffer文字の周囲の余白
Remarks
小さい余白は省メモリで描画のオーバーヘッドが少ないですが、文字の輪郭の描画の品質が低下する場合があります。
ストローク情報を持たないフォントの場合、作成に失敗して空のグリフを返します。
Returns
文字の MSDF グリフ

◆ renderMSDF() [2/2]

MSDFGlyph s3d::Font::renderMSDF ( StringView  ch,
int32  buffer = 3 
) const

指定した文字の MSDF グリフを作成して返します。

Parameters
ch文字
buffer文字の周囲の余白
Remarks
char32 型の要素 1 つでは表現できない文字のための関数です。
小さい余白は省メモリで描画のオーバーヘッドが少ないですが、文字の輪郭の描画の品質が低下する場合があります。
ストローク情報を持たないフォントの場合、作成に失敗して空のグリフを返します。
Returns
文字の MSDF グリフ

◆ renderMSDFByGlyphIndex()

MSDFGlyph s3d::Font::renderMSDFByGlyphIndex ( GlyphIndex  glyphIndex,
int32  buffer = 3 
) const

指定した文字の MSDF グリフを作成して返します。

Parameters
glyphIndex文字のグリフインデックス
buffer文字の周囲の余白
Remarks
小さい余白は省メモリで描画のオーバーヘッドが少ないですが、文字の輪郭の描画の品質が低下する場合があります。
ストローク情報を持たないフォントの場合、作成に失敗して空のグリフを返します。
Returns
文字の MSDF グリフ

◆ renderOutline() [1/2]

OutlineGlyph s3d::Font::renderOutline ( char32  ch,
CloseRing  closeRing = CloseRing::No 
) const

指定した文字の輪郭グリフを作成して返します。

Parameters
ch文字
closeRing各輪郭の頂点配列について、末尾の頂点を先頭の頂点と一致させるか
Returns
文字の輪郭グリフ

◆ renderOutline() [2/2]

OutlineGlyph s3d::Font::renderOutline ( StringView  ch,
CloseRing  closeRing = CloseRing::No 
) const

指定した文字の輪郭グリフを作成して返します。

Parameters
ch文字
closeRing各輪郭の頂点配列について、末尾の頂点を先頭の頂点と一致させるか
Remarks
char32 型の要素 1 つでは表現できない文字のための関数です。
Returns
文字の輪郭グリフ

◆ renderOutlineByGlyphIndex()

OutlineGlyph s3d::Font::renderOutlineByGlyphIndex ( GlyphIndex  glyphIndex,
CloseRing  closeRing = CloseRing::No 
) const

指定した文字の輪郭グリフを作成して返します。

Parameters
glyphIndex文字のグリフインデックス
closeRing各輪郭の頂点配列について、末尾の頂点を先頭の頂点と一致させるか
Returns
文字の輪郭グリフ

◆ renderOutlines()

Array<OutlineGlyph> s3d::Font::renderOutlines ( StringView  s,
CloseRing  closeRing = CloseRing::No,
Ligature  ligature = Ligature::Yes 
) const

指定した文字列のすべての文字の輪郭グリフの配列を作成して返します。

Parameters
s文字列
closeRing各輪郭の頂点配列について、末尾の頂点を先頭の頂点と一致させるか
ligatureリガチャ(合字)を有効にするか
Returns
文字の輪郭グリフの配列

◆ renderPolygon() [1/2]

PolygonGlyph s3d::Font::renderPolygon ( char32  ch) const

指定した文字のポリゴングリフを作成して返します。

Parameters
ch文字
Returns
文字のポリゴングリフ

◆ renderPolygon() [2/2]

PolygonGlyph s3d::Font::renderPolygon ( StringView  ch) const

指定した文字のポリゴングリフを作成して返します。

Parameters
ch文字
Remarks
char32 型の要素 1 つでは表現できない文字のための関数です。
Returns
文字のポリゴングリフ

◆ renderPolygonByGlyphIndex()

PolygonGlyph s3d::Font::renderPolygonByGlyphIndex ( GlyphIndex  glyphIndex) const

指定した文字のポリゴングリフを作成して返します。

Parameters
glyphIndex文字のグリフインデックス
Returns
文字のポリゴングリフ

◆ renderPolygons()

Array<PolygonGlyph> s3d::Font::renderPolygons ( StringView  s,
Ligature  ligature = Ligature::Yes 
) const

指定した文字列のすべての文字のポリゴングリフの配列を作成して返します。

Parameters
s文字列
ligatureリガチャ(合字)を有効にするか
Returns
文字のポリゴングリフの配列

◆ renderSDF() [1/2]

SDFGlyph s3d::Font::renderSDF ( char32  ch,
int32  buffer = 3 
) const

指定した文字の SDF グリフを作成して返します。

Parameters
ch文字
buffer文字の周囲の余白
Remarks
小さい余白は省メモリで描画のオーバーヘッドが少ないですが、文字の輪郭の描画の品質が低下する場合があります。
ストローク情報を持たないフォントの場合、作成に失敗して空のグリフを返します。
Returns
文字の SDF グリフ

◆ renderSDF() [2/2]

SDFGlyph s3d::Font::renderSDF ( StringView  ch,
int32  buffer = 3 
) const

指定した文字の SDF グリフを作成して返します。

Parameters
ch文字
buffer文字の周囲の余白
Remarks
char32 型の要素 1 つでは表現できない文字のための関数です。
小さい余白は省メモリで描画のオーバーヘッドが少ないですが、文字の輪郭の描画の品質が低下する場合があります。
ストローク情報を持たないフォントの場合、作成に失敗して空のグリフを返します。
Returns
文字の SDF グリフ

◆ renderSDFByGlyphIndex()

SDFGlyph s3d::Font::renderSDFByGlyphIndex ( GlyphIndex  glyphIndex,
int32  buffer = 3 
) const

指定した文字の SDF グリフを作成して返します。

Parameters
glyphIndex文字のグリフインデックス
buffer文字の周囲の余白
Remarks
小さい余白は省メモリで描画のオーバーヘッドが少ないですが、文字の輪郭の描画の品質が低下する場合があります。
ストローク情報を持たないフォントの場合、作成に失敗して空のグリフを返します。
Returns
文字の SDF グリフ

◆ setBufferThickness()

const Font& s3d::Font::setBufferThickness ( int32  thickness) const

レンダリング方式が SDF, MSDF の場合にキャッシュテクスチャに保存する文字の周囲の余白を設定します。

Parameters
thickness
Remarks
デフォルト値は 2 です。
小さい余白は省メモリで描画のオーバーヘッドが少ないですが、文字の輪郭の描画の品質が低下する場合があります。
Returns
*this

◆ setIndentSize()

const Font& s3d::Font::setIndentSize ( int32  indentSize) const

インデントに含まれるスペースの数を設定します。

Parameters
indentSizeインデントに含まれるスペースの数
Returns
*this

◆ spaceWidth()

double s3d::Font::spaceWidth ( ) const

半角スペースの幅(ピクセル)を返します。

Returns
半角スペースの幅(ピクセル)

◆ style()

FontStyle s3d::Font::style ( ) const

フォントのスタイルを返します。

Returns
フォントのスタイル

◆ styleName()

const String& s3d::Font::styleName ( ) const

ロードしたフォントのスタイルネームを返します。

Returns
ロードしたフォントのスタイルネーム

◆ swap()

void s3d::Font::swap ( Font other)
noexcept

The documentation for this class was generated from the following files: