Ion
|
StaticFontImage is a derived FontImage that contains a single ImageData instance that is created by the constructor and that cannot be modified afterward. More...
#include "fontimage.h"
Public Types | |
enum | Type { kStatic, kDynamic } |
Public Member Functions | |
StaticFontImage (const FontPtr &font, size_t max_image_size, const GlyphSet &glyph_set) | |
The constructor sets up the single ImageData instance to contain glyphs for all the requested glyphs. More... | |
const ImageData & | GetImageData () const |
Returns the single ImageData instance. More... | |
const ImageData & | FindImageData (const GlyphSet &glyph_sets) override |
Implements this function to return the single ImageData instance, whether or not it contains all the requested glyphs. More... | |
Type | GetType () const |
Returns the type of an instance. More... | |
const FontPtr & | GetFont () |
Returns the Font passed to the constructor. More... | |
size_t | GetMaxImageSize () |
Returns the maximum image size passed to the constructor. More... | |
const AllocatorPtr & | GetAllocator () const |
Returns the Allocator that was used for the instance. More... | |
const AllocatorPtr & | GetNonNullAllocator () const |
Return our allocator, or the default allocator if the instance was declared on the stack. More... | |
const AllocatorPtr & | GetAllocatorForLifetime (AllocationLifetime lifetime) const |
Convenience function that returns the Allocator to use to allocate an object with a specific lifetime. More... | |
void * | operator new (size_t size) |
The standard no-parameter new operator uses the default Allocator. More... | |
void * | operator new (size_t size, AllocationLifetime lifetime) |
This overloaded version of the new operator uses the AllocationManager's default Allocator for the specified lifetime. More... | |
void * | operator new (size_t size, const AllocatorPtr &allocator) |
This overloaded version of the new operator takes the Allocator to use directly as a parameter. More... | |
void * | operator new (size_t size, const AllocatorPtr &allocator, void *ptr) |
Special operator new for using placement new with Allocatables. More... | |
void * | operator new (size_t size, void *ptr) |
The placement new operator is defined conventionally. More... | |
void | operator delete (void *ptr) |
Define the delete operator to use specialized functions dealing with an Allocator. More... | |
void | operator delete (void *ptr, AllocationLifetime lifetime) |
Windows requires these (or it issues C4291 warnings). More... | |
void | operator delete (void *ptr, const AllocatorPtr &allocator) |
void | operator delete (void *ptr, void *ptr2) |
The placement delete operator does nothing, as usual. More... | |
int | GetRefCount () const |
GetRefCount() is part of the interface necessary for SharedPtr. More... | |
Static Public Member Functions | |
static bool | HasAllGlyphs (const ImageData &image_data, const GlyphSet &glyph_set) |
Convenience function that returns true if an ImageData instance contains all glyphs in glyph_set. More... | |
static bool | HasGlyph (const ImageData &image_data, GlyphIndex glyph_index) |
Convenience function that returns true if an ImageData instance contains a glyph with the given index. More... | |
static bool | GetTextureCoords (const ImageData &image_data, GlyphIndex glyph_index, math::Range2f *rectangle) |
Convenience function that sets rectangle to the texture coordinate rectangle to use for the indexed glyph within an ImageData instance. More... | |
Protected Member Functions | |
StaticFontImage (const FontPtr &font, size_t max_image_size, const ImageData &image_data) | |
Protected constructor for MockFontImage that bypasses normal processing and allows ImageData to be set directly. More... | |
~StaticFontImage () override | |
StaticFontImage is a derived FontImage that contains a single ImageData instance that is created by the constructor and that cannot be modified afterward.
Definition at line 152 of file fontimage.h.
|
inherited |
Enumerator | |
---|---|
kStatic | |
kDynamic |
Definition at line 65 of file fontimage.h.
ion::text::StaticFontImage::StaticFontImage | ( | const FontPtr & | font, |
size_t | max_image_size, | ||
const GlyphSet & | glyph_set | ||
) |
The constructor sets up the single ImageData instance to contain glyphs for all the requested glyphs.
StaticFontImage functions.
If the Font is not valid, the glyph set is empty, or the resulting image would exceed max_image_size in either dimension, the ImageData instance will be empty.
Definition at line 473 of file fontimage.cc.
|
protected |
Protected constructor for MockFontImage that bypasses normal processing and allows ImageData to be set directly.
Definition at line 483 of file fontimage.cc.
|
overrideprotected |
Definition at line 488 of file fontimage.cc.
|
overridevirtual |
Implements this function to return the single ImageData instance, whether or not it contains all the requested glyphs.
You can use HasAllGlyphs() to test whether all of the glyphs appear in the ImageData, or use HasGlyph() or GetTextureCoords() to test individual glyphs.
Implements ion::text::FontImage.
Definition at line 490 of file fontimage.cc.
|
inlineinherited |
Returns the Allocator that was used for the instance.
This will be NULL if the instance was declared on the stack or created with normal placement new.
Definition at line 68 of file allocatable.h.
References allocator_.
Referenced by ion::base::DataContainer::CreateAndCopy(), ion::text::DynamicFontImage::FindContainingImageDataIndex(), and ion::text::DynamicFontImage::FindImageDataIndex().
|
inlineinherited |
Convenience function that returns the Allocator to use to allocate an object with a specific lifetime.
Definition at line 78 of file allocatable.h.
References ion::base::Allocator::GetAllocatorForLifetime().
Referenced by ion::text::BasicBuilder::BuildVertexData(), ion::text::OutlineBuilder::BuildVertexData(), ion::gfxutils::ShaderManager::CreateShaderProgram(), ion::text::DynamicFontImage::FindContainingImageDataIndex(), ion::text::DynamicFontImage::FindImageDataIndex(), ion::gfx::Renderer::Renderer(), and ion::gfx::UpdateStateTable().
|
inlineinherited |
Returns the Font passed to the constructor.
Definition at line 88 of file fontimage.h.
Referenced by ion::text::DynamicFontImage::FindContainingImageDataIndex(), and ion::text::DynamicFontImage::FindImageDataIndex().
|
inline |
Returns the single ImageData instance.
Definition at line 162 of file fontimage.h.
|
inlineinherited |
Returns the maximum image size passed to the constructor.
Definition at line 91 of file fontimage.h.
|
inlineinherited |
Return our allocator, or the default allocator if the instance was declared on the stack.
Definition at line 72 of file allocatable.h.
References allocator_, and ion::base::AllocationManager::GetNonNullAllocator().
|
inlineinherited |
GetRefCount() is part of the interface necessary for SharedPtr.
Definition at line 34 of file shareable.h.
Referenced by ion::base::Notifier::RemoveReceiver().
|
staticinherited |
Convenience function that sets rectangle to the texture coordinate rectangle to use for the indexed glyph within an ImageData instance.
Returns false if the glyph is not in the ImageData.
Definition at line 452 of file fontimage.cc.
References ion::base::IsInvalidReference(), and ion::text::FontImage::ImageData::texture_rectangle_map.
Referenced by ion::text::Builder::StoreGlyphVertices().
|
inlineinherited |
Returns the type of an instance.
Definition at line 85 of file fontimage.h.
|
inlinestaticinherited |
Convenience function that returns true if an ImageData instance contains all glyphs in glyph_set.
Definition at line 101 of file fontimage.h.
References ion::text::FontImage::ImageData::glyph_set, and ion::base::IsInvalidReference().
|
inlinestaticinherited |
Convenience function that returns true if an ImageData instance contains a glyph with the given index.
Definition at line 111 of file fontimage.h.
References ion::text::FontImage::ImageData::glyph_set, and ion::base::IsInvalidReference().
|
inlineinherited |
Define the delete operator to use specialized functions dealing with an Allocator.
Definition at line 109 of file allocatable.h.
|
inlineinherited |
Windows requires these (or it issues C4291 warnings).
Definition at line 112 of file allocatable.h.
|
inlineinherited |
Definition at line 113 of file allocatable.h.
|
inlineinherited |
The placement delete operator does nothing, as usual.
Definition at line 118 of file allocatable.h.
|
inlineinherited |
The standard no-parameter new operator uses the default Allocator.
Definition at line 84 of file allocatable.h.
|
inlineinherited |
This overloaded version of the new operator uses the AllocationManager's default Allocator for the specified lifetime.
Definition at line 88 of file allocatable.h.
|
inlineinherited |
This overloaded version of the new operator takes the Allocator to use directly as a parameter.
If the Allocator pointer is NULL, this uses the default Allocator.
Definition at line 95 of file allocatable.h.
|
inlineinherited |
Special operator new for using placement new with Allocatables.
Definition at line 100 of file allocatable.h.
|
inlineinherited |
The placement new operator is defined conventionally.
Definition at line 105 of file allocatable.h.