diff options
author | Owen Taylor <otaylor@redhat.com> | 2001-09-18 20:05:20 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2001-09-18 20:05:20 +0000 |
commit | a49e070d24242c0297e6325587c4bc135e13e26c (patch) | |
tree | 0510d066cc185e9d0b1b736736da5266d259878e /pango/pangowin32-fontmap.c | |
parent | 39f3626e34e0522e0bdec591f6c0334307d39625 (diff) | |
download | pango-a49e070d24242c0297e6325587c4bc135e13e26c.tar.gz |
Up to 0.19.
Tue Sep 18 15:47:08 2001 Owen Taylor <otaylor@redhat.com>
* configure.in (PANGO_MINOR_VERSION): Up to 0.19.
* pango/pango-font.h pango/pango-fontmap.[ch] pango/fonts.c
pango/pangoxft-fontmap.c pango/pangoft-fontmap.c pango/pango-context.[ch]
pango/pangox-fontmap.c: Add new PangoFontFace and PangoFontFamily
object types, and change the font listing API to list faces and
families, instead of face names and font descriptions.
* pango/pango-font.h pango/fonts.c: Make PangoFontDescription
an opaque heap-allocated structure, add accessors and
convenience functions.
* pango/pango-font.h pango/pango-private.h: Make PangoFontMetrics
heap allocated, protect the structure definition with
#ifdef PANGO_ENABLE_BACKEND, and add getters for the fields.
* pango/pango-attributes.[ch] ( pango_attr_iterator_get_font):
instead of providing a base font description and one to fill
in, provide a single font description to modify based on
the attributes.
* pango/pango-attributes.[ch]: Fix PangoAttrFontDesc to have
a PangoFontDescription by reference, not by value.
* pango/pango-utils.[ch]: make pango_parse_style() and friends
take pointers to individual enumerations instead of to a
PangoFontDescription structure.
* pango/*.c: Fix for the PangoFontDescription and PangoFontMetrics
changes.
* pango/pango-{break,engine,indic,ot,xft}.h pango/Makefile.am
pango/opentype/Makefile.am: Protect portions with
PANGO_ENABLE_ENGINE to shrink the public API.
* modules/*/Makefile.am: -DPANGO_ENABLE_ENGINE.
* pango/{pangox.h,pangox-private.h} modules/basic/basic-x.c: Move
pango_x_font_get_unknown_glyph() into public header since it is
used from modules.
* pango/pango-{context,font,fontmap,modules.utils}.h pango/Makefile.am:
Protect portions with PANGO_ENABLE_BACKEND to shrink the public API.
* pango/*.h: Use G_BEGIN/END_DECLS
* examples/viewer-qt.[cc,h]: Fix for changes to font listing API,
PangoFontDescription.
* pango/pango-indic.h modules/indic/*: Since we install this
header fix it up to Pango conventions, namespece
ZERO_WIDTH_JOINER, ZERO_WIDTH_NON_JOINER.
* docs/pango-sections.txt: Updated.
Diffstat (limited to 'pango/pangowin32-fontmap.c')
-rw-r--r-- | pango/pangowin32-fontmap.c | 53 |
1 files changed, 22 insertions, 31 deletions
diff --git a/pango/pangowin32-fontmap.c b/pango/pangowin32-fontmap.c index 748100e9..4df6c257 100644 --- a/pango/pangowin32-fontmap.c +++ b/pango/pangowin32-fontmap.c @@ -442,31 +442,12 @@ pango_win32_font_map_load_font (PangoFontMap *fontmap, while (tmp_list) { PangoWin32FontEntry *font_entry = tmp_list->data; - - if (font_entry->description.variant == description->variant && - font_entry->description.stretch == description->stretch) - { - int old_distance = best_match ? abs(best_match->description.weight - description->weight) : G_MAXINT; - - if (font_entry->description.style == description->style) - { - int distance = abs(font_entry->description.weight - description->weight); - - if (distance < old_distance) - best_match = font_entry; - } - else if (font_entry->description.style != PANGO_STYLE_NORMAL && - description->style != PANGO_STYLE_NORMAL) - { - /* Equate oblique and italic, but with a big penalty - */ - int distance = PANGO_SCALE * 1000 + abs(font_entry->description.weight - description->weight); - - if (distance < old_distance) - best_match = font_entry; - } - } + if (pango_font_description_better_match (description, + best_match ? best_match->description : NULL, + font_entry->description)) + best_match = font_entry; + tmp_list = tmp_list->next; } @@ -529,6 +510,10 @@ pango_win32_font_map_read_alias_file (PangoWin32FontMap *win32fontmap, while (pango_read_line (infile, line_buf)) { PangoWin32FamilyEntry *family_entry; + PangoStyle style; + PangoVariant variant; + PangoWeight weight; + PangoStretch stretch; const char *p = line_buf->str; @@ -541,32 +526,38 @@ pango_win32_font_map_read_alias_file (PangoWin32FontMap *win32fontmap, goto error; font_entry = g_new (PangoWin32FontEntry, 1); - font_entry->description.family_name = g_strdup (tmp_buf->str); - g_strdown (font_entry->description.family_name); + font_entry->description = pango_font_description_new (); + g_string_ascii_down (tmp_buf); + pango_font_description_set_family (tmp_buf->str); + if (!pango_scan_string (&p, tmp_buf)) goto error; - if (!pango_parse_style (tmp_buf->str, &font_entry->description, TRUE)) + if (!pango_parse_style (tmp_buf->str, &style, TRUE)) goto error; + pango_font_description_set_style (font_entry->description, style); if (!pango_scan_string (&p, tmp_buf)) goto error; - if (!pango_parse_variant (tmp_buf->str, &font_entry->description, TRUE)) + if (!pango_parse_variant (tmp_buf->str, &variant, TRUE)) goto error; - + pango_font_description_set_variant (font_entry->description, variant); + if (!pango_scan_string (&p, tmp_buf)) goto error; - if (!pango_parse_weight (tmp_buf->str, &font_entry->description, TRUE)) + if (!pango_parse_weight (tmp_buf->str, &weight, TRUE)) goto error; + pango_font_description_set_weight (font_entry->description, weight); if (!pango_scan_string (&p, tmp_buf)) goto error; - if (!pango_parse_stretch (tmp_buf->str, &font_entry->description, TRUE)) + if (!pango_parse_stretch (tmp_buf->str, &stretch, TRUE)) goto error; + pango_font_description_set_stretch (font_entry->description, stretch); if (!pango_scan_string (&p, tmp_buf)) goto error; |