From 27004a4dace9d39dc2efb75151e6b3970b3ff66d Mon Sep 17 00:00:00 2001 From: Richard Hult Date: Sun, 18 Mar 2007 14:07:42 +0000 Subject: Bug 419262 - Don't create coverage every time it's asked for 2007-03-18 Richard Hult Bug 419262 - Don't create coverage every time it's asked for * pango/pangoatsui.c: (pango_atsui_font_get_coverage): * pango/pangoatsui-fontmap.c: Pass around a PangoATSUIFace instead of the postscript name string. Move the coverage creation from the font to the face, and get the coverage from the face instead of creating it every time. * pango/pangocairo-atsui.h: * pango/pangocairo-atsuifont.c: (_pango_cairo_atsui_font_new): Use the face instead of the postscript name. * pango/pangoatsui-private.h: * pango/pangocairo-atsuifontmap.c: Add getters for the postscript name and coverage for the face. svn path=/trunk/; revision=2218 --- pango/pangoatsui.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'pango/pangoatsui.c') diff --git a/pango/pangoatsui.c b/pango/pangoatsui.c index 231c1002..dcb410df 100644 --- a/pango/pangoatsui.c +++ b/pango/pangoatsui.c @@ -1,7 +1,7 @@ /* Pango * pangatsui.c * - * Copyright (C) 2005 Imendio AB + * Copyright (C) 2005-2007 Imendio AB * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -30,7 +30,6 @@ pango_atsui_font_finalize (GObject *object) { PangoATSUIFont *font = (PangoATSUIFont *)object; - g_free (font->postscript_name); pango_font_description_free (font->desc); g_object_unref (font->fontmap); @@ -50,18 +49,8 @@ static PangoCoverage * pango_atsui_font_get_coverage (PangoFont *font, PangoLanguage *language) { - PangoCoverage *coverage; - int i; - - /* FIXME: Currently we say that all fonts have the - * 255 first glyphs. This is not true. - */ - coverage = pango_coverage_new (); - - for (i = 0; i < 256; i++) - pango_coverage_set (coverage, i, PANGO_COVERAGE_EXACT); - - return coverage; + return pango_coverage_ref (_pango_atsui_face_get_coverage (PANGO_ATSUI_FONT (font)->face, + language)); } static PangoEngineShape * -- cgit v1.2.1