Hi,

Gautam Iyer a écrit :
> I think all terminal emulators do this -- If you give them a
> proportional font, then they treat it as one column = one character.
> That is, you find the width of the widest character in the font, and
> draw all characters that wide.
> 

About this, I found this Debian doc:
http://www.debian.org/doc/manuals/intro-i18n/ch-output.en.html

Section 7.1.2 especially deals with this column issue. You even have X
functions (man wcwidth) giving the number of column. But this function
is not what I need, for several reasons. One reason is that it does not
take into account the used font, though in my tests, I noticed that
characters have a different "number of column" depending on the font!

For instance I have said that the euro character '€' is displayed on one
single column in my previous email. But since then, I have found some
fonts where it was on 2 columns!

Note that the document also made a statement close to mine, which is we
should absolutely not compare the number of bytes and columns. These are
2 different things which are not related! So it confirms the current
multicolumn implementation is wrong (for many cases, it is not, but not
as a "generality").

Anyway it looks like I should not assume 1 col = 1 char. Moreover I
don't think the idea of taking the width of the widest character is so
good, because it makes text with one-column character very ugly and
difficultly readable (a lot of space between each character is not
good). It is probably better to simply compute each character size in
term of column. I will probably use a pattern as the size of the column.
Like '@' will decide of the size of a column (following advice on the
link from my previous email). This will be a basis pattern. All other
character's number of column will be computed from this statement. This
way it won't be any issue for curse application, I think.
At least I can try and see what it renders.


Note that it seems you too once thought it was not a good idea to
consider the column size as the biggest character (so having a lot of
space for all smaller characters). From main.c:

/*
* 2006-01-26 gi1242: Monospaced fonts seem a good idea.
* 2006-01-27 gi1242: Maybe not such a good idea. When we ask for a
* monospaced font from a propotionally spaced font, we just get the same
* old prop font, with a bigass textwidth. That's no use to us. If it
* returned the closest matching mono-spaced font, then that would be
* useful.
*/


Jehan


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Materm-devel mailing list
Materm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/materm-devel
mrxvt home page: http://materm.sourceforge.net

Reply via email to