From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Oliver Scholz Newsgroups: gmane.emacs.help Subject: Re: Unicode box-drawing chars Date: Fri, 13 Sep 2002 13:57:24 +0200 Organization: Olymp Sender: help-gnu-emacs-admin@gnu.org Message-ID: References: NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1031913439 29793 127.0.0.1 (13 Sep 2002 10:37:19 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 13 Sep 2002 10:37:19 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17pnp7-0007kI-00 for ; Fri, 13 Sep 2002 12:37:17 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17pnoq-0002wf-00; Fri, 13 Sep 2002 06:37:00 -0400 Original-Path: shelby.stanford.edu!nntp.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!fu-berlin.de!uni-berlin.de!dialin-145-254-201-144.arcor-ip.NET!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 78 Original-NNTP-Posting-Host: dialin-145-254-201-144.arcor-ip.net (145.254.201.144) Original-X-Trace: fu-berlin.de 1031912756 658451 145.254.201.144 (16 [87814]) X-Orig-Path: hermes!nobody X-Operating-System: Linux from Scratch X-Attribution: os X-Face: "HgH2sgK|bfH$;PiOJI6|qUCf.ve<51_Od(%ynHr?=>znn#~#oS>",F%B8&\vus),2AsPYb -n>PgddtGEn}s7kH?7kH{P_~vu?]OvVN^qD(L)>G^gDCl(U9n{:d>'DkilN!_K"eNzjrtI4Ya6;Td% IZGMbJ{lawG+'J>QXPZD&TwWU@^~A}f^zAb[Ru;CT(UA]c& User-Agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2 (i686-pc-linux-gnu) Cancel-Lock: sha1:ITh2aAj7HX+OLBSG0+LioEGw+nU= Original-Xref: nntp.stanford.edu gnu.emacs.help:104870 Original-To: help-gnu-emacs@gnu.org Errors-To: help-gnu-emacs-admin@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.help:1425 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:1425 Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Großjohann) writes: > Oliver Scholz 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é!