31 #include "CEGUIBase.h"
32 #include "CEGUIPropertySet.h"
33 #include "CEGUIString.h"
34 #include "CEGUIXMLSerializer.h"
35 #include "CEGUIFontGlyph.h"
40 # pragma warning(push)
41 # pragma warning(disable : 4251)
68 const String& getName()
const;
71 const String& getTypeName()
const;
85 {
return (d_cp_map.find(cp) != d_cp_map.end()); }
126 const ColourRect& colours,
const float space_extra = 0.0f,
127 const float x_scale = 1.0f,
const float y_scale = 1.0f);
136 void setNativeResolution(
const Size& size);
146 Size getNativeResolution()
const;
156 void setAutoScaled(
const bool auto_scaled);
166 bool isAutoScaled()
const;
175 virtual void notifyDisplaySizeChanged(
const Size& size);
190 {
return d_height * y_scale; }
205 {
return (d_ascender - d_descender) * y_scale; }
220 {
return d_ascender * y_scale; }
239 float getTextExtent(
const String& text,
float x_scale = 1.0f)
const;
265 float x_scale = 1.0f)
const
266 {
return getCharAtPixel(text, 0, pixel, x_scale); }
296 size_t getCharAtPixel(
const String& text,
size_t start_char,
float pixel,
297 float x_scale = 1.0f)
const;
310 { d_defaultResourceGroup = resourceGroup; }
321 {
return d_defaultResourceGroup; }
347 const FontGlyph* getGlyphData(utf32 codepoint)
const;
352 const String& resource_group,
const bool auto_scaled,
353 const float native_horz_res,
const float native_vert_res);
369 virtual void rasterise(utf32 start_codepoint, utf32 end_codepoint)
const;
372 virtual void updateFont() = 0;
375 virtual void writeXMLToStream_impl(
XMLSerializer& xml_stream)
const = 0;
378 void addFontProperties();
385 void setMaxCodepoint(utf32 codepoint);
442 #if defined(_MSC_VER)
443 # pragma warning(pop)
447 #endif // end of guard _CEGUIFont_h_
Class used as a two dimensional vector (aka a Point)
Definition: CEGUIVector.h:45
float d_ascender
maximal font ascender (pixels above the baseline)
Definition: CEGUIFont.h:399
float d_nativeVertRes
native vertical resolution for this Imageset.
Definition: CEGUIFont.h:410
float d_horzScaling
current horizontal scaling factor.
Definition: CEGUIFont.h:412
String d_type
Type name string for this font (not used internally)
Definition: CEGUIFont.h:390
Abstract class defining the interface for objects that buffer geometry for later rendering.
Definition: CEGUIGeometryBuffer.h:42
float d_height
(ascender - descender) + linegap
Definition: CEGUIFont.h:403
uint32 argb_t
32 bit ARGB representation of a colour.
Definition: CEGUIcolour.h:39
Class that holds the size (width & height) of something.
Definition: CEGUISize.h:43
bool d_autoScale
true when auto-scaling is enabled.
Definition: CEGUIFont.h:406
Class that holds details of colours for the four corners of a rectangle.
Definition: CEGUIColourRect.h:44
Class that contains a collection of Property objects.
Definition: CEGUIPropertySet.h:52
CodepointMap d_cp_map
Contains mappings from code points to Image objects.
Definition: CEGUIFont.h:437
float getFontHeight(float y_scale=1.0f) const
return the exact pixel height of the font.
Definition: CEGUIFont.h:204
static const argb_t DefaultColour
Colour value used whenever a colour is not specified.
Definition: CEGUIFont.h:62
internal class representing a single font glyph.
Definition: CEGUIFontGlyph.h:43
static void setDefaultResourceGroup(const String &resourceGroup)
Sets the default resource group to be used when loading font data.
Definition: CEGUIFont.h:309
Class that encapsulates a typeface.
Definition: CEGUIFont.h:58
float getBaseline(float y_scale=1.0f) const
Return the number of pixels from the top of the highest glyph to the baseline.
Definition: CEGUIFont.h:219
uint * d_glyphPageLoaded
This bitmap holds information about loaded 'pages' of glyphs. A glyph page is a set of 256 codepoints...
Definition: CEGUIFont.h:432
static const String & getDefaultResourceGroup()
Returns the default resource group currently set for Fonts.
Definition: CEGUIFont.h:320
std::map< utf32, FontGlyph > CodepointMap
Definition of CodepointMap type.
Definition: CEGUIFont.h:435
static String d_defaultResourceGroup
Holds default resource group for font loading.
Definition: CEGUIFont.h:396
utf32 d_maxCodepoint
Maximal codepoint for font glyphs.
Definition: CEGUIFont.h:417
size_t getCharAtPixel(const String &text, float pixel, float x_scale=1.0f) const
Return the index of the closest text character in String text that corresponds to pixel location pixe...
Definition: CEGUIFont.h:264
float d_descender
maximal font descender (negative pixels below the baseline)
Definition: CEGUIFont.h:401
String d_name
Name of this font.
Definition: CEGUIFont.h:388
Class used to create XML Document.
Definition: CEGUIXMLSerializer.h:86
String d_filename
Name of the file used to create this font (font file or imagset)
Definition: CEGUIFont.h:392
float d_vertScaling
current vertical scaling factor.
Definition: CEGUIFont.h:414
Class encapsulating operations on a Rectangle.
Definition: CEGUIRect.h:44
String class used within the GUI system.
Definition: CEGUIString.h:57
float getLineSpacing(float y_scale=1.0f) const
Return the pixel line spacing value for.
Definition: CEGUIFont.h:189
bool isCodepointAvailable(utf32 cp) const
Return whether this Font can draw the specified code-point.
Definition: CEGUIFont.h:84
float d_nativeHorzRes
native horizontal resolution for this Imageset.
Definition: CEGUIFont.h:408
String d_resourceGroup
Name of the font file's resource group.
Definition: CEGUIFont.h:394