Loading ...
Sorry, an error occurred while loading the content.

Re: cjk char width is a little wider

Expand Messages
  • Tony Mechelynck
    ... My comment was about all fonts. The Vim character cell has a constant size all over the screen, for all windows comprising one instance of Vim. One narrow
    Message 1 of 10 , Oct 16, 2007
      Kornelis wrote:
      > On Oct 16, 9:26 am, Tony Mechelynck <antoine.mechely...@...>
      > wrote:
      >>>> On Oct 15, 8:41 pm, Kenneth Beesley
      >>>> <krbees...@...> wrote: When you set both
      >>>> guifont and guifontwide, when does vim use one, and
      >>>> when the other? [snip]
      >>> It uses the guifont for the characters that are not
      >>> wide and the guifontwide for those that are. Actually
      >>> quite convinient, since you can select your best
      >>> latin font and best Asian font at the same time. But
      >>> you can also choose the same font for both (but not
      >>> always - depends on the font).
      >>> If you set only guifont on Linux Pango/Xft will
      >>> choose a wide font to match, but for reasons unknown
      >>> to me some combinations mess up the character spacing
      >>> of the Asian font in gvim upto now. Therefore
      >>> explicitly setting guifontwide as well works better
      >>> for me.
      >>> Best results are to be expected with a monospaced
      >>> font for the latin font.
      >> The wide glyphs should be exactly twice the width of,
      >> and the same height as, the narrow glyphs, regardless
      >> of whether or not you use the 'guifontwide' option.
      > I thought the orignal poster was talking about TTF, but I
      > don't know how to determine the width of a TTF (I
      > remember I tried to find that out through fontconfig, but
      > according to my notes all I got was a width of 100 for
      > *all* my TTF fonts).
      > As for the height (still talking TTF) do you mean size? I
      > play with setting that to make a better match, but I never
      > noticed a problem.
      > But perhaps your comment was strictly with regard to
      > bitmap, unscalable fonts?

      My comment was about all fonts. The Vim character cell has a constant size all
      over the screen, for all windows comprising one instance of Vim. One narrow
      character occupies one cell, one wide character occupies two cells. The cell
      size changes when you set the 'guifont'. The GTK2 GUI (alone among all
      versions of gvim) will accept a font whose glyphs aren't all the same size,
      but it will clip wider glyphs at the cell borders and it will fill narrower
      glyphs with empty space, making the result ugly. Other gvim versions require
      monospace fonts (which may be TrueType or OpenType); I have met fonts which
      pretended to be monospace but weren't: for instance, the bold Cyrillic glyphs
      of the Lucida Console font are one or two pixels wider than the character
      cell. The result, again, was ugly.

      > I know how to get info on the height and width of bitmap
      > fonts, and in fact I use bitmap fonts in gvim as a rule.
      > But in my experience thus far lots of users want to use
      > TTF. Perhaps I don't know how to get info on those
      > correctly, or perhaps things are different in different
      > distro's and/or wm's? (Slackware 10.2 / Openbox here)
      >> Not setting 'guifontwide' (and selecting some
      >> East-Asian 'guifont' when editing a file containing CJK
      >> text) works best for me on gvim with GTK2 GUI. That
      >> way, proper size relations between wide and narrow
      >> glyphs are ensured by the construction of the font
      >> itself.
      > When I set only guifont with a TTF, the results are
      > unpredictable in my version of gvim (version 7.0 on
      > Slackware 10.2). Some fonts are spaced correctly (e.g.
      > Kochi Mincho or HGSeikaishotaiPRO) others are not. For
      > example the popular free TTF Bitstream Cyberbit spaces
      > too wide when I set only guifont. Some epson fonts I've
      > got display wrong as guifont as well. But when I set them
      > as guifontwide in combination with a latin monospace TTF
      > for guifont things are just fine.
      > I've seen this for many years, and I thought the original poster
      > was having the same problem. But perhaps my system is
      > broken and is my approach a crude end-user hack.

      I use Bitstream Vera Sans Mono for normal editing, Courier New for Arabic and
      FZKaiTi for CJK, and it doesn't give me problems. (On Windows my favourite CJK
      font used to be MingLiU and my favourite Latin font, Lucida Console.)

      Best regards,
      The Split-Atom Blues

      Gimme Twinkies, gimme wine,
      Gimme jeans by Calvin Kline ...
      But if you split those atoms fine,
      Mama keep 'em off those genes of mine!

      Gimme zits, take my dough,
      Gimme arsenic in my jelly roll ...
      Call the devil and sell my soul,
      But Mama keep dem atoms whole!
      -- Milo Bloom, "Bloom County"

      You received this message from the "vim_multibyte" maillist.
      For more information, visit http://www.vim.org/maillist.php
    Your message has been successfully submitted and would be delivered to recipients shortly.