emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [emacs-bidi] Treatment of LRE,RLE,LRO,RLO,PDF,LRM,RLM


From: Kenichi Handa
Subject: Re: [emacs-bidi] Treatment of LRE,RLE,LRO,RLO,PDF,LRM,RLM
Date: Mon, 01 Nov 2010 17:15:13 +0900

In article <address@hidden>, Kenichi Handa <address@hidden> writes:

> I'd like to extend the elements of a display table.
> Currently only a glyph vector or nil is allowed.  It seems
> good to extend it so that it can completely control the
> displaying of a character (like by face and display text
> properties).

> At least, for (2), I want to specify a space width (relative
> or absolute), and for (4) I want to specify a special form
> (list?) containing a mnemonic label.

I've just committed a basic infrastructure for displaying
non-graphic and no-font characters.  For that, instead of
extending the current display table, I implemented a new
char table glyphless-char-display.

------------------------------------------------------------
Char-table to control displaying of glyphless characters.
Each element, if non-nil, is an ASCII acronym string (displayed in a box)
or one of these symbols:
  hexa-code: display with hexadecimal character code in a box
  empty-box: display with an empty box
  thin-space: display with 1-pixel width space
  zero-width: don't display

It has one extra slot to control the display of a character for which
no font is found.  The value of the slot is `hexa-code' or `empty-box'.
The default is `empty-box'.
------------------------------------------------------------

It is easy to merge such functionality to a display table
later if we decide to do so.

But, there left these works.

(1) As it is not convenient for a user to specify each
    element of glyphless-char-display, I made variables
    char-acronym-table and glyphless-char-control.  The
    former is a simple char-table that contains acronym
    strings.  The latter is as this:

------------------------------------------------------------
glyphless-char-control is a variable defined in `characters.el'.
Its value is 
((format-control . thin-space)
 (no-font . hexa-code))

Documentation:
List of directives to control displaying of glyphless characters.

Each element has the form (TARGET . METHOD), where TARGET is a
symbol specifying the target character group to control, and
METHOD is a symbol specifying the method of displaying them.

TARGET must be one of these symbols:
  `c0-control': U+0000..U+001F.
  `c1-control': U+0080..U+009F.
  `format-control': Characters of Unicode General Category `Cf'.
     Ex: U+200C (ZWNJ), U+200E (LRM)), but don't include characters
     that have graphic image such as U+00AD (SHY).
  `no-font': characters for which no suitable font is found.

METHOD must be one of these symbols:
  `zero-width': don't display.
  `thin-space': display a thin space (1-pixel width).
  `empty-box': display an empty box.
  `acronym': display an acronum string in a box.
  `hexa-code': display a hexadecimal character code in a box.

Just setting this variable does not take effect.  Call the
function `update-glyphless-char-display' (which see) after
setting this variable.
------------------------------------------------------------

When acronum is specified, the function
update-glyphless-char-display sets elements in
glyphless-char-display to acronyms stored in
char-acronym-table.

Actually, glyphless-char-control should be a customizable
variable with proper set: function.  But, I don't know how
to write the correct 'defcustom' form.  Could someone DTRT?

(2) For Windows port:

I wrote x_draw_glyphless_glyph_string_foreground (in
w32term.c) by referring to x_draw_glyph_string_foreground in
the same file.  But, it doesn't draw acronym nor hexa-code.
I couldn't figure out what is wrong.  Please someone who
knows Windows code fix it.

(3) For mac port:

As I have no idea how to write a code for mac, the 'case
GLYPHLESS_GLYPH:' part in ns_draw_glyph_string (in nsterm.m)
is not finished.  Please fill in the correct code by
referring to x_draw_glyph_string_foreground in xterm.c.

---
Kenichi Handa
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]