Hi,

Gautam Iyer a écrit :
 > Hmm. I don't think you should do this. From what I read, it looks like
> people use "font" to display regular text, and "multifont" for CJK
> (because it looks better for some reason).
> 
> There are proportional fonts in mrxvt, but are used to draw tab titles,
> etc. If you feed a proportional font to mrxvt, then it computes the
> width of the widest char, and draws *all* characters that wide.
> 

Yeah I am currently having a lot of issue with all this proportional
stuff. The problem is that I read everywhere that proportional fonts are
far better for readability. If fixed-width were better, this would be
really easy: we would simply advice to use only fixed-width fonts. But
as they are not, I consider how we can support them well in mrxvt.

Of course if mrxvt was only about a shell, we would not really care
about this. But many people (me for instance, you too probably) use it
for many advanced use, through vim for writing/reading/coding, for
instance, and also with some "console GUI" (ncurses, etc.). So if
proportional fonts are better for long text, as I often happen to
read/write long text in vim, I would prefer to try with it. And
unfortunately it is not possible for mrxvt to change font depending on
whether I am in bash, vim, or else...

Anyway with the CJK support, we are forced to support proportional
fonts, because they are mostly all proportional (for the most simple
reason that they support ASCII too).

And using two fonts instead of one is not the solution. We were doing
this before because mrxvt's code was differenciating multibytes from
monobyte character and considering a monobyte character is also a
mono-column character while a multibyte character is drawn on 2 columns.
But this was wrong. For instance if you take the euro symbol: €. In
Unicode, it is a multibyte character: 0x20 0xAC. But it should display
only on one single column. And I am sure there are many multi-byte asian
symbols or from elsewhere which are written on a single column. This is
why the old mrxvt implementation was working well only with subsets of
CJK symbols, simply because we were working on a wrong assumption. And
this "multifont" is simply a result of this wrong assumption.
My current implementation does not make any difference between multibyte
(2, 3 or 4) or monobyte character and checks the size of every symbols
with the X or Freetype functions, without assuming first.

Where I have issues here is about the "column to and from width"
problematic. With fixed-width font, one column = 1 character. With
proportional, it is more difficult. Should we still consider 1 column =
1 character (so columns are variant size?)? Or I consider 1 column = the
size of a "normal" (which is ASCII in computers) character and any other
character wider that this "normal" size is two (or more? Does characters
wider that 2 normal characters exist? Maybe...) columns, etc.
Here they say that the maximum normal width is the with of '@':
http://developer.uiq.com/devlib/uiq_30/SDKDocumentation/sdl/guide/Graphics-subsystem-guide/N100AA/FontsGuide/CharacterMaximumWidth.guide.html#FontsGuide%2emax%2dnorm%2dchar%2dwidth
I was thinking maybe to take this as a basis and considering any bigger
character being 2 columns wide.


In fact I have some ideas on the question and trying them. Anyway I
won't provide something buggy and if my tests are wrong, I will go back
of course...

> 
> This suggestion is very nice, and will work a lot better than the mfont
> option. I suggest however you *DON'T* only do step 1. Only release when
> you have 1 and 2 together. Doing 1 only for a SVN release is OK, but
> probably not for a beta release!
> 
> GI

Ok. But that will be slightly longer as I need to consolidate basis of
my code first, as you know. :-)

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