Bram Moolenaar wrote:
> Tony Mechelynck wrote:
> 
>> Talking of todo lists, is the following item on it?
>>
>> - In the GUI, when using a multi-byte 'encoding' use glyphs for any 
>> codepoints 
>> present in the 'guifont', even for Unicode codepoints above U+FFFF.
>>
>> Rationale: Many CJK codepoints are in plane 2 (U+20000 to U+2FFFF). 
>> Representing all of them indiscriminately by double-wide question marks 
>> makes 
>> editing East-Asian text files difficult.
>>
>> Hm... There seems to be something similar at todo.txt (2007-Jul-22) line 720:
>>
>> 8   When 'encoding' is "utf-8", should use 'guifont' for both normal and wide
>>      characters to make Asian languages work.  Win32 fonts contain both
>>      type of characters.
>>
>> This is already implemented (at least in the GTK2 GUI) for wide and narrow 
>> characters in the BMP (Basic Multilingual Plane, U+0000 to U+FFFF). It 
>> remains 
>> to be implemented for characters outside the BMP. Many TTF fonts installed 
>> on 
>> my Linux system (and which I got from Novell/SuSE but also from various 
>> other 
>> royalty-free sources) include glyphs both inside and outside the BMP, as can 
>> be seen by displaying the page in Firefox with an appropriate CSS sheet. The 
>> latest fonts which I installed are particularly complete if not extremely 
>> pretty: "HAN NOM A" and "HAN NOM B", both from 
>> http://sourceforge.net/project/showfiles.php?group_id=153105&package_id=172061
>>  
>> -- I got the tip from http://en.wikipedia.org/wiki/GB18030#Glyphs
> 
> It is very unlikely I will work on this myself.  Thus we will have to
> wait for someone to work on this.
> 

OK. Anyone wants to take up the challenge? I have done some preliminary 
detective work. The problem is in function gui_mch_draw_string() which is 
different for each GUI flavour, as follows, checking for a test on (c >= 
0x10000). Line numbers below are for the latest (7.1.043) sources.

gui_gtk_x11.c:6064      if >= U+10000, replace by question mark
gui_mac.c               no special handling
gui_photon.c            no special handling
gui_riscos.c            no special handling
gui_w16.c               no special handling
gui_w32.c:2343          if >= U+10000, convert to UTF-16 surrogate pair
gui_x11.c:2565          if >= U+10000, replace by question mark (1)
gui_x11.c:2572          if >= U+10000, replace by question mark (2)

(1) with FEAT_XFONTSET, if current_fontset != NULL
(2) otherwise

It seems that the Win32 GUI converts UTF-8 to UTF-16 with surrogates (thus, I 
suppose, displaying characters correctly even outside the BMP) and that X11 
GUIs (GTK, and non-GTK-non-Photon) explicitly replace anything outside the BMP 
by a wide question mark (which I call the "faulty" handling). For Mac, Photon, 
RiscOS and W16, either the OS handles it transparently or the problem cannot 
occur (+multi_byte not possible?), I don't know.

I don't feel up to modifying this platform-dependent code, but I hope that 
with the above, someone will be willing. Any takers?


Best regards,
Tony.
-- 
The temperature of Heaven can be rather accurately computed.  Our
authority is Isaiah 30:26, "Moreover, the light of the Moon shall be as
the light of the Sun and the light of the Sun shall be sevenfold, as
the light of seven days."  Thus Heaven receives from the Moon as much
radiation as we do from the Sun, and in addition 7*7 (49) times as much
as the Earth does from the Sun, or 50 times in all.  The light we
receive from the Moon is one 1/10,000 of the light we receive from the
Sun, so we can ignore that ... The radiation falling on Heaven will
heat it to the point where the heat lost by radiation is just equal to
the heat received by radiation, i.e., Heaven loses 50 times as much
heat as the Earth by radiation.  Using the Stefan-Boltzmann law for
radiation, (H/E)^4 = 50, where E is the absolute temperature of the
earth (300K), gives H as 798K (525C).  The exact temperature of Hell
cannot be computed ... [However] Revelations 21:8 says "But the
fearful, and unbelieving ... shall have their part in the lake which
burneth with fire and brimstone."  A lake of molten brimstone means
that its temperature must be at or below the boiling point, 444.6C.  We
have, then, that Heaven, at 525C is hotter than Hell at 445C.
                -- From "Applied Optics" vol. 11, A14, 1972

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui