#include <xap_CocoaFont.h>
Public Types | |
enum | RemapFont { rf_None = 0, rf_Symbols, rf_Dings } |
Public Member Functions | |
XAP_CocoaFont () | |
XAP_CocoaFont (NSFont *font) | |
XAP_CocoaFont (const XAP_CocoaFont ©) | |
~XAP_CocoaFont () | |
ATSUStyle | makeAtsuStyle (NSFont *font) const |
NSFont * | getNSFont (void) const |
UT_uint32 | getSize (void) |
const char * | getName (void) |
float | getAscent () |
float | getDescent () |
float | getHeight () |
void | getCoverage (UT_NumberVector &coverage) |
virtual UT_sint32 | measureUnremappedCharForCache (UT_UCSChar cChar) const |
virtual bool | glyphBox (UT_UCS4Char g, UT_Rect &rec, GR_Graphics *) |
bool | needsRemap () |
UT_UCS4Char | remapChar (UT_UCS4Char charCode) const |
Static Public Member Functions | |
static RemapFont | remapFont (NSFont *font) |
static UT_UCS4Char | remapChar (UT_UCS4Char charCode, RemapFont rf) |
Private Member Functions | |
void | _resetMetricsCache () |
UT_sint32 | _measureChar (UT_UCSChar cChar, ATSUStyle style) const |
Static Private Member Functions | |
static void | _initMetricsLayouts (void) |
Private Attributes | |
RemapFont | m_rfRemap |
NSFont * | m_font |
ATSUStyle | m_styleForCache |
UT_uint32 | _m_size |
volatile float | _m_ascent |
volatile float | _m_descent |
volatile float | _m_height |
UT_NumberVector * | _m_coverage |
unichar | _m_text [2] |
buffer for the text layout | |
Static Private Attributes | |
static ATSUTextLayout | s_atsuLayout = NULL |
XAP_CocoaFont::XAP_CocoaFont | ( | ) |
References _resetMetricsCache(), GR_Font::m_hashKey, m_rfRemap, and rf_None.
XAP_CocoaFont::XAP_CocoaFont | ( | NSFont * | font | ) |
References _resetMetricsCache(), m_font, GR_Font::m_hashKey, m_rfRemap, and remapFont().
XAP_CocoaFont::XAP_CocoaFont | ( | const XAP_CocoaFont & | copy | ) |
References _resetMetricsCache(), getNSFont(), GR_Font::hashKey(), m_font, GR_Font::m_hashKey, m_rfRemap, and remapFont().
XAP_CocoaFont::~XAP_CocoaFont | ( | ) |
References _m_coverage, DELETEP, m_font, and m_styleForCache.
ATSUStyle XAP_CocoaFont::makeAtsuStyle | ( | NSFont * | font | ) | const |
References FloatToFixed, and UT_ASSERT.
Referenced by measureUnremappedCharForCache(), and GR_CocoaGraphics::setFont().
NSFont* XAP_CocoaFont::getNSFont | ( | void | ) | const [inline] |
References m_font.
Referenced by GR_CocoaGraphics::_findFont(), GR_CocoaGraphics::setFont(), and XAP_CocoaFont().
UT_uint32 XAP_CocoaFont::getSize | ( | void | ) |
const char * XAP_CocoaFont::getName | ( | void | ) |
References m_font.
float XAP_CocoaFont::getAscent | ( | ) |
float XAP_CocoaFont::getDescent | ( | ) |
References _m_descent, m_font, and UT_ASSERT.
Referenced by GR_CocoaGraphics::getFontDescent(), and getHeight().
float XAP_CocoaFont::getHeight | ( | ) |
References _m_height, getAscent(), and getDescent().
Referenced by GR_CocoaGraphics::getFontHeight().
void XAP_CocoaFont::getCoverage | ( | UT_NumberVector & | coverage | ) |
References _m_coverage, int(), m_font, UT_GenericVector< T >::push_back(), and xxx_UT_DEBUGMSG.
Referenced by GR_CocoaGraphics::getCoverage().
UT_sint32 XAP_CocoaFont::measureUnremappedCharForCache | ( | UT_UCSChar | cChar | ) | const [virtual] |
Implements GR_Font.
References _measureChar(), GR_CharWidthsCache::CACHE_FONT_SIZE, m_font, m_styleForCache, and makeAtsuStyle().
bool XAP_CocoaFont::glyphBox | ( | UT_UCS4Char | g, | |
UT_Rect & | rec, | |||
GR_Graphics * | ||||
) | [virtual] |
bool XAP_CocoaFont::needsRemap | ( | ) | [inline] |
XAP_CocoaFont::RemapFont XAP_CocoaFont::remapFont | ( | NSFont * | font | ) | [static] |
References rf_Dings, rf_None, and rf_Symbols.
Referenced by _measureChar(), glyphBox(), and XAP_CocoaFont().
UT_UCS4Char XAP_CocoaFont::remapChar | ( | UT_UCS4Char | charCode, | |
RemapFont | rf | |||
) | [static] |
References rf_Dings, and rf_Symbols.
Referenced by _measureChar(), GR_CocoaGraphics::drawChars(), glyphBox(), and remapChar().
UT_UCS4Char XAP_CocoaFont::remapChar | ( | UT_UCS4Char | charCode | ) | const [inline] |
References m_rfRemap, and remapChar().
void XAP_CocoaFont::_resetMetricsCache | ( | ) | [private] |
References _m_ascent, _m_coverage, _m_descent, _m_height, _m_size, _m_text, and DELETEP.
Referenced by XAP_CocoaFont().
void XAP_CocoaFont::_initMetricsLayouts | ( | void | ) | [static, private] |
UT_sint32 XAP_CocoaFont::_measureChar | ( | UT_UCSChar | cChar, | |
ATSUStyle | style | |||
) | const [private] |
Measure the char for the given NSFont
References _initMetricsLayouts(), _m_text, after, m_font, m_styleForCache, remapChar(), remapFont(), s_atsuLayout, and UT_ASSERT.
Referenced by measureUnremappedCharForCache().
RemapFont XAP_CocoaFont::m_rfRemap [private] |
Referenced by needsRemap(), remapChar(), and XAP_CocoaFont().
NSFont* XAP_CocoaFont::m_font [private] |
Referenced by _measureChar(), getAscent(), getCoverage(), getDescent(), getName(), getNSFont(), getSize(), glyphBox(), measureUnremappedCharForCache(), XAP_CocoaFont(), and ~XAP_CocoaFont().
ATSUStyle XAP_CocoaFont::m_styleForCache [mutable, private] |
Referenced by _measureChar(), measureUnremappedCharForCache(), and ~XAP_CocoaFont().
UT_uint32 XAP_CocoaFont::_m_size [private] |
Referenced by _resetMetricsCache(), and getSize().
volatile float XAP_CocoaFont::_m_ascent [private] |
Referenced by _resetMetricsCache(), and getAscent().
volatile float XAP_CocoaFont::_m_descent [private] |
Referenced by _resetMetricsCache(), and getDescent().
volatile float XAP_CocoaFont::_m_height [private] |
Referenced by _resetMetricsCache(), and getHeight().
UT_NumberVector* XAP_CocoaFont::_m_coverage [private] |
Referenced by _resetMetricsCache(), getCoverage(), and ~XAP_CocoaFont().
unichar XAP_CocoaFont::_m_text[2] [mutable, private] |
ATSUTextLayout XAP_CocoaFont::s_atsuLayout = NULL [static, private] |
static metrics stuff
Referenced by _initMetricsLayouts(), and _measureChar().