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

#include <FontAsset.hpp>

Inherits s3d::Font.

Public Member Functions

SIV3D_NODISCARD_CXX20 FontAsset (AssetNameView name)
 
- Public Member Functions inherited from s3d::Font
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 bool Register (AssetNameView name, int32 fontSize, FilePathView path, FontStyle style=FontStyle::Default)
 
static bool Register (AssetNameView name, int32 fontSize, FilePathView path, size_t faceIndex, FontStyle style=FontStyle::Default)
 
static bool Register (AssetNameView name, int32 fontSize, Typeface typeface=Typeface::Regular, FontStyle style=FontStyle::Default)
 
static bool Register (AssetNameView name, FontMethod fontMethod, int32 fontSize, FilePathView path, FontStyle style=FontStyle::Default)
 
static bool Register (AssetNameView name, FontMethod fontMethod, int32 fontSize, FilePathView path, size_t faceIndex, FontStyle style=FontStyle::Default)
 
static bool Register (AssetNameView name, FontMethod fontMethod, int32 fontSize, Typeface typeface=Typeface::Regular, FontStyle style=FontStyle::Default)
 
static bool Register (AssetNameView name, std::unique_ptr< FontAssetData > &&data)
 
static bool Register (const AssetNameAndTags &nameAndTags, int32 fontSize, FilePathView path, FontStyle style=FontStyle::Default)
 
static bool Register (const AssetNameAndTags &nameAndTags, int32 fontSize, FilePathView path, size_t faceIndex, FontStyle style=FontStyle::Default)
 
static bool Register (const AssetNameAndTags &nameAndTags, int32 fontSize, Typeface typeface=Typeface::Regular, FontStyle style=FontStyle::Default)
 
static bool Register (const AssetNameAndTags &nameAndTags, FontMethod fontMethod, int32 fontSize, FilePathView path, FontStyle style=FontStyle::Default)
 
static bool Register (const AssetNameAndTags &nameAndTags, FontMethod fontMethod, int32 fontSize, FilePathView path, size_t faceIndex, FontStyle style=FontStyle::Default)
 
static bool Register (const AssetNameAndTags &nameAndTags, FontMethod fontMethod, int32 fontSize, Typeface typeface=Typeface::Regular, FontStyle style=FontStyle::Default)
 
static bool IsRegistered (AssetNameView name)
 
static bool Load (AssetNameView name, const String &preloadText=U"")
 
static void LoadAsync (AssetNameView name, const String &preloadText=U"")
 
static void Wait (AssetNameView name)
 指定したフォントアセットのロードが完了するまで待機します。 More...
 
static bool IsReady (AssetNameView name)
 指定したフォントアセットのロード処理が(成否にかかわらず)完了しているかを返します。 More...
 
static void Release (AssetNameView name)
 指定したフォントアセットについて、ロードしたデータをメモリ上から削除します。登録状態は維持されます。 More...
 
static void ReleaseAll ()
 すべてのフォントアセットについて、ロードしたデータをメモリ上から削除します。登録状態は維持されます。 More...
 
static void Unregister (AssetNameView name)
 指定したフォントアセットについて、ロードしたデータをメモリ上から削除し、登録も解除します。 More...
 
static void UnregisterAll ()
 すべてのフォントアセットについて、ロードしたデータをメモリ上から削除し、登録も解除します。 More...
 
static HashTable< AssetName, AssetInfoEnumerate ()
 登録されているフォントアセットの情報一覧を取得します。 More...
 
- Static Public Member Functions inherited from s3d::Font
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
 

Constructor & Destructor Documentation

◆ FontAsset()

SIV3D_NODISCARD_CXX20 s3d::FontAsset::FontAsset ( AssetNameView  name)
explicit

Member Function Documentation

◆ Enumerate()

static HashTable<AssetName, AssetInfo> s3d::FontAsset::Enumerate ( )
static

登録されているフォントアセットの情報一覧を取得します。

Returns
登録されているフォントアセットの情報一覧

◆ IsReady()

static bool s3d::FontAsset::IsReady ( AssetNameView  name)
static

指定したフォントアセットのロード処理が(成否にかかわらず)完了しているかを返します。

Parameters
nameフォントアセット名
Returns
ロード処理が(成否にかかわらず)完了している場合 true, それ以外の場合は false

◆ IsRegistered()

static bool s3d::FontAsset::IsRegistered ( AssetNameView  name)
static

◆ Load()

static bool s3d::FontAsset::Load ( AssetNameView  name,
const String preloadText = U"" 
)
static

◆ LoadAsync()

static void s3d::FontAsset::LoadAsync ( AssetNameView  name,
const String preloadText = U"" 
)
static

◆ Register() [1/13]

static bool s3d::FontAsset::Register ( AssetNameView  name,
FontMethod  fontMethod,
int32  fontSize,
FilePathView  path,
FontStyle  style = FontStyle::Default 
)
static

◆ Register() [2/13]

static bool s3d::FontAsset::Register ( AssetNameView  name,
FontMethod  fontMethod,
int32  fontSize,
FilePathView  path,
size_t  faceIndex,
FontStyle  style = FontStyle::Default 
)
static

◆ Register() [3/13]

static bool s3d::FontAsset::Register ( AssetNameView  name,
FontMethod  fontMethod,
int32  fontSize,
Typeface  typeface = Typeface::Regular,
FontStyle  style = FontStyle::Default 
)
static

◆ Register() [4/13]

static bool s3d::FontAsset::Register ( AssetNameView  name,
int32  fontSize,
FilePathView  path,
FontStyle  style = FontStyle::Default 
)
static

◆ Register() [5/13]

static bool s3d::FontAsset::Register ( AssetNameView  name,
int32  fontSize,
FilePathView  path,
size_t  faceIndex,
FontStyle  style = FontStyle::Default 
)
static

◆ Register() [6/13]

static bool s3d::FontAsset::Register ( AssetNameView  name,
int32  fontSize,
Typeface  typeface = Typeface::Regular,
FontStyle  style = FontStyle::Default 
)
static

◆ Register() [7/13]

static bool s3d::FontAsset::Register ( AssetNameView  name,
std::unique_ptr< FontAssetData > &&  data 
)
static

◆ Register() [8/13]

static bool s3d::FontAsset::Register ( const AssetNameAndTags nameAndTags,
FontMethod  fontMethod,
int32  fontSize,
FilePathView  path,
FontStyle  style = FontStyle::Default 
)
static

◆ Register() [9/13]

static bool s3d::FontAsset::Register ( const AssetNameAndTags nameAndTags,
FontMethod  fontMethod,
int32  fontSize,
FilePathView  path,
size_t  faceIndex,
FontStyle  style = FontStyle::Default 
)
static

◆ Register() [10/13]

static bool s3d::FontAsset::Register ( const AssetNameAndTags nameAndTags,
FontMethod  fontMethod,
int32  fontSize,
Typeface  typeface = Typeface::Regular,
FontStyle  style = FontStyle::Default 
)
static

◆ Register() [11/13]

static bool s3d::FontAsset::Register ( const AssetNameAndTags nameAndTags,
int32  fontSize,
FilePathView  path,
FontStyle  style = FontStyle::Default 
)
static

◆ Register() [12/13]

static bool s3d::FontAsset::Register ( const AssetNameAndTags nameAndTags,
int32  fontSize,
FilePathView  path,
size_t  faceIndex,
FontStyle  style = FontStyle::Default 
)
static

◆ Register() [13/13]

static bool s3d::FontAsset::Register ( const AssetNameAndTags nameAndTags,
int32  fontSize,
Typeface  typeface = Typeface::Regular,
FontStyle  style = FontStyle::Default 
)
static

◆ Release()

static void s3d::FontAsset::Release ( AssetNameView  name)
static

指定したフォントアセットについて、ロードしたデータをメモリ上から削除します。登録状態は維持されます。

Parameters
nameフォントアセット名

◆ ReleaseAll()

static void s3d::FontAsset::ReleaseAll ( )
static

すべてのフォントアセットについて、ロードしたデータをメモリ上から削除します。登録状態は維持されます。

◆ Unregister()

static void s3d::FontAsset::Unregister ( AssetNameView  name)
static

指定したフォントアセットについて、ロードしたデータをメモリ上から削除し、登録も解除します。

Parameters
nameフォントアセット名

◆ UnregisterAll()

static void s3d::FontAsset::UnregisterAll ( )
static

すべてのフォントアセットについて、ロードしたデータをメモリ上から削除し、登録も解除します。

◆ Wait()

static void s3d::FontAsset::Wait ( AssetNameView  name)
static

指定したフォントアセットのロードが完了するまで待機します。

Parameters
nameフォントアセット名

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