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 105553 - There should be a way to disable fallback.
There should be a way to disable fallback.
Status: RESOLVED FIXED
Product: pango
Classification: Platform
Component: general
unspecified
Other All
: Normal enhancement
: 1.4 API freeze
Assigned To: pango-maint
pango-maint
Depends on:
Blocks: 113452 119268
 
 
Reported: 2003-02-08 03:24 UTC by Noah Levitt
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
Here's a patch that works for me. (3.32 KB, patch)
2003-02-08 03:25 UTC, Noah Levitt
none Details | Review
proposed patch (10.12 KB, patch)
2003-04-19 16:01 UTC, Noah Levitt
none Details | Review
proposed patch attempt #3 (16.34 KB, patch)
2003-05-28 02:30 UTC, Noah Levitt
none Details | Review
simple test program for your enjoyment (2.48 KB, text/plain)
2003-05-28 02:33 UTC, Noah Levitt
  Details
new patch that applies to HEAD (details rather different from #2) (9.34 KB, patch)
2004-02-29 20:02 UTC, Noah Levitt
none Details | Review

Description Noah Levitt 2003-02-08 03:24:04 UTC
It would be useful to be able to disable the mechanism that falls back on
fonts other than the current font for characters not in the current font.
Comment 1 Noah Levitt 2003-02-08 03:25:35 UTC
Created attachment 14200 [details] [review]
Here's a patch that works for me.
Comment 2 Owen Taylor 2003-02-11 22:01:51 UTC
Should definitely be an attribute of some sort, not a context option.
Comment 3 Noah Levitt 2003-04-19 16:01:29 UTC
Created attachment 15856 [details] [review]
proposed patch
Comment 4 Owen Taylor 2003-04-30 19:56:01 UTC
+'true' or 'false' whether to fall back on other fonts when the active
+font lacks characters that need to be drawn. Fallback is enabled by
+default. Most applications should not disable fallback.
+</para></listitem>

Actually, the way it actually works doesn't match this very
well:

a) it's the _first_ font, not the explicitely specified font, which 
   may seem strange. If the user specifies "helvetica", and there 
   isn't helvetica on the system, it will apply to the first font in 
   "sans"

b) If the user specifies multiple fonts explicitely 
   family="helvetica,arial", then using arial for some character
   counts as a fallback (assuming that helvetica is there)
Comment 5 Noah Levitt 2003-05-28 02:30:49 UTC
Created attachment 16895 [details] [review]
proposed patch attempt #3
Comment 6 Noah Levitt 2003-05-28 02:33:14 UTC
Created attachment 16896 [details]
simple test program for your enjoyment
Comment 7 Owen Taylor 2004-02-21 17:37:09 UTC
Thinking abou this some, I like Patch #2 better than #3;
3 just gets really complex without necessarily making things
more what people would expect.

I think #2 is fine to commit, with these detailed comments:

* for the GMarkup and function docs, I'd just say something
like:

 fallback: If disabled, then characters will only be used
   from the closest matching font on the system. No fallback
   will be done to other fonts on the system that might
   contain the characters in the text.

* There is no point in removing a padding member since
  your patch does break API compat for backends (which
  is OK); a backend must implement get_base_font().

+          CHECK_DUPLICATE (lang);

should be CHECK_DUPLICATE (fallback), I think.
Comment 8 Noah Levitt 2004-02-29 20:02:44 UTC
Created attachment 24944 [details] [review]
new patch that applies to HEAD (details rather different from #2)
Comment 9 Noah Levitt 2004-02-29 20:32:39 UTC
Committed, with a few more changes suggested by Owen on irc.

2003-02-29  Noah Levitt  <nlevitt@columbia.edu>

	* docs/pango_markup.sgml:
	* docs/tmpl/text-attributes.sgml:
	* pango/pango-attributes.c:
	* pango/pango-attributes.h:
	* pango/pango-context.c:
	* pango/pango-markup.c: New attribute to turn font fallback on or off.
	(#105553)