static void draw_string (DiaRenderer *object, const gchar *text, Point *pos, Alignment alignment, Color *color) { TextLine *text_line = text_line_new(text, object->font, object->font_height); draw_text_line(object, text_line, pos, alignment, color); text_line_destroy(text_line); }
static void draw_string(DiaRenderer *self, const char *text, Point *pos, Alignment alignment, Color *colour) { TextLine *text_line = text_line_new(text, self->font, self->font_height); draw_text_line(self, text_line, pos, alignment, colour); text_line_destroy(text_line); }
real dia_font_string_width(const char* string, DiaFont *font, real height) { real result = 0; if (string && *string) { TextLine *text_line = text_line_new(string, font, height); result = text_line_get_width(text_line); text_line_destroy(text_line); } return result; }
static void draw_string(DiaRenderer *self, const char *text, Point *pos, Alignment alignment, Color *color) { DiaPsFt2Renderer *renderer = DIA_PS_FT2_RENDERER(self); TextLine *text_line = text_line_new(text, renderer->current_font, renderer->current_height); draw_text_line(self, text_line, pos, alignment, color); text_line_destroy(text_line); }
static void free_string(Text *text) { int i; for (i=0;i<text->numlines;i++) { text_line_destroy(text->lines[i]); } g_free(text->lines); text->lines = NULL; }
real dia_font_descent(const char* string, DiaFont* font, real height) { if (font->metrics) { real descent = pdu_to_dcm(pango_font_metrics_get_descent (font->metrics)); return descent * (height / font->height); } else { /* previous, _expensive_ but string specific way */ TextLine *text_line = text_line_new(string, font, height); real result = text_line_get_descent(text_line); text_line_destroy(text_line); return result; } }