Re: guessing font width

On Wed, 13 May 2009, Jon K Hellan wrote:
bill lam wrote:
I use gnumeric on debian and I use dejavu sans mono, but each time
gnumeric started opening excel files will give a warning

** (gnumeric:11164): WARNING **: EXCEL : unknown widths for font
'DejaVu Sans Mono', guessing

the width it guessed seemed smaller than actual and it made column
width that based on this font be narrower than it should be.  Why does
it need to guess when that dejavu  font has been installed in system?
(I can choose the font within gnumeric's font dialog box).

gnumeric version '1.9.4'

thanks in advances.

The way the Excel plugin handles font metrics can certainly be improved. We use a static table,
However, DejaVu is basically Bitstream Vera with more Unicode characters added, right? Could you
see if things look better if you add a line

              { "DejaVu Sans Mono",    9,     0x0900, 32.0 },

after the "Bitstream Vera Sans Mono" line in plugins/excel/ms-excel-util.c, l.280 or so?
If you aren't used to building from source, the easiest way on Debian is:

  apt-get source gnumeric
  apt-get build-dep gnumeric
  apt-get install fakeroot
  cd <gnumeric source directory>
  dpkg-buildpackage -rfakeroot
  cd ..
  dpkg -i gnumeric-x.y.z-blabla.deb

Thank you for help.  I built gnumeric from source until recently that
it failed to compiled under debian lenny.  I'm not sure if the problem
related to gtk (lenny use gtk 2.12.12-1~lenny1) or newer gnumeric
source or gcc. When linking it aborted with

/usr/lib/ undefined reference to `g_content_type_from_mime_type'
/usr/lib/ undefined reference to `g_dgettext'
collect2: ld returned 1 exit status

building from debian is not feasible because it automatically pull
tons of gnome files for installation.

Anyway I'll workaround by using fonts available in the ms-excel-util.c
file.  Thanks again.

GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver --recv-keys 4434BAB3
唐詩225 王維  竹里館
    獨坐幽篁裡  彈琴復長嘯  深林人不知  明月來相照

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]