Bug 185492 - improvement of font selection in pango
Summary: improvement of font selection in pango
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: pango   
(Show other bugs)
Version: 5
Hardware: All Linux
medium
low
Target Milestone: ---
Assignee: Behdad Esfahbod
QA Contact:
URL:
Whiteboard:
Keywords: i18n
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-03-15 06:32 UTC by Jong Bae KO
Modified: 2007-11-30 22:11 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-07-27 23:06:10 UTC
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 Bugzilla 334392 None None None Never

Description Jong Bae KO 2006-03-15 06:32:41 UTC
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 06:43:37 UTC
E-mail addresss
Kenichi Handa
handa@m17n.org

Comment 2 Matthias Clasen 2006-06-20 05:12:53 UTC
Reassigning pango bugs to Behdad.

Comment 3 Behdad Esfahbod 2006-07-27 23:06:10 UTC
Closing UPSTREAM.


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