![]() |
OpenSiv3D
v0.6.5
C++20 framework for creative coding
|
フォント 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 String & | familyName () const |
ロードしたフォントのファミリーネームを返します。 More... | |
const String & | styleName () 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 Font & | setIndentSize (int32 indentSize) const |
インデントに含まれるスペースの数を設定します。 More... | |
const Font & | setBufferThickness (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< GlyphCluster > | getGlyphClusters (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< OutlineGlyph > | renderOutlines (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< PolygonGlyph > | renderPolygons (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< MeshGlyph > | createMeshes (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 Texture & | getTexture () const |
フォントの内部でキャッシュされているテクスチャを返します。 More... | |
Glyph | getGlyph (char32 ch) const |
指定した文字の描画用のグリフを返します。 More... | |
Glyph | getGlyph (StringView ch) const |
指定した文字の描画用のグリフを返します。 More... | |
Array< Glyph > | getGlyphs (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 |
![]() | |
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 PixelShader & | GetPixelShader (FontMethod method, TextStyle::Type type=TextStyle::Type::Default, HasColor hasColor=HasColor::No) |
テキスト描画用の標準ピクセルシェーダを返します。 More... | |
static bool | IsAvailable (Typeface typeface) |
Additional Inherited Members | |
![]() | |
using | AssetIDWrapperType = AssetIDWrapper< AssetHandle > |
アセット ID ラッパー型 More... | |
using | IDType = typename AssetIDWrapperType::IDType |
アセット ID 型 More... | |
![]() | |
std::shared_ptr< AssetIDWrapperType > | m_handle |
フォント
SIV3D_NODISCARD_CXX20 s3d::Font::Font | ( | ) |
デフォルトコンストラクタ
SIV3D_NODISCARD_CXX20 s3d::Font::Font | ( | int32 | fontSize, |
FilePathView | path, | ||
FontStyle | style = FontStyle::Default |
||
) |
フォントを作成します。
fontSize | フォントの基本サイズ |
path | ロードするフォントファイルのパス |
style | フォントのスタイル |
SIV3D_NODISCARD_CXX20 s3d::Font::Font | ( | int32 | fontSize, |
FilePathView | path, | ||
size_t | faceIndex, | ||
FontStyle | style = FontStyle::Default |
||
) |
フォントを作成します。
fontSize | フォントの基本サイズ |
path | ロードするフォントファイルのパス |
faceIndex | フォントファイルが複数のフォントコレクションを含む場合のインデックス |
style | フォントのスタイル |
SIV3D_NODISCARD_CXX20 s3d::Font::Font | ( | int32 | fontSize, |
Typeface | typeface = Typeface::Regular , |
||
FontStyle | style = FontStyle::Default |
||
) |
フォントを作成します。
fontSize | フォントの基本サイズ |
typeface | フォントの種類 |
style | フォントのスタイル |
SIV3D_NODISCARD_CXX20 s3d::Font::Font | ( | FontMethod | fontMethod, |
int32 | fontSize, | ||
FilePathView | path, | ||
FontStyle | style = FontStyle::Default |
||
) |
フォントを作成します。
fontMethod | フォントのレンダリング方式 |
fontSize | フォントの基本サイズ |
path | ロードするフォントファイルのパス |
style | フォントのスタイル |
SIV3D_NODISCARD_CXX20 s3d::Font::Font | ( | FontMethod | fontMethod, |
int32 | fontSize, | ||
FilePathView | path, | ||
size_t | faceIndex, | ||
FontStyle | style = FontStyle::Default |
||
) |
フォントを作成します。
fontMethod | フォントのレンダリング方式 |
fontSize | フォントの基本サイズ |
path | ロードするフォントファイルのパス |
faceIndex | フォントファイルが複数のフォントコレクションを含む場合のインデックス |
style | フォントのスタイル |
SIV3D_NODISCARD_CXX20 s3d::Font::Font | ( | FontMethod | fontMethod, |
int32 | fontSize, | ||
Typeface | typeface = Typeface::Regular , |
||
FontStyle | style = FontStyle::Default |
||
) |
フォントを作成します。
fontMethod | フォントのレンダリング方式 |
fontSize | フォントの基本サイズ |
typeface | フォントの種類 |
style | フォントのスタイル |
|
virtual |
デストラクタ
bool s3d::Font::addFallback | ( | const Font & | font | ) | const |
フォールバッグフォントを追加します。
font | フォールバックとして追加するフォント |
|
delete |
int32 s3d::Font::ascender | ( | ) | const |
フォントのアセンダーの高さ(ピクセル)を返します。
指定した文字のメッシュグリフを作成して返します。
ch | 文字 |
size | フォントのサイズ |
MeshGlyph s3d::Font::createMesh | ( | StringView | ch, |
double | size = 1.0 |
||
) | const |
指定した文字のメッシュグリフを作成して返します。
ch | 文字 |
size | フォントのサイズ |
MeshGlyph s3d::Font::createMeshByGlyphIndex | ( | GlyphIndex | glyphIndex, |
double | size = 1.0 |
||
) | const |
指定した文字のメッシュグリフを作成して返します。
glyphIndex | 文字のグリフインデックス |
size | フォントのサイズ |
Array<MeshGlyph> s3d::Font::createMeshes | ( | StringView | s, |
double | size = 1.0 , |
||
Ligature | ligature = Ligature::Yes |
||
) | const |
指定した文字列のすべての文字のメッシュグリフの配列を作成して返します。
s | 文字列 |
size | フォントのサイズ |
ligature | リガチャ(合字)を有効にするか |
int32 s3d::Font::descender | ( | ) | const |
フォントのディセンダーの高さ(ピクセル)を返します。
const String& s3d::Font::familyName | ( | ) | const |
ロードしたフォントのファミリーネームを返します。
int32 s3d::Font::fontSize | ( | ) | const |
フォトの基本サイズを返します。
int32 s3d::Font::getBufferThickness | ( | ) | const |
レンダリング方式が SDF, MSDF の場合にキャッシュテクスチャに保存する文字の周囲の余白を返します。
Glyph s3d::Font::getGlyph | ( | StringView | ch | ) | const |
指定した文字の描画用のグリフを返します。
ch | 文字 |
Array<GlyphCluster> s3d::Font::getGlyphClusters | ( | StringView | s, |
UseFallback | useFallback = UseFallback::Yes , |
||
Ligature | ligature = Ligature::Yes |
||
) | const |
文字列に対応するグリフクラスターを返します。
s | 文字列 |
useFallback | フォールバックフォントを使用するか |
ligature | リガチャ(合字)を有効にするか |
GlyphIndex s3d::Font::getGlyphIndex | ( | char32 | ch | ) | const |
指定した文字の、このフォント内でのグリフインデックスを返します。
ch | 文字 |
GlyphIndex s3d::Font::getGlyphIndex | ( | StringView | ch | ) | const |
指定した文字の、このフォント内でのグリフインデックスを返します。
ch | 文字 |
指定した文字のグリフ情報を返します。
ch | 文字 |
GlyphInfo s3d::Font::getGlyphInfo | ( | StringView | ch | ) | const |
指定した文字のグリフ情報を返します。
ch | 文字 |
GlyphInfo s3d::Font::getGlyphInfoByGlyphIndex | ( | GlyphIndex | glyphIndex | ) | const |
指定した文字のグリフ情報を返します。
glyphIndex | 文字のグリフインデックス |
Array<Glyph> s3d::Font::getGlyphs | ( | StringView | s, |
Ligature | ligature = Ligature::No |
||
) | const |
指定した文字列の描画用のグリフ配列を返します。
s | 文字列 |
ligature | リガチャ(合字)を有効にするか |
|
static |
テキスト描画用の標準ピクセルシェーダを返します。
method | フォントのレンダリング方式 |
type | テキストのスタイル |
hasColor | カラー情報をもつフォント(カラー絵文字など)であるか |
const Texture& s3d::Font::getTexture | ( | ) | const |
フォントの内部でキャッシュされているテクスチャを返します。
bool s3d::Font::hasColor | ( | ) | const |
フォントが色情報を持つかを返します。
bool s3d::Font::hasGlyph | ( | char32 | ch | ) | const |
指定した文字のグリフを持つかを返します。
ch | 文字 |
bool s3d::Font::hasGlyph | ( | StringView | ch | ) | const |
指定した文字のグリフを持つかを返します。
ch | 文字 |
int32 s3d::Font::height | ( | ) | const |
double s3d::Font::height | ( | double | size | ) | const |
指定したフォントサイズでテキストを描画するときのフォントの高さ(ピクセル)を返します。
size | 描画するフォントサイズ |
int32 s3d::Font::indentSize | ( | ) | const |
インデントに含まれるスペースの数を返します。
|
static |
FontMethod s3d::Font::method | ( | ) | const |
フォントのレンダリング方式を返します。
uint32 s3d::Font::num_glyphs | ( | ) | const |
フォントが持つグリフの数を返します。
|
inline |
フォントを描画するために必要な DrawableText を、一連の引数を文字列に変換することで構築します。
...Args | 引数の型 |
...args | 文字列に変換する値 |
DrawableText s3d::Font::operator() | ( | const String & | text | ) | const |
DrawableText s3d::Font::operator() | ( | String && | text | ) | const |
bool s3d::Font::preload | ( | StringView | chars | ) | const |
指定した文字列のためのグリフを事前生成します。
chars | 文字列 |
BitmapGlyph s3d::Font::renderBitmap | ( | char32 | ch | ) | const |
指定した文字の Bitmap グリフを作成して返します。
ch | 文字 |
BitmapGlyph s3d::Font::renderBitmap | ( | StringView | ch | ) | const |
指定した文字の Bitmap グリフを作成して返します。
ch | 文字 |
BitmapGlyph s3d::Font::renderBitmapByGlyphIndex | ( | GlyphIndex | glyphIndex | ) | const |
指定した文字の Bitmap グリフを作成して返します。
glyphIndex | 文字のグリフインデックス |
指定した文字の MSDF グリフを作成して返します。
ch | 文字 |
buffer | 文字の周囲の余白 |
MSDFGlyph s3d::Font::renderMSDF | ( | StringView | ch, |
int32 | buffer = 3 |
||
) | const |
指定した文字の MSDF グリフを作成して返します。
ch | 文字 |
buffer | 文字の周囲の余白 |
MSDFGlyph s3d::Font::renderMSDFByGlyphIndex | ( | GlyphIndex | glyphIndex, |
int32 | buffer = 3 |
||
) | const |
指定した文字の MSDF グリフを作成して返します。
glyphIndex | 文字のグリフインデックス |
buffer | 文字の周囲の余白 |
OutlineGlyph s3d::Font::renderOutline | ( | char32 | ch, |
CloseRing | closeRing = CloseRing::No |
||
) | const |
指定した文字の輪郭グリフを作成して返します。
ch | 文字 |
closeRing | 各輪郭の頂点配列について、末尾の頂点を先頭の頂点と一致させるか |
OutlineGlyph s3d::Font::renderOutline | ( | StringView | ch, |
CloseRing | closeRing = CloseRing::No |
||
) | const |
指定した文字の輪郭グリフを作成して返します。
ch | 文字 |
closeRing | 各輪郭の頂点配列について、末尾の頂点を先頭の頂点と一致させるか |
OutlineGlyph s3d::Font::renderOutlineByGlyphIndex | ( | GlyphIndex | glyphIndex, |
CloseRing | closeRing = CloseRing::No |
||
) | const |
指定した文字の輪郭グリフを作成して返します。
glyphIndex | 文字のグリフインデックス |
closeRing | 各輪郭の頂点配列について、末尾の頂点を先頭の頂点と一致させるか |
Array<OutlineGlyph> s3d::Font::renderOutlines | ( | StringView | s, |
CloseRing | closeRing = CloseRing::No , |
||
Ligature | ligature = Ligature::Yes |
||
) | const |
指定した文字列のすべての文字の輪郭グリフの配列を作成して返します。
s | 文字列 |
closeRing | 各輪郭の頂点配列について、末尾の頂点を先頭の頂点と一致させるか |
ligature | リガチャ(合字)を有効にするか |
PolygonGlyph s3d::Font::renderPolygon | ( | char32 | ch | ) | const |
指定した文字のポリゴングリフを作成して返します。
ch | 文字 |
PolygonGlyph s3d::Font::renderPolygon | ( | StringView | ch | ) | const |
指定した文字のポリゴングリフを作成して返します。
ch | 文字 |
PolygonGlyph s3d::Font::renderPolygonByGlyphIndex | ( | GlyphIndex | glyphIndex | ) | const |
指定した文字のポリゴングリフを作成して返します。
glyphIndex | 文字のグリフインデックス |
Array<PolygonGlyph> s3d::Font::renderPolygons | ( | StringView | s, |
Ligature | ligature = Ligature::Yes |
||
) | const |
指定した文字列のすべての文字のポリゴングリフの配列を作成して返します。
s | 文字列 |
ligature | リガチャ(合字)を有効にするか |
指定した文字の SDF グリフを作成して返します。
ch | 文字 |
buffer | 文字の周囲の余白 |
SDFGlyph s3d::Font::renderSDF | ( | StringView | ch, |
int32 | buffer = 3 |
||
) | const |
指定した文字の SDF グリフを作成して返します。
ch | 文字 |
buffer | 文字の周囲の余白 |
SDFGlyph s3d::Font::renderSDFByGlyphIndex | ( | GlyphIndex | glyphIndex, |
int32 | buffer = 3 |
||
) | const |
指定した文字の SDF グリフを作成して返します。
glyphIndex | 文字のグリフインデックス |
buffer | 文字の周囲の余白 |
レンダリング方式が SDF, MSDF の場合にキャッシュテクスチャに保存する文字の周囲の余白を設定します。
thickness |
インデントに含まれるスペースの数を設定します。
indentSize | インデントに含まれるスペースの数 |
double s3d::Font::spaceWidth | ( | ) | const |
半角スペースの幅(ピクセル)を返します。
FontStyle s3d::Font::style | ( | ) | const |
フォントのスタイルを返します。
const String& s3d::Font::styleName | ( | ) | const |
ロードしたフォントのスタイルネームを返します。
|
noexcept |