Bug 185492 - improvement of font selection in pango
improvement of font selection in pango
Status: CLOSED UPSTREAM
Product: Fedora
Classification: Fedora
Component: pango (Show other bugs)
5
All Linux
medium Severity low
: ---
: ---
Assigned To: Behdad Esfahbod
: i18n
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-03-15 01:32 EST by Jong Bae KO
Modified: 2007-11-30 17:11 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-07-27 19:06:10 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
GNOME Desktop 334392 None None None Never

  None (edit)
Description Jong Bae KO 2006-03-15 01:32:41 EST
Description of problem:
Kenichi said that "Pango's shaper engine (struct _PangoEngineShapeClass) can
have a callback function "covers", but it seems that it is
not utilized that much.  In the function
get_shaper_and_font_foreach(), the return value of
(PangoCoverageLevel) _pango_engine_shape_covers() is simply
checked against PANGO_COVERAGE_NONE, and if any other value
is returned, that font is accepted.

I think it is better to try another font if
PANGO_COVERAGE_FALLBACK or PANGO_COVERAGE_APPROXIMATE is
returned here until PANGO_COVERAGE_EXACT is returned.

That way, pango can use a font most preferred by a shaper
engine while falling back to APPROXIMATE or FALLBACK font.

What do you think?

If the patch is accepted, the next step will be to modify
each shape engine to supply proper "covers" function if the
default "covers" function is not enough.  For instance,
indic shaper should accept only proper OTFs."

http://bugzilla.gnome.org/show_bug.cgi?id=334392


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:


*** pango-context.c     04 Apr 2005 14:07:57 +0900      1.74
--- pango-context.c     22 Jul 2005 16:59:41 +0900      
***************
*** 867,872 ****
--- 867,873 ----
    GSList *engines;
    PangoEngineShape *shape_engine;
    PangoFont *font;
+   PangoCoverageLevel level;
  } GetShaperFontInfo;

  static gboolean
***************
*** 884,894 ****

        level = _pango_engine_shape_covers (engine, font,
                                          info->lang, info->wc);
!       if (level != PANGO_COVERAGE_NONE)
        {
          info->shape_engine = engine;
          info->font = g_object_ref (font);
!         return TRUE;
        }
      }

--- 885,899 ----

        level = _pango_engine_shape_covers (engine, font,
                                          info->lang, info->wc);
!       if (level > info->level)
        {
          info->shape_engine = engine;
+         if (info->font)
+           g_object_unref (info->font);
          info->font = g_object_ref (font);
!         info->level = level;
!         if (level == PANGO_COVERAGE_EXACT)
!           return TRUE;
        }
      }

***************
*** 926,931 ****
--- 931,937 ----
    info.wc = wc;
    info.shape_engine = NULL;
    info.font = NULL;
+   info.level = PANGO_COVERAGE_NONE;

    info.engines = state->exact_engines;
    if (state->enable_fallback)
Comment 1 Jong Bae KO 2006-03-15 01:43:37 EST
E-mail addresss
Kenichi Handa
handa@m17n.org
Comment 2 Matthias Clasen 2006-06-20 01:12:53 EDT
Reassigning pango bugs to Behdad.
Comment 3 Behdad Esfahbod 2006-07-27 19:06:10 EDT
Closing UPSTREAM.

Note You need to log in before you can comment on or make changes to this bug.