all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Bidirectional text in tooltips
@ 2010-11-06 14:14 Eli Zaretskii
  2010-11-06 17:23 ` Jan Djärv
  2010-11-06 17:28 ` Jan Djärv
  0 siblings, 2 replies; 4+ messages in thread
From: Eli Zaretskii @ 2010-11-06 14:14 UTC (permalink / raw)
  To: emacs-devel

I have committed to trunk revision 102265, which makes tooltips
support bidirectional text.  I made changes in w32fns.c and in xfns.c.
Only the former is fully tested, for the latter I could only test that
it builds correctly.  Please make sure the X build works as well (you
will find test cases near the end of this mail).

There remain two cases where I don't see in the sources the same code
as in xfns.c and w32fns.c.  One is the GTK build, which under
x_gtk_use_system_tooltips calls xg_prepare_tooltip and
xg_show_tooltip, which use GTK features to display tooltips.  Can
someone see if GTK does TRT when it shows tooltips with bidirectional
text (again, using the text cases below)?  If it doesn't, we will need
to find a way to fix that somehow.

The other case is NS.  IIUC, the place that calculates the width of
the tooltip is the setText method of the EmacsTooltip class,
implemented on nsmenu.m.  My reading of the setText method is that it
assumes a single line of text in the tip, is that right?  If so,
that's a bug in itself, I think.  In any case, if the NS build uses
the string length, it relies on the NS toolkit to DTRT, I think; can
someone please see if the results are satisfactory?

To test bidirectional tooltips, evaluate in "emacs -Q":

  (setq-default bidi-display-reordering t)

and then use these two test cases (copy-paste them into *scratch*):

(x-show-tip "שלום, עולם אכזר ומכוער!")

(x-show-tip "שלום, עולם אכזר ומכוער!

Hello, world!")

The first one should show a one-line tooltip, the second a 3-line
tooltip (with the 2nd line empty).  In both cases, the tooltip should
be just wide enough to display the entire text of each non-empty line.
(With previous code, you'd see an ugly 80-column wide tooltip in both
cases.)  In the second test case, the first line should be flushed all
the way to the right edge of the tooltip, while the last line should
be flushed to the left.

TIA




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-11-06 17:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-06 14:14 Bidirectional text in tooltips Eli Zaretskii
2010-11-06 17:23 ` Jan Djärv
2010-11-06 17:46   ` Eli Zaretskii
2010-11-06 17:28 ` Jan Djärv

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.