[fpc-pascal]Is it possible to display unicode chars ??

Rainer Hantsch rainer at hantsch.co.at
Tue Jun 3 06:05:46 CEST 2003


Hello, Ivan!

YES, you should _always_ use ncurses when writing programs for Linux/Unix. The
background is that ncurses unifies all the different terminals to one common
command set. Ncurses gets i.e. the command for placing the cursor to
somewhere; which commands (escape sequences) are finally used to work with the
particular terminal, is handled by ncurses itself.
In addition, ncurses allows very powerful things like:
  o Windowing
    Yes, you can use as many logical windows on your terminal, as you want.
    ncurses does the rest, you simply write to one or another window... :)
    I wrote my own invoicing program in freepascal, using mysql and ncurses,
    it is really powerful.
  o Menu system
    I never used that, but it exists.

And finally:
There exists a Freepascal unit which is a full replacement for CRT. Its name
is oCRT (Object-CRT) and is an Object Oriented unit. Author is Ken Wright,
you can get the code from the freepascal homepage.
All you have to do is using oCRT instead of CRT in your program code and use
the ocrt specific functions/procedures/methods. In the worst case (when
programming "ugly"), you can also reduce the usage of oCRT to an initial part,
defining the whole screen as one borderless window, and then fiddle around in
it with a few little wrappers. An ExitProc() should do the "shutdoen" of the
ncurses library whenever the program is ending. -- But I would not do it this
way, this is really brutal.


On Tue, 3 Jun 2003, Ivan Petrov wrote:
| Hi!
| I'm in trouble with this...
|
| May I use ncurses unit??
See above...

| Is there some wrapper or a way to use widechars or widestrings.
If you mean double width and/or double height chars: This is currently not
implemented in oCRT because this is wasting screen space. But it should be
possible to add this functions/methods, too.


| Note, I'm not a programmer.
| I know Pascal. Not C.
         ^^^^^^
So you _are_ a programmer? I don't know from where it comes that a real
"programmer" always uses "C". This is absolute nonsense! It depends on you,
which programming language you use, every language has its advantages and
disadvantages! Pascal is a typical "all purpose language" and perfect for
most things, so I also use no "C", yes, I deny to use "C" at all! ;-)



mfg

  Ing. Rainer Hantsch

--
.---------------------------------------------------------------------.
|      \\|//              Ing. Rainer HANTSCH  -  Hardware + Software |
|      (o o)              Forget Windoze! -- We focus on L-I-N-U-X... |
|--oOOo-(_)-oOOo------------------------------------------------------|
| Ing. Rainer HANTSCH |  mail: office at hantsch.co.at                   |
| Khunngasse 21/20    |   www: http://www.hantsch.co.at               |
| A-1030 Vienna       |   tel: +43-1-79885380    fax: +43-1-798853818 |
| ** A u s t r i a ** | handy: +43-664-9194382   UID-Nr: ATU 11134002 |
'---------------------------------------------------------------------'





More information about the fpc-pascal mailing list