[Top][All Lists]

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

Re: Unicode box-drawing chars

From: Oliver Scholz
Subject: Re: Unicode box-drawing chars
Date: Fri, 13 Sep 2002 13:57:24 +0200
User-agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2 (i686-pc-linux-gnu)

address@hidden (Kai Großjohann) writes:

> Oliver Scholz <address@hidden> writes:
>> How do I deal with UCS box-drawing chars in Emacs? With the use of
>> font-sets, it is very likely that the box-drawing chars and the
>> latin-chars (and the Space) have different character width. So I can
>> not rely on the box-drawing-chars being properly aligned.
> Don't use characters of different width.
> It seems that there is no way to really solve your problem, so one
> might as well ignore it...

Well, actually I am not sure what my problem is, myself. I just happen
to browse through the Unicode spec currently. I have read about the
box drawing characters there and I wondered what we could do with them
in Emacs. Let's say, I'd like to explore the field of what could be
done and where the limitations lie.

It would be nice, if I could define a fontset in which the codepage
containing the box drawing chars (U+2500 to U+257f) are assigned to a
different font than the rest. So I could make sure that their width
matches the width of the default font.

But I guess, I was rather thinking of using those chars in Elisp
libraries. Suppose I want to make Emacs/W3 render tables with those
chars or to take another example: Suppose I want to write this
not-yet-existing function:

| insert-in-box is an interactive compiled function in XXXXX.el
| (insert-in-box string width &optional position)
| Insert STRING in a box drawn with UCS box drawing chars.
| WIDTH is the width of the box in characters. If optional third
| argument POSITION is an integer, insert the box at that buffer
| position. If it is a cons cell, the car is interpreted as the column
| and the cdr as the row. If it is omitted or nil, insert the box at
| point.

What could I do to make sure, that this works as expected?

* Check for the width of the Latin font and the box drawing chars and
  scale the Unicode font if necessary

* Check for the width as above, but care for the proper alignment by
  inserting spaces after the Latin font. (IIRC Emacs allows for spaces
  of arbitrary width.)

* Both of the above, because the two fonts could have a different
  geometry at all.

* Ignore the problem and hope that the sizes match. I guess I partly
  asked my question, because I wanted to know how likely this is to
  happen. Maybe it is not correct for me only because my setup is

* Maybe the box-drawing chars are not the right thing for this job?
  Perhaps it's better to generate pbm or xpm graphics on the fly and
  use them? AFAIK XEmacs supports images in display-tables. So this
  would be a lot easier in XEmacs than in Emacs. Or am I missing

* Use the classical "+", "-" and "|" from ascii by default, but
  provide a variable, so that the user can enable the Unicode-drawing.

Hmpf, I guess the last option would be the easiest and the most common
solution. But this would mean that we can not provide nice graphics as
a default. What a pity.

    -- Oliver, who wants more graphics and more eyecandy in Emacs

26 Fructidor an 210 de la Révolution
Liberté, Egalité, Fraternité!

reply via email to

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