Logo Search packages:      
Sourcecode: pango-graphite version File versions  Download package

gr::PangoGrFont::PangoGrFont ( PangoFcFont *  l_pFont  ) 

The main user constructor. Constructs the font from the supplied XftFont.

Parameters:
xftFont the XftFont pointer to initialise from (must not be null)

Definition at line 23 of file PangoGrFont.cpp.

References gr::FreetypeFont::setBold(), gr::FreetypeFont::setFace(), and gr::FreetypeFont::setItalic().

  : FreetypeFont(NULL), m_fcFont(pangoFont), m_cref(1), m_locked(false)
{
  FT_Face l_face;
  Assert(pangoFont); // shouldn't be null but we play safe anyway
  l_face = lockFace();
  Assert(l_face);
  // Generate cache info (what does that mean?)
    if (m_fcFont)
    {
        int weight = 0, slant = 0;
        FcChar8 * family;
        
        FcPatternGetInteger (m_fcFont->font_pattern, FC_WEIGHT, 0, &weight);
        FcPatternGetInteger (m_fcFont->font_pattern, FC_SLANT, 0, &slant);
        
        setBold(weight > 150 ? true : false);
        setItalic(slant > 50 ? true : false);
        
        FcPatternGetString (m_fcFont->font_pattern, FC_FAMILY, 0, &family);
        strncpy(m_stFace, (const char *)family, kMaxFaceLength);
    }
  setFace(l_face);
}


Generated by  Doxygen 1.6.0   Back to index