From 5ee19fca3c7c3da53ef4f000efdb3bbf4dcb1a04 Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Thu, 14 Jun 2001 20:38:25 +0000 Subject: Add a new PangoLanguage type to represent language tags; these can Sat Jun 9 17:36:09 2001 Owen Taylor * pango/pango-types.h pango/pango-utils.c: Add a new PangoLanguage type to represent language tags; these can efficiently be compared and don't need to be copied. Also add pango_language_matches() to match a language tag against a pattern. * pango/pango-item.[ch] pango/pango-layout.c: Move extra_attrs from PangoItem to PangoAnalysis. Add a language tag field to PangoAnalysis. (#55894) * pango/pango-attributes.[ch] (pango_attr_iterator_get_font): Return the language tag as well. * pango/pango-attributes.[ch]: Rename PangoAttrLang to PangoAttrLanguage, and make it hold a PangoLanguage. * pango/pango-context.[ch]: Rename pango_context_{get,set}_lang() to pango_context_{get,set}_language(). * **.[ch]: Adapt to PangoLanguage and s/lang/language/ changes. * modules/basic/basic-x.c modules/basic/tables-big.i: Add support for ordering character sets differently for different language tags. * pango/itemize.c: Remove old, unused file. * pango/pango-context.c (pango_itemize): Reduce number of mallocs by allocating one array of PangoAnalysis instead of many arrays. --- pango/fonts.c | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) (limited to 'pango/fonts.c') diff --git a/pango/fonts.c b/pango/fonts.c index c8d58201..606da183 100644 --- a/pango/fonts.c +++ b/pango/fonts.c @@ -27,6 +27,7 @@ #include "pango-types.h" #include "pango-font.h" #include "pango-fontmap.h" +#include "pango-utils.h" /** * pango_font_description_copy: @@ -443,25 +444,25 @@ pango_font_describe (PangoFont *font) /** * pango_font_get_coverage: * @font: a #PangoFont - * @lang: the language tag (in the form of "en_US") + * @lang: the language tag * * Compute the coverage map for a given font and language tag. * * Return value: a newly allocated #PangoContext object. **/ PangoCoverage * -pango_font_get_coverage (PangoFont *font, - const char *lang) +pango_font_get_coverage (PangoFont *font, + PangoLanguage *language) { g_return_val_if_fail (font != NULL, NULL); - return PANGO_FONT_GET_CLASS (font)->get_coverage (font, lang); + return PANGO_FONT_GET_CLASS (font)->get_coverage (font, language); } /** * pango_font_find_shaper: * @font: a #PangoFont - * @lang: the language tag (in the form of "en_US") + * @language: the language tag * @ch: the ISO-10646 character code. * * Find the best matching shaper for a font for a particular @@ -470,15 +471,15 @@ pango_font_get_coverage (PangoFont *font, * Return value: the best matching shaper. **/ PangoEngineShape * -pango_font_find_shaper (PangoFont *font, - const char *lang, - guint32 ch) +pango_font_find_shaper (PangoFont *font, + PangoLanguage *language, + guint32 ch) { PangoEngineShape* shaper; g_return_val_if_fail (font != NULL, NULL); - shaper = PANGO_FONT_GET_CLASS (font)->find_shaper (font, lang, ch); + shaper = PANGO_FONT_GET_CLASS (font)->find_shaper (font, language, ch); return shaper; } @@ -514,9 +515,9 @@ pango_font_get_glyph_extents (PangoFont *font, /** * pango_font_get_metrics: * @font: a #PangoFont - * @lang: language tag used to determine which script to get the metrics - * for, or %NULL to indicate to get the metrics for the entire - * font. + * @language: language tag used to determine which script to get the metrics + * for, or %NULL to indicate to get the metrics for the entire + * font. * @metrics: Structure to fill in with the metrics of the font * * Get overall metric information for a font. Since the metrics may be @@ -527,10 +528,8 @@ pango_font_get_glyph_extents (PangoFont *font, void pango_font_get_metrics (PangoFont *font, - const gchar *lang, + PangoLanguage *language, PangoFontMetrics *metrics) { - g_return_if_fail (font != NULL); - - PANGO_FONT_GET_CLASS (font)->get_metrics (font, lang, metrics); + PANGO_FONT_GET_CLASS (font)->get_metrics (font, language, metrics); } -- cgit v1.2.1