Laxkit
0.0.7.1
|
A LaxFont using cairo. More...
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 char * | whattype () |
Returns the type of anObject. | |
virtual anObject * | duplicate (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 |
char * | object_idstr |
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.
|
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.
Implements Laxkit::LaxFont.
|
virtual |
Some languages change the character based on where letter is in word.
Implements Laxkit::LaxFont.