From olli@lurza.secnetix.de  Wed Dec  7 18:08:37 2005
Return-Path: <olli@lurza.secnetix.de>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 0DE2816A42F
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  7 Dec 2005 18:08:37 +0000 (GMT)
	(envelope-from olli@lurza.secnetix.de)
Received: from lurza.secnetix.de (lurza.secnetix.de [83.120.8.8])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 797F743D94
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  7 Dec 2005 18:08:19 +0000 (GMT)
	(envelope-from olli@lurza.secnetix.de)
Received: from lurza.secnetix.de (qvcpah@localhost [127.0.0.1])
	by lurza.secnetix.de (8.13.4/8.13.4) with ESMTP id jB7I8GcT049960;
	Wed, 7 Dec 2005 19:08:16 +0100 (CET)
	(envelope-from oliver.fromme@secnetix.de)
Received: (from olli@localhost)
	by lurza.secnetix.de (8.13.4/8.13.1/Submit) id jB7I8Gmm049959;
	Wed, 7 Dec 2005 19:08:16 +0100 (CET)
	(envelope-from olli)
Message-Id: <200512071808.jB7I8Gmm049959@lurza.secnetix.de>
Date: Wed, 7 Dec 2005 19:08:16 +0100 (CET)
From: Oliver Fromme <olli@secnetix.de>
Reply-To: Oliver Fromme <olli@secnetix.de>
To: FreeBSD-gnats-submit@freebsd.org
Cc: Oliver Fromme <olli@secnetix.de>
Subject: [syscons] [patch] curses ACS line graphics support for iso15 fonts
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         90082
>Category:       bin
>Synopsis:       [syscons] [patch] curses ACS line graphics support for iso15 fonts
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          suspended
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Dec 07 18:10:01 GMT 2005
>Closed-Date:    
>Last-Modified:  Sat Jun 19 04:42:40 UTC 2010
>Originator:     Oliver Fromme
>Release:        FreeBSD 6.0-STABLE i386
>Organization:
secnetix GmbH & Co. KG, Munich, Germany
		http://www.secnetix.de/bsd
>Environment:

	The solution presented in this PR has been developed
	and tested under RELENG_6 (6.0-STABLE), but it is
	believed to apply to all versions from RELENG_4 to
	-current (HEAD).

>Description:

	Most users in western and central Europe use the
	"iso15" syscons fonts.  Those fonts don't contain
	the line drawing characters which are present in
	e.g. the cp437 fonts and are used by various
	console-based "GUI" programs, including sysinstall,
	the famous midnight commander and others.  Instead,
	simple ASCII characters such as "+" and "-" are
	used, which looks ugly.

	In the past years, a lot of users have complained
	about that problem (e.g. on the German BSD mailing
	lists; note that German requires an iso15 font).
	It was often mentioned that Linux does not suffer
	from the same problem.

	The fix below consists of a script that adds the
	missing characters to the existing iso15-8x*.fnt
	font files.  In conjunction with an appropriate
	termcap entry, the problem is solved.

>How-To-Repeat:

	Enable one of the "iso15" fonts (vidcontrol -l) and
	set TERM=cons25l1.  Then run sysinstall,midnight
	commander or any other curses based program that
	uses line drawing characters for window borders or
	similar.

>Fix:

The following script merges line drawing characters from
the cp437 fonts into the iso15 fonts.  The following
files are modified:

   iso15-8x8.fnt
   iso15-8x14.fnt
   iso15-8x16.fnt

The script must be run in a directory containing the
existing font files, i.e. either in

   /usr/share/syscons/fonts

or in the source tree:

   /usr/src/share/syscons/fonts

The new characters are placed in an unused range of the
iso15 fonts, beginning at position 128 (0x80).  All
existing characters are preserved, so the change should
be without any risk.

The "cons25l1" entry in the termcap must be changed
like this (and don't forget to rebuilt termcap.db with
cap_mkdb(1), and logout+login after the change so the
TERMCAP variable in your environment gets updated):

cons25l1|cons25-iso8859-1:\
	:ac=l\200m\201k\202j\203t\204u\205v\206w\207q\210x\211n\212`\213a\214f\260g\261~\267,\215+\216.\217-\220h\221i\2470\222y\223z\224{\225}\243:\
	:tc=cons25w:

Note:  The termcap source directory is /usr/src/share/termcap.

Here's the script to modify the fonts:

#!/bin/sh -

set -e

ACS_START=128
CP437_SRC="218 192 191 217 195 180 193 194 196 179 197
             4 176  27  26  25  24 177 219 243 242 227"

for H in 8 14 16; do

	CP437="cp437-8x$H"
	ISO15="iso15-8x$H"

	DD_ARGS="if=$CP437 of=$ISO15 bs=$H count=1 conv=notrunc"

	uudecode -p $CP437.fnt > $CP437
	uudecode -p $ISO15.fnt > $ISO15

	DST="$ACS_START"

	for SRC in $CP437_SRC; do
		dd $DD_ARGS skip=$SRC seek=$DST 2>/dev/null
		DST=$(( $DST + 1 ))
	done

	uuencode $ISO15 $ISO15 > $ISO15.fnt

	rm $CP437 $ISO15

done

#END.
>Release-Note:
>Audit-Trail:

From: Oliver Fromme <olli@lurza.secnetix.de>
To: bug-followup@FreeBSD.ORG, Oliver Fromme <olli@secnetix.de>
Cc:  
Subject: Re: conf/90082: [syscons] [patch] curses ACS line graphics support for 	iso15 fonts
Date: Wed, 7 Dec 2005 21:47:33 +0100 (CET)

 Just a small addendum ...
 
 1.  If you just want to test that stuff or play with it on
     your own machine:
 
     a.  Run the provided script as root in this directory:
         /usr/share/syscons/fonts
     b.  Activate the new fonts:
            vidcontrol -f iso15-8x8
            vidcontrol -f iso15-8x14
            vidcontrol -f iso15-8x16
     c.  Modify the "cons25l1" line in /usr/share/misc/termcap
         as explained in the PR above (i.e. update the "ac"
         capability line).
     d.  Update the termcap.db database file:
            cd /usr/share/misc; cap_mkdb termcap
     e.  Make sure that the "ttyv*" lines in /etc/ttys have
         "cons24l1" as the terminal type (the second-to-last
         character is a lower-case L, not the digit one).
         If you need to update /etc/ttys, type "kill -HUP 1"
         afterwards, so the init process will re-read it.
     f.  Log out and log in again (on a virtual terminal).
 
     Now run a curses-based program which uses line-drawing
     characters for window borders or similar, for example
     sysinstall or midnight commander.  You should see "real"
     graphical lines instead of "-" and "+" characters.
     Also, all ISO8859-15 characters still work, which you
     can easily test by typing "cat /usr/share/misc/latin1".
 
 2.  If you want to incorporate the changes into the official
     FreeBSD repository (if you're a committer):
 
     a.  Run the provided script as root in this directory:
         /usr/src/share/syscons/fonts
     b.  The new iso15-8x*.fnt files don't contain the CVS ID
         lines.  Copy them from the original files.  Then
         check the modified files into the repository.  These
         are the modified files:
            iso15-8x8.fnt
            iso15-8x14.fnt
            iso15-8x16.fnt
     c.  Modify the "cons25l1" line in the termcap source
         file:  /usr/src/share/termcap/termcap.src, as
         explained in the PR above (i.e. update the "ac"
         capability line).
 
 By the way, the same modification could be made to the
 ISO8859-1 fonts (iso-8x*.fnt).  But I'm not sure if it's
 worth it, because -1 isn't so widely used anymore, in
 favour of -15 because it contains the Euro sign (among
 few other changes).
 
 Best regards
    Oliver
 
 -- 
 Oliver Fromme,  secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing
 Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd
 Any opinions expressed in this message may be personal to the author
 and may not necessarily reflect the opinions of secnetix in any way.
 
 "And believe me, as a C++ programmer, I don't hesitate to question
 the decisions of language designers.  After a decent amount of C++
 exposure, Python's flaws seem ridiculously small." -- Ville Vainio

Adding to audit trail from misfiled PR conf/91569:

Date: Mon, 9 Jan 2006 22:35:22 +0100 (MET)
From: "Martin Jakob" <mj-mailinglist@gmx.de>

 I tried Olivers suggestions and they work very well. The programs (well,
 sysinstall and mc) i tried now show the proper graphic elements.
 Since i use the font "iso15-thin-8x16.fnt" i had to slightly change Olivers
 script to add the proper chars from the font "cp437-thin-8x16.fnt":
 
 --
 #!/bin/sh -
 
 set -e
 
 ACS_START=128
 CP437_SRC="218 192 191 217 195 180 193 194 196 179 197
              4 176  27  26  25  24 177 219 243 242 227"
 
 for H in 16; do
 
         CP437="cp437-thin-8x$H"
         ISO15="iso15-thin-8x$H"
 
         DD_ARGS="if=$CP437 of=$ISO15 bs=$H count=1 conv=notrunc"
 
         uudecode -p $CP437.fnt > $CP437
         uudecode -p $ISO15.fnt > $ISO15
 
         DST="$ACS_START"
 
         for SRC in $CP437_SRC; do
                 dd $DD_ARGS skip=$SRC seek=$DST 2>/dev/null
                 DST=$(( $DST + 1 ))
         done
 
         uuencode $ISO15 $ISO15 > $ISO15.fnt
 
         rm $CP437 $ISO15
 
 done
 
 #END.
 --
 
 The resulting font works for me without a problem to.
 It would be great, if these changes were commited, as there are often
 questions about the linearts in german forums.
 
 thanks
 
 Martin
Responsible-Changed-From-To: freebsd-bugs->matteo 
Responsible-Changed-By: matteo 
Responsible-Changed-When: Sun Jan 29 18:28:17 UTC 2006 
Responsible-Changed-Why:  
Take this as I'm interested 

http://www.freebsd.org/cgi/query-pr.cgi?pr=90082 

From: Matteo Riondato <matteo@freebsd.org>
To: bug-followup@FreeBSD.org, olli@secnetix.de
Cc:  
Subject: Re: conf/90082
Date: Wed, 19 Apr 2006 17:11:56 +0200

 Oliver,
 I will be glad to commit your patches but I need to know what the
 patch to termcap does. I see you added some "codes" but removed some
 else. Can you please explain this modification a bit, so I can be sure
 there are no problems?
 Thanks!
 Best Regards
 -- 
 Matteo Riondato
 FreeBSD Committer (http://www.freebsd.org)
 G.U.F.I. Staff Member (http://www.gufi.org)
 FreeSBIE Developer (http://www.freesbie.org)

From: Oliver Fromme <olli@lurza.secnetix.de>
To: matteo@freebsd.org (Matteo Riondato)
Cc: bug-followup@freebsd.org, olli@secnetix.de
Subject: Re: conf/90082
Date: Wed, 19 Apr 2006 18:33:08 +0200 (CEST)

 Matteo Riondato wrote:
  > I will be glad to commit your patches but I need to know what the
  > patch to termcap does. I see you added some "codes" but removed some
  > else. Can you please explain this modification a bit, so I can be sure
  > there are no problems?
 
 First of all, thanks for looking at the PR that I submitted!
 
 The termcap patch only changes the "ac" capability of the
 cons25l1 entry (and its descendants).  The "ac" capability
 specifies the character codes to use when in ACS mode (the
 mode used for the frame and line drawing characters).
 
 Unfortunately, the termcap(5) manpage isn't very verbose
 on the whole issue -- I had to look up many things in the
 source.  Let me try to explain ...
 
 When an application (e.g. a curses-based program) wants to
 output line drawing characters (e.g. for a window frame),
 it enters ACS mode, then prints characters according to the
 "ac" termcap capability, then exits ACS mode, returning to
 the standard text font.  The "ac" capability consists of
 pairs of characters:  The first character of each pair
 means a certain symbol, e.g. "x" means a vertical line.
 The second character is the code to output in ACS mode to
 print that symbol.  For example, the pair "x\211" specifies
 that the character with the decimal ASCII code 137 (that's
 octal 211) should be used for vertical lines.
 
 The following table is a complete list of such ACS symbols.
 
 This is the meaning of the columns:
 
    - curses_name:  name of the symbol in curses/ncurses
                    (also see /usr/include/curses.h).
    - sym:  The ACS symbol name; that's the first character
            of each pair from the "ac" termcap capability.
    - cp437:  code of the symbol in CP437 font.
    - iso15:  code of the symbol in ISO8859-15 font (latin-9).
    - acs15:  code of the symbol in the new fonts that the
              script creates that I submitted with this PR.
              As you can see, if the symbol already exists
              in ISO8859-15, the same code is used.  If it
              doesn't exist, it is copied from the CP437 font
              to an unused position in the range 128-149.
    - description:  well, a description of the symbol.
 
 
 curses_name    sym   cp437   iso15   acs15   description (* = not in cons25)
 -----------    ---   -----   -----   -----   -----------
 ACS_ULCORNER   'l'    218       -     128    upper left corner
 ACS_LLCORNER   'm'    192       -     129    lower left corner
 ACS_URCORNER   'k'    191       -     130    upper right corner
 ACS_LRCORNER   'j'    217       -     131    lower right corner
 ACS_LTEE       't'    195       -     132    tee pointing right
 ACS_RTEE       'u'    180       -     133    tee pointing left
 ACS_BTEE       'v'    193       -     134    tee pointing up
 ACS_TTEE       'w'    194       -     135    tee pointing down
 ACS_HLINE      'q'    196       -     136    horizontal line
 ACS_VLINE      'x'    179       -     137    vertical line
 ACS_PLUS       'n'    197       -     138    large plus or crossover
 ACS_S1         'o'      -       -       -    scan line 1 (*)
 ACS_S9         's'      -       -       -    scan line 9 (*)
 ACS_DIAMOND    '`'      4       -     139    diamond
 ACS_CKBOARD    'a'    176       -     140    checker board (stipple)
 ACS_DEGREE     'f'    248     176     176    degree symbol
 ACS_PLMINUS    'g'    241     177     177    plus/minus
 ACS_BULLET     '~'    249     183     183    bullet
 ACS_LARROW     ','     27       -     141    arrow pointing left (*)
 ACS_RARROW     '+'     26       -     142    arrow pointing right (*)
 ACS_DARROW     '.'     25       -     143    arrow pointing down
 ACS_UARROW     '-'     24       -     144    arrow pointing up
 ACS_BOARD      'h'    177       -     145    board of squares
 ACS_LANTERN    'i'     21     167     167    lantern symbol
 ACS_BLOCK      '0'    219       -     146    solid square block
 ACS_S3         'p'      -       -       -    scan line 3 (*)
 ACS_S7         'r'      -       -       -    scan line 7 (*)
 ACS_LEQUAL     'y'    243       -     147    less/equal
 ACS_GEQUAL     'z'    242       -     148    greater/equal
 ACS_PI         '{'    227       -     149    Pi (*)
 ACS_NEQUAL     '|'      -       -       -    not equal (*)
 ACS_STERLING   '}'    156     163     163    UK pound sign (*)
 
 
 Now look again at my termcap patch:
 
 --- termcap.orig	Wed Apr 19 17:43:55 2006
 +++ termcap	Wed Apr 19 17:44:22 2006
 @@ -2520,7 +2520,7 @@
  	:li#60:tc=cons25l2-m:
  # ISO 8859-1 FreeBSD console with ACS support
  cons25l1|cons25-iso8859-1:\
 -	:ac=f\260g\261}\243+\253,\273i\247:\
 +       :ac=l\200m\201k\202j\203t\204u\205v\206w\207q\210x\211n\212`\213a\214f\260g\261~\267,\215+\216.\217-\220h\221i\2470\222y\223z\224{\225}\243:\
  	:tc=cons25w:
  cons25l1-m|cons25-iso8859-1-mono:\
  	:pa@:Co@:AF@:AB@:AX@:op@:us=\E[4m:ue=\E[24m:tc=cons25l1:
 
 As you can see, the original cons25l1 entry specifies only
 six special characters which are present in ISO8859-1 and
 ISO8859-15.  My patch preserves four of them (degree symbol,
 plus/minus symbol, pound symbol, and lantern symbol).  It
 corrects the other two (arrow left, arrow right) which were
 set to the '>>' and '<<' characters in the ISO fonts, but
 the CP437 font contains real arrows, so my patch fixes that.
 
 And of course, my patch adds a lot of additional symbols for
 line drawing which are taken from the CP437 font.  Almost
 all of the ACS symbols are now implemented.
 
 Only five symbols are not implemented (various scan line
 characters, and the not-equal symbol).  But they're not
 present in any of the standard fonts, and I guess they're
 not used by common applications.
 
 If you have any questions, feel free to ask.
 
 Best regards
    Oliver
 
 -- 
 Oliver Fromme,  secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing
 Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd
 Any opinions expressed in this message may be personal to the author
 and may not necessarily reflect the opinions of secnetix in any way.

From: Matteo Riondato <matteo@freebsd.org>
To: Oliver Fromme <olli@lurza.secnetix.de>
Cc: bug-followup@freebsd.org, olli@secnetix.de
Subject: Re: conf/90082
Date: Wed, 19 Apr 2006 19:19:01 +0200

 On Wed, Apr 19, 2006 at 06:33:08PM +0200, Oliver Fromme wrote:
 > 
 > Matteo Riondato wrote:
 >  > I will be glad to commit your patches but I need to know what the
 >  > patch to termcap does. I see you added some "codes" but removed some
 >  > else. Can you please explain this modification a bit, so I can be sure
 >  > there are no problems?
 > 
 > First of all, thanks for looking at the PR that I submitted!
 > 
 > If you have any questions, feel free to ask.
 
 Now, that was an answer! Thanks for having been so clear. I understood
 the changes and will commit the patches as soon as possible.
 I'm sorry that it's a bit too late to see them in 6.1-RELEASE, but
 I'll MFC then after the RELEASE. thanks!
 Best Regards
 -- 
 Matteo Riondato
 FreeBSD Committer (http://www.freebsd.org)
 G.U.F.I. Staff Member (http://www.gufi.org)
 FreeSBIE Developer (http://www.freesbie.org)
State-Changed-From-To: open->suspended 
State-Changed-By: matteo 
State-Changed-When: Sun Apr 30 09:17:15 UTC 2006 
State-Changed-Why:  
ISO-8859-15 does not specify ACS graphics support, so I cannot apply the patch to iso15-*.fnt . 
ache@ suggested to create a new font, like iso15+acs-*.fnt . I want to discuss this with him a bit, so mark this PR as suspended for the moment. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=90082 

From: Oliver Fromme <olli@lurza.secnetix.de>
To: bug-followup@FreeBSD.org, matteo@FreeBSD.org, ache@FreeBSD.org
Cc:  
Subject: Re: bin/90082: [syscons] [patch] curses ACS line graphics support for iso15 font
Date: Thu, 12 Feb 2009 09:46:00 +0100 (CET)

 Hello Andrey, Hello Matteo,
 
 I would like to revive PR bin/90082 which is currently
 suspended for about 3 years.  The PR is about providing
 proper ACS line drawing support for curses applications
 on syscons with ISO-8859-15 fonts which are commonly used
 in large parts of western and middle Europe.
 
 At that time, the commit was backed out again because of
 standards issues.  I understand and clearly accept that.
 
 Still, it would be very good to have proper curses support
 for ISO fonts on syscons.  This does work on Linux out of
 the box, so FreeBSD looks pretty bad in comparison and is
 often subject to laughter and evil remarks by Linux folks.
 
 So, this is my question:  Would it be acceptable to modify
 the patch, so it uses a different name for the fonts and
 for the termcap entries?  I'm suggesting iso15+acs-*x*.fnt
 for the fonts and cons*l1+acs for the termcap entries.
 
 Would that be acceptable?  If not:  Do you have any other
 suggestions to solve the problem?
 
 Thank you very much for your help!
 
 Best regards
    Oliver
 
 -- 
 Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M.
 Handelsregister: Registergericht Muenchen, HRA 74606,  Geschftsfuehrung:
 secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mn-
 chen, HRB 125758,  Geschftsfhrer: Maik Bachmann, Olaf Erb, Ralf Gebhart
 
 FreeBSD-Dienstleistungen, -Produkte und mehr:  http://www.secnetix.de/bsd
 
 C++: "an octopus made by nailing extra legs onto a dog"
         -- Steve Taylor, 1998
Responsible-Changed-From-To: matteo->freebsd-bugs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sat Jun 19 04:42:18 UTC 2010 
Responsible-Changed-Why:  
Reset PR assigned to inactive committer. 

Hat:	gnats-admin 

http://www.freebsd.org/cgi/query-pr.cgi?pr=90082 
>Unformatted:
