Laxkit  0.0.7.1
Public Member Functions | Public Attributes
Laxkit::LaxFontCairo Class Reference

A LaxFont using cairo. More...

Inheritance diagram for Laxkit::LaxFontCairo:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 LaxFontCairo (const char *fontconfigstr, int nid)
 Constructor.
 LaxFontCairo (const char *family, const char *style, double size, int nid)
virtual double charwidth (unsigned long chr, int real, double *width=NULL, double *height=NULL)
 Return the character width of ch.
virtual double contextcharwidth (char *start, char *pos, int real, double *width=NULL, double *height=NULL)
virtual double textheight ()
virtual double ascent ()
virtual double descent ()
virtual double Resize (double newsize)
- Public Member Functions inherited from Laxkit::LaxFont
 LaxFont (const char *fontconfigstr, int nid)
 Constructor. Uses a fontconfig description.
 LaxFont (const char *family, const char *style, double size, int nid)
virtual int laxfid ()
- Public Member Functions inherited from Laxkit::anObject
 anObject ()
 Set object_id=getUniqueNumber().
virtual ~anObject ()
 Empty virtual destructor.
virtual const charwhattype ()
 Returns the type of anObject.
virtual anObjectduplicate (anObject *ref=NULL)
virtual int inc_count ()
 Increment the data's count by 1. Returns count.
virtual int dec_count ()
 Decrement the count of the data, deleting if count is less than or equal to 0.
virtual int the_count ()

Public Attributes

cairo_font_extents_t extents
cairo_font_face_t * font
cairo_scaled_font_t * scaledfont
cairo_font_options_t * options
- Public Attributes inherited from Laxkit::LaxFont
int id
unsigned long textstyle
char cntlchar
- Public Attributes inherited from Laxkit::anObject
int suppress_debug
DeleteRefCountedFunc deleteMe
 Called when the count is decremented to 0.
unsigned long object_id
charobject_idstr

Detailed Description

A LaxFont using cairo.

Fonts in cairo have a base font (cairo_font_face_t) and a font at a particular size or transform (cairo_scaled_font_t), held here by font and scaledfont respectively.


Member Function Documentation

double Laxkit::LaxFontCairo::charwidth ( unsigned long  chr,
int  real,
double *  width = NULL,
double *  height = NULL 
)
virtual

Return the character width of ch.

This assumes the charwidth array exists already. If the real character width is 0, and r==0, this returns width of "\9f" or some such. Of course, this function is for latin-1 only.

Todo:
*** this is broken

Implements Laxkit::LaxFont.

double Laxkit::LaxFontCairo::contextcharwidth ( char start,
char pos,
int  real,
double *  width = NULL,
double *  height = NULL 
)
virtual

Some languages change the character based on where letter is in word.

Todo:
This function as it stands is totally worthless and meaningless.

Implements Laxkit::LaxFont.


The documentation for this class was generated from the following files:

Mon Feb 17 2014 11:52:59, Laxkit