unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Oliver Scholz <alkibiades@gmx.de>
Subject: Re: Unicode box-drawing chars
Date: Fri, 13 Sep 2002 13:57:24 +0200	[thread overview]
Message-ID: <m3sn0fat6w.fsf@ID-87814.user.dfncis.de> (raw)
In-Reply-To: vafr8fz9uqs.fsf@lucy.cs.uni-dortmund.de

Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Großjohann) writes:

> Oliver Scholz <alkibiades@gmx.de> 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
  weird?

* 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
  something?

* 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é!

  parent reply	other threads:[~2002-09-13 11:57 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-12 14:42 Unicode box-drawing chars Oliver Scholz
2002-09-12 13:27 ` Jesper Harder
2002-09-12 14:09   ` Kai Großjohann
2002-09-13  1:15     ` Galen Boyer
2002-09-13  1:36     ` Jesper Harder
2002-09-13 12:04       ` Oliver Scholz
2002-09-14 20:49         ` Jesper Harder
2002-09-12 13:56 ` Kai Großjohann
2002-09-12 15:44   ` Roman Belenov
2002-09-13 11:57   ` Oliver Scholz [this message]
2002-09-13 16:14     ` Kai Großjohann
2002-09-14  7:46       ` Graphics in Emacs (was: Unicode box-drawing chars) Oliver Scholz
2002-09-14  6:59         ` Stefan Monnier <foo@acm.com>
2002-09-15 19:58           ` Oliver Scholz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3sn0fat6w.fsf@ID-87814.user.dfncis.de \
    --to=alkibiades@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).