30 #include "CEGUI/Base.h"
31 #include "CEGUI/PropertySet.h"
32 #include "CEGUI/EventSet.h"
33 #include "CEGUI/String.h"
34 #include "CEGUI/XMLSerializer.h"
35 #include "CEGUI/FontGlyph.h"
40 # pragma warning(push)
41 # pragma warning(disable : 4251)
58 class CEGUIEXPORT Font :
61 public AllocatedObject<Font>
65 static const argb_t DefaultColour;
68 static const String EventNamespace;
74 static const String EventRenderSizeChanged;
80 const String& getName()
const;
83 const String& getTypeName()
const;
86 const String& getFileName()
const;
100 {
return (d_cp_map.find(cp) != d_cp_map.end()); }
143 const ColourRect& colours,
const float space_extra = 0.0f,
144 const float x_scale = 1.0f,
const float y_scale = 1.0f)
const;
153 void setNativeResolution(
const Sizef& size);
163 const Sizef& getNativeResolution()
const;
192 virtual void notifyDisplaySizeChanged(
const Sizef& size);
207 {
return d_height * y_scale; }
222 {
return (d_ascender - d_descender) * y_scale; }
237 {
return d_ascender * y_scale; }
270 float getTextExtent(
const String& text,
float x_scale = 1.0f)
const;
300 float getTextAdvance(
const String& text,
float x_scale = 1.0f)
const;
326 float x_scale = 1.0f)
const
327 {
return getCharAtPixel(text, 0, pixel, x_scale); }
357 size_t getCharAtPixel(
const String& text,
size_t start_char,
float pixel,
358 float x_scale = 1.0f)
const;
371 { d_defaultResourceGroup = resourceGroup; }
382 {
return d_defaultResourceGroup; }
408 const FontGlyph* getGlyphData(utf32 codepoint)
const;
414 const Sizef& native_res);
430 virtual void rasterise(utf32 start_codepoint, utf32 end_codepoint)
const;
433 virtual void updateFont() = 0;
436 virtual void writeXMLToStream_impl(
XMLSerializer& xml_stream)
const = 0;
439 void addFontProperties();
449 void setMaxCodepoint(utf32 codepoint);
452 virtual const FontGlyph* findFontGlyph(
const utf32 codepoint)
const;
463 static String d_defaultResourceGroup;
475 Sizef d_nativeResolution;
482 utf32 d_maxCodepoint;
497 uint* d_glyphPageLoaded;
500 typedef std::map<utf32, FontGlyph, std::less<utf32>
510 #if defined(_MSC_VER)
511 # pragma warning(pop)
515 #endif // end of guard _CEGUIFont_h_
Main namespace for Crazy Eddie's GUI Library.
Definition: cegui/include/CEGUI/Affector.h:42
EventArgs based class that is used for notifications regarding Font objects.
Definition: cegui/include/CEGUI/InputEvent.h:380
Abstract class defining the interface for objects that buffer geometry for later rendering.
Definition: cegui/include/CEGUI/GeometryBuffer.h:42
uint32 argb_t
32 bit ARGB representation of a colour.
Definition: cegui/include/CEGUI/Colour.h:38
Class that holds details of colours for the four corners of a rectangle.
Definition: cegui/include/CEGUI/ColourRect.h:43
AutoScaledMode
Definition: cegui/include/CEGUI/Image.h:39
float getFontHeight(float y_scale=1.0f) const
return the exact pixel height of the font.
Definition: debian/tmp/usr/include/cegui-0.8.4/CEGUI/Font.h:221
internal class representing a single font glyph.
Definition: cegui/include/CEGUI/FontGlyph.h:42
static void setDefaultResourceGroup(const String &resourceGroup)
Sets the default resource group to be used when loading font data.
Definition: debian/tmp/usr/include/cegui-0.8.4/CEGUI/Font.h:370
Class that encapsulates a typeface.
Definition: cegui/include/CEGUI/Font.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: debian/tmp/usr/include/cegui-0.8.4/CEGUI/Font.h:236
static const String & getDefaultResourceGroup()
Returns the default resource group currently set for Fonts.
Definition: debian/tmp/usr/include/cegui-0.8.4/CEGUI/Font.h:381
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: debian/tmp/usr/include/cegui-0.8.4/CEGUI/Font.h:325
std::map< utf32, FontGlyph, std::less< utf32 > CEGUI_MAP_ALLOC(utf32, FontGlyph)> CodepointMap
Definition of CodepointMap type.
Definition: debian/tmp/usr/include/cegui-0.8.4/CEGUI/Font.h:501
Class used to create XML Document.
Definition: cegui/include/CEGUI/XMLSerializer.h:85
Class encapsulating operations on a Rectangle.
Definition: cegui/include/CEGUI/ForwardRefs.h:89
String class used within the GUI system.
Definition: cegui/include/CEGUI/String.h:62
float getLineSpacing(float y_scale=1.0f) const
Return the pixel line spacing value for.
Definition: debian/tmp/usr/include/cegui-0.8.4/CEGUI/Font.h:206
bool isCodepointAvailable(utf32 cp) const
Return whether this Font can draw the specified code-point.
Definition: debian/tmp/usr/include/cegui-0.8.4/CEGUI/Font.h:99