Bug 44896 - Message body font: pixel versus point size
Summary: Message body font: pixel versus point size
Status: CLOSED FIXED
Alias: None
Product: kmail
Classification: Applications
Component: general (show other bugs)
Version: 1.4.5
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-07-08 20:18 UTC by Andre Woebbeking
Modified: 2007-09-14 12:17 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andre Woebbeking 2002-07-08 20:17:54 UTC
(*** This bug was imported into bugs.kde.org ***)

Package:           kmail
Version:           1.4.5 (KDE 3.0.6 (using KDE 3.0.6 )
Severity:          normal
Installed from:    compiled sources
Compiler:          gcc version 2.95.3 20010315 (SuSE)
OS:                Linux (i686) release 2.4.18-4GB
OS/Compiler notes: 

Hi

in the settings dialog point size is used and in the message view you use pixel size (px). So you don't get the font size you select :-(

You should remove  KMReaderWin::pointsToPixel() and use only point sizes.

Another issue is that the minimum font size is limited to 10 pt (maybe by khtml?)


Regards
André

(Submitted via bugs.kde.org)
(Called from KBugReport dialog)
Comment 1 Ingo Klöcker 2002-07-08 22:47:49 UTC
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Monday 08 July 2002 22:17 Woebbeking@web.de wrote:
> in the settings dialog point size is used and in the message view you
> use pixel size (px). So you don't get the font size you select :-(

The settings dialog doesn't use khtml. Therefore we can use point size 
there but have to use pixel size in khtml (because khtml and Qt 
calculate(d) the point size differently).

> You should remove  KMReaderWin::pointsToPixel() and use only point
> sizes.

Ha what an ingenious idea. Do you think we didn't have a reason for 
this? If you only use point sizes most people won't get a font size 
even close to the one they expect because still 95% of the xservers 
aren't set to the correct resolution (they use the default 75 dpi).

If you want to know more please check the archive of this mailing list.

> Another issue is that the minimum font size is limited to 10 pt
> (maybe by khtml?)

As we use khtml this is very likely.

Regards
Ingo

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9KhaVGnR+RTDgudgRAoj4AJ48PYzZoLNBWzTohmHnIIo4DE0vuwCfQ37i
y1h89yFGUBGGvRdRCK5ix14=
=3me1
-----END PGP SIGNATURE-----
Comment 2 Andre Woebbeking 2002-07-09 22:56:43 UTC
Hi Ingo

> > in the settings dialog point size is used and in the message view you
> > use pixel size (px). So you don't get the font size you select :-(
>
> The settings dialog doesn't use khtml. Therefore we can use point size
> there but have to use pixel size in khtml (because khtml and Qt
> calculate(d) the point size differently).

I mean you configure a size (as it is not specified if point or pixel size is 
wanted I assumed point size as in other programs) get a preview of your 
settings but the result in the message view is different. IMHO is this a bug.

> > You should remove  KMReaderWin::pointsToPixel() and use only point
> > sizes.
>
> Ha what an ingenious idea. Do you think we didn't have a reason for
> this? If you only use point sizes most people won't get a font size
> even close to the one they expect because still 95% of the xservers
> aren't set to the correct resolution (they use the default 75 dpi).
>
> If you want to know more please check the archive of this mailing list.

I remember the discussion on core-devel. I think the conclusion was to use 
point size?!? I only know XFree 4.x. If the server can't determine the 
correct DPI the user can use DisplaySize in XF86Config. Maybe there should 
be a hint in the documentation.

> > Another issue is that the minimum font size is limited to 10 pt
> > (maybe by khtml?)
>
> As we use khtml this is very likely.

My minmum size in konqueror is 8 not 10.

In KNode the font handling works fine for me. The same font is used in the 
settings and in the message view and there is no minimum size.


Regards
André


P.S.: Please send eMails CC to me as your eMail took one day to be delivered.
Comment 3 Ingo Klöcker 2002-07-10 22:15:09 UTC
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wednesday 10 July 2002 00:56 André Wöbbeking wrote:
> > > in the settings dialog point size is used and in the message view
> > > you use pixel size (px). So you don't get the font size you
> > > select :-(
> >
> > The settings dialog doesn't use khtml. Therefore we can use point
> > size there but have to use pixel size in khtml (because khtml and
> > Qt calculate(d) the point size differently).
>
> I mean you configure a size (as it is not specified if point or pixel
> size is wanted I assumed point size as in other programs) get a
> preview of your settings but the result in the message view is
> different. IMHO is this a bug.

No matter what we do the preview and the result will almost always be 
slightly different because the size of the preview text is calculated 
by Qt while the size of the message text is calculated by khtml. 
Unfortunately they don't seem to agree on the same formula. We tried it 
with point size instead of pixel size before and the difference was 
much worse.

> > > You should remove  KMReaderWin::pointsToPixel() and use only
> > > point sizes.
> >
> > Ha what an ingenious idea. Do you think we didn't have a reason
> > for this? If you only use point sizes most people won't get a font
> > size even close to the one they expect because still 95% of the
> > xservers aren't set to the correct resolution (they use the default
> > 75 dpi).
> >
> > If you want to know more please check the archive of this mailing
> > list.
>
> I remember the discussion on core-devel. I think the conclusion was
> to use point size?!? I only know XFree 4.x. If the server can't
> determine the correct DPI the user can use DisplaySize in
> XF86Config.

Which user are you talking about? Do you really want to force the user 
to edit her XF86Config? Our current solution isn't optimal but it's as 
good as it gets until all distributions set the correct DisplaySize.

If you can come up with a better solution (which also works for users 
which are stuck with the default display resolution of 75 dpi on a 90+ 
dpi display) please send us a patch.

> Maybe there should be a hint in the documentation.
>
> > > Another issue is that the minimum font size is limited to 10 pt
> > > (maybe by khtml?)
> >
> > As we use khtml this is very likely.
>
> My minmum size in konqueror is 8 not 10.
>
> In KNode the font handling works fine for me. The same font is used
> in the settings and in the message view and there is no minimum size.

As KNode doesn't use khtml but KTextBrowser this isn't surprising.

> P.S.: Please send eMails CC to me as your eMail took one day to be
> delivered.

As you wish.

Regards
Ingo

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9LLH1GnR+RTDgudgRAgVLAKCXLL++MaTtkBVHdq50d0J9EXAyRwCgh0hE
UmWS+Rs+bGu7bNhsAJ6XL3U=
=6dkA
-----END PGP SIGNATURE-----
Comment 4 Andre Woebbeking 2002-07-11 18:33:31 UTC
--Boundary-00=_79cL98kgMHxj2sP
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
Content-Disposition: inline

Hi Ingo

> > I remember the discussion on core-devel. I think the conclusion was
> > to use point size?!? I only know XFree 4.x. If the server can't
> > determine the correct DPI the user can use DisplaySize in
> > XF86Config.
>
> Which user are you talking about? Do you really want to force the user
> to edit her XF86Config? Our current solution isn't optimal but it's as
> good as it gets until all distributions set the correct DisplaySize.
>
> If you can come up with a better solution (which also works for users
> which are stuck with the default display resolution of 75 dpi on a 90+
> dpi display) please send us a patch.

As you wish. It works fine for me. It seems that khtml ignores the digits 
behind the floating point if you use "px". So I changed pointsToPixel() to 
return a rounded int.

BTW if X don't provide the right DPI how can 
QPaintDeviceMetrics::logicalDpiY() do this? It uses the same data from the X 
server so it shouldn't matter to use point sizes should it?

> > In KNode the font handling works fine for me. The same font is used
> > in the settings and in the message view and there is no minimum size.
>
> As KNode doesn't use khtml but KTextBrowser this isn't surprising.

Didn't know this. I only noticed that it works as expected.

> > P.S.: Please send eMails CC to me as your eMail took one day to be
> > delivered.
>
> As you wish.

Thanks.


Regards
André
--Boundary-00=_79cL98kgMHxj2sP
Content-Type: application/x-gzip;
  name="kmail.diff.gz"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="kmail.diff.gz"

H4sICOrKLT0CA2ttYWlsLmRpZmYAxVXrT9swEP9M/opTJ0RKmuZRnqnY0B4I
tiHx0qZJfEmTS2s1sSvHbWGI/31nJ4QWlTGxSXNV2b7c716+xwlP8SaCcRGz
3BsXEuMU5ZzxbjKZWAd/v6yLD5eQsRwj8EaiQG+cmj9HNRdy7K1U3JlZEpVk
OGN8CJK2kgkOQXc72LdSlmXgTsGV5g5PjXZdd7U7azvweZpD6Psh+PuRvxsF
Abg+rbVKsuM4zyCJsYEGe5G/HW3tVFDr8BDc0O/tdXbBqffDQwsA7gHzEuFO
nwEYzwQcmK0by6EN55fkIB9GEZ/mObT7BmK5AMU3hnOU7tu5ZArtRHCFXBnQ
RDCuyitxxm4wtzOuLtlPbHfA78BGttGB7bZh00raJNF5hbBlCbAgAXlqa9K9
BZXTQbDTocA41aFn3NYfwfPcf7ksNxXTQY7w5fTCvMp3xqNo2Xw6g6EYJyxH
3/+YHSgspbLoqSj852cx0T9SziV4qpMwKWGSFnYThxnttg4OMdeGTbRQLYpe
uBFrGCiNp5IvMGxqYd1cDFkS5x8n7IfdBg92Q/Naq3Qb256xwNEg7UvNtGCG
3dixUqUDvZ1GsZby1ND6oWEmWLocyXIk5scsxVNW4JVEtGEgRA6afKKgXeVG
SCmhCyIMHguiWlX2F+9FensUFyy/hSrloM5AklBzRg81YrcGxA13kFH6uplB
RXDdWg+uW/2KWBIygvVwctOH1qOyViJyIelDrw+DOBkPpZjy1H2gbvXh/pq3
2vqlXrDuxdIju51XSnl0uYGekd9KN7930Hrjm9WigCRBl8cF2i9CjswykK0G
Qj+ngtl2w94m/ibOMQW5Dk6ttQ8Kb5SbYiJkrKgLR8AFRwoche3kueEx+j+j
Y/Ts4AjCraXBQXdYNnj12Bit9RY6/35EzT8Mm6Ghpa4eGqNVI2N3YWT0wp4u
kGqr6mPGpJrGeVVOOKM+bZ9/0htsom68msfb3IQPcZ5M81ghqFHde6A0he4t
9qTfNLz+Q994uSsu6D1CTEuj8/jq9CvMTDeCOVMjQ6xnSwkiM/chI9uhwLKM
h9it8s4ABzhk3KNxApNYEn8sEfR4IjSddYEa/ANSu/ULwKTXAKYIAAA=

--Boundary-00=_79cL98kgMHxj2sP--
Comment 5 Ingo Klöcker 2002-07-16 20:46:27 UTC
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thursday 11 July 2002 20:33 André Wöbbeking wrote:
> > If you can come up with a better solution (which also works for
> > users which are stuck with the default display resolution of 75 dpi
> > on a 90+ dpi display) please send us a patch.
>
> As you wish. It works fine for me. It seems that khtml ignores the
> digits behind the floating point if you use "px". So I changed
> pointsToPixel() to return a rounded int.

Thanks for the patch. When this was changed I also wondered why the 
function didn't return int. But I was told that the px size could be a 
double value.

As a non-int px size doesn't make sense I'll apply your patch. BTW the 
next time please don't compress such a small patch.

> BTW if X don't provide the right DPI how can
> QPaintDeviceMetrics::logicalDpiY() do this? It uses the same data
> from the X server so it shouldn't matter to use point sizes should
> it?

Don't know. Maybe they make a good guess based on the monitor size and 
the resolution if the X server returns the default value.

I suppose I can close your bug report.

Regards
Ingo

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9NIYjGnR+RTDgudgRAnueAJ4joRJLyTqMfxbRG1TtlM0ylGMiIACeL1oj
k25TWGQlzmxaixJBynDiKBU=
=er+Y
-----END PGP SIGNATURE-----