After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 323661 - pango-querymodules sort order
pango-querymodules sort order
Status: RESOLVED OBSOLETE
Product: pango
Classification: Platform
Component: general
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: pango-maint
pango-maint
Depends on:
Blocks: pangographite
 
 
Reported: 2005-12-09 19:54 UTC by Daniel Glassey
Modified: 2015-08-15 03:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
test for a graphite subdir after other modules (1.05 KB, patch)
2006-02-03 00:08 UTC, Daniel Glassey
rejected Details | Review
check subdirs of default modules directory for modules as well (1.33 KB, patch)
2006-03-17 15:19 UTC, Daniel Glassey
none Details | Review
pango-querymodules to check sub-directories and check for duplicates (2.24 KB, patch)
2006-06-30 14:47 UTC, Daniel Glassey
needs-work Details | Review

Description Daniel Glassey 2005-12-09 19:54:02 UTC
from bug #322869 I'd like the ability for the order that the modules come in the
pango.modules file be something other than random (so that graphite can be last
in the list). Behdad would like the logic to be in querymodules.

Currently querymodules opens each directory in the config and reads the modules
in that directory in the order glib gives it.

An alternative is to put the logic into update-pango-modules(bug #322869). (I
don't care where as long as it is something that works and is acceptable).

This assumes that the fact that modules later in the pango.modules file are
preferred to those before them won't change.
Comment 1 Owen Taylor 2005-12-14 15:22:23 UTC
As I recall, at GUADEC, I suggested deleting all the
  { PANGO_SCRIPT_ARMENIAN, "*" },

and so forth out of basic-fc.c and leave just

  { PANGO_SCRIPT_COMMON,   "" }

That shouldn't have any affect on choice of the basic modules unless the
graphite module is installed, and then it will always prefer the graphite module
(If the graphite module lists itself as
{ PANGO_SCRIPT_COMMON,   "*" })

This doesn't encapsulate some of the tricky font-choice issues, but ordering
wouldn't help there either. There's no way by controlling
ordering that you can win over arabic-fc.c when there is a Silf table
and not when there is a GSUB table.

Did you try that?
Comment 2 Daniel Glassey 2006-02-03 00:08:35 UTC
Created attachment 58617 [details] [review]
test for a graphite subdir after other modules

I still have to do the test for correct behaviour that Owen proposed wrt graphite, opentype and 'dumb' arabic fonts getting the right shaper.

I've found that Doulos SIL still uses the basic shaper (as latin) unless latin:* is specified so I think that means that just having common just isn't enough.

This patch adds a special case - if a pangorc file hasn't been used to specify the directories to check then pango-query-modules will check a graphite subdir and add those modules last if they are found.
Comment 3 Behdad Esfahbod 2006-02-05 03:19:34 UTC
A definitely better approach is to scan the default directory (or any set directory) recursively.  I prefer to solve the problem such that modules do not need special support from Pango to work.
Comment 4 Daniel Glassey 2006-03-17 15:19:05 UTC
Created attachment 61444 [details] [review]
check subdirs of default modules directory for modules as well

I've made it so it checks just the subdirectories of the default directory. Do you want me to go ahead and change it to search recursively, and search subdirs in non-default directories - though that might get confusing if you put a subdir into PangoModules and get modules appearing more than once in the file.
Comment 5 Behdad Esfahbod 2006-03-17 15:54:43 UTC
Well, with recursive comes infinite recursion avoidance and other nasty stuff.  Unless there's some glib magic to do it for us, I won't require it.

Duplication avoidance on the other hand seems easy enough to be worth doing.
Comment 6 Daniel Glassey 2006-06-30 14:47:18 UTC
Created attachment 68220 [details] [review]
pango-querymodules to check sub-directories and check for duplicates

added a check for duplicates (store gquarks of the module filenames in a GSlist).
outputs a warning comment if there is a duplicate and only uses the first module.

made patch against current cvs.

Thanks,
Daniel
Comment 7 Behdad Esfahbod 2006-07-10 19:08:57 UTC
Thanks Daniel for the patch.  I wanted to commit it to put in today's devel release, but I highly prefer if the patch is reworked to:

  1) Instead of appending subdirs to the path string and later breaking it, I suggest writing a function to process a directory, and it then can handle modules.

  2) Make the subdir-searching logic fetch the list of subdirs and sort them first.

  3) Given above, it makes sense to move modules we install into a subdir called 50default, such that you can put modules before or after them.

  4) A hashtable instead of a GSList makes more sense.

Thanks
Comment 8 Behdad Esfahbod 2006-07-11 18:38:37 UTC
While we're at it, it makes sense to make pango install its modules in say $libdir/pango-1.13.3/modules, and also scan the current place as it's been doing already.  This way, multiple versions of the library can coexist and share external modules.  It defeats the ordering though, forcing all pango modules before or after external modules.
Comment 9 Behdad Esfahbod 2006-07-11 18:45:31 UTC
Just dumping ideas...

Another approach that may actually make more sense is to not make directory search recursive, but make it possible to have multiple pango.modules defined in the pangorc file.  Next, make pango read all files inside a directory instead of one pangorc file.  So:

Pango sorts and parses /etc/pango/pangorc/*
Default configuration, if any, can go into /etc/pango/pangorc/50default

And an external library installing modules somewhere, can drop a file in there, appending to ModuleFiles.


I'll try to give these more thought and come up with a proposal.
Comment 10 Behdad Esfahbod 2007-08-22 18:13:47 UTC
Another idea, given Owen's approach to bug 458674, would be to get rid of pango.modules files on Linux and make pango-querymodules generate fontconfig config files, so we can use fontconfig's directory scanning that is already there.
Comment 11 Matthias Clasen 2015-08-15 03:09:44 UTC
no longer relevant.