Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 129314 - [Preferences] Font sizes cannot be set as float (8,6pt)
Summary: [Preferences] Font sizes cannot be set as float (8,6pt)
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.1.2   Edit
Hardware: All All
: P3 normal with 5 votes (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
: 46427 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-02-24 06:15 EST by René Fritz CLA
Modified: 2019-11-30 19:50 EST (History)
10 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description René Fritz CLA 2006-02-24 06:15:09 EST
Defining the font size (eg. for the editor) in Preferences>General>Appearance>Colors_and_Fonts allows to choose non-integer values like 8,6 or 9,5. The example text in the dialog display the right size then. When applying the change with "OK" or "Apply" the font size will be rounded to an integer and the size is set to 8.0 or 9.0.

I don't think it's necessary and for screen display annoying to restrict font sizes to integers. Please allow float pt sizes.

BTW: it seems that "Use System Font" apply a float size when set in system. But I'm not really sure.

Thanks
René
Comment 1 Billy Biggs CLA 2006-02-24 13:05:18 EST
I'm curious, what DPI is Xft using on your machine?
Comment 2 René Fritz CLA 2006-02-24 13:28:32 EST
> I'm curious, what DPI is Xft using on your machine?

I don't see why that matters

No matter if 75, 85, 96 or 100 dpi, in my opinion the font size can not be adjusted fine enough with 8pt, 9pt, 10pt, ...

Anyway if you're interested, it's 93x95 dots per inch
Comment 3 Billy Biggs CLA 2006-02-28 03:37:19 EST
This bug should be moved to SWT, we don't currently expose non-integer
font sizes.

93x95 may be the resolution according to X, but not necessarily what
Xft uses (See 'xrdb -query Xft', it only uses the Y if Xft.dpi isn't set, so
95 for you).

I asked about the DPI because the DPI + point size == pixel size.  I was
curious to know if your DPI was set really high so that then you'd need
the resolution to hit a particular pixel size.  Since you're at a font DPI
of 95 I'm a bit surprised, unless you're specifically using fonts without
hints.

FWIW, I think you'd be happier at 96 DPI for fonts, but I admit that this
can sometimes be a debate:  http://scanline.ca/dpi/
Comment 4 René Fritz CLA 2006-02-28 05:19:19 EST
Hi

Thanks for your effort to go more deeply into this topic ...

My Xft dpi is (however) 96 dpi which is very common I would say. The fonts I use change from time to time but are very common too: BT Vera/DejaVu, Arial, Andale Mono, Nimbus, ...

No matter which font, the rendering of small font sizes (I prefer) jumps a bit too much from one pt to the next one (this is not new). Eg 9pt to 8pt is such a huge difference on screen that it would be a big advantage to be able to adjust the font size more precisely.
Comment 5 Steve Northover CLA 2006-03-01 18:47:03 EST
I'm sure this is a dup.  We know we need to do fractional point sizes.
Comment 6 Silenio Quarti CLA 2006-03-07 12:28:41 EST
*** Bug 46427 has been marked as a duplicate of this bug. ***
Comment 7 Chris Lee CLA 2006-03-17 13:04:49 EST
I'm assuming this is "the bug" for fractional font sizes - this is a general issue that we are also having (cannot render text at font size 10.5 for example).

Are there plans to implement this in the near future?
Comment 8 khiraly CLA 2006-05-01 09:23:28 EDT
>> I'm curious, what DPI is Xft using on your machine?

>I don't see why that matters

>No matter if 75, 85, 96 or 100 dpi, in my opinion the font size can not be
>adjusted fine enough with 8pt, 9pt, 10pt, ...

Its simple. You specify the font in point size. But on the screen it appear as at pixel size. Why is it important? Because many font are bitmap fonts! The bitmap font look good at specific PIXEL size. 
For example there is the terminus font, its a .ttf font with bitmap embedded (8pixel, 10px, 12px, 14px, etc). If you view this font at 12px size, it looks good (the bitmap face), if you look at 12.5px size, it looks bad.

For example you want 10pixel size font, if you are at 96dpi X resolution you mus specify 10.5pt as size, at 100dpi is 10.1pt, at 120dpi is 8.4pt.

Here is an mini-help table, if you dont want to calcule by hand. (remark: windows defaults is 96dpi, and many X server too. The default x.org configuration use 96dpi too. (it can changed in the xorg.conf file)

# pixel, point, dpi

px  72dpi  75dpi 96dpi(!)  100dpi 120dpi
 8    8pt  7.7pt  6  pt     5.8pt  4.8pt
10   10pt  9.6pt  7.5pt     7.2pt  6  pt
12   12pt 11.5pt  9  pt     8.6pt  7.2pt
14   14pt 13.4pt 10.5pt*   10.1pt  8.4pt
16   16pt 15.4pt 12  pt    11.5pt  9.6pt
18   18pt 17.3pt 13.5pt    13  pt 10.8pt
20   20pt 19.2pt 15  pt    14.4pt 12  pt
24   24pt 23  pt 18  pt    17.3pt 14.4pt
28   28pt 26.9pt 21  pt    20.2pt 16.8pt

Just to clarify things.

Khiraly
Comment 9 Roman Dawydkin CLA 2008-11-06 04:40:11 EST
Fraction-sized font can be somehow emulated while painting on GC with scale Transformation set on it.
Comment 10 Roman Dawydkin CLA 2009-04-24 05:33:59 EDT
At least under Windows you can set 'height' field of 'FontData' class to any float value. It's not public API, but works. Some fonts with fractional sizes looks much nicer.
Comment 11 Hosam Aly CLA 2010-08-03 07:36:11 EDT
I too wish to be able to specify the font size at 10.5 for my editor. 10 is too small on my screen, and 11 is too big. I vote for this enhancement.

BTW, I'd like to thank you *very* much for your work and efforts to make such a great platform. I hope to participate soon.
Comment 12 Mark Jeronimus CLA 2015-08-22 07:56:32 EDT
Same here. Using a 2880x1620 15.5" laptop (215DPI) with Windows set to 200%.

8pt is too small (displays as 16pt)
9pt is too big (displays as 18pt)

To display 17pt at 200%, I need to be able to enter 8.5
Comment 13 Niraj Modi CLA 2015-08-25 04:59:36 EDT
(In reply to Mark Jeronimus from comment #12)
> Same here. Using a 2880x1620 15.5" laptop (215DPI) with Windows set to 200%.
> 
> 8pt is too small (displays as 16pt)
> 9pt is too big (displays as 18pt)
> 
> To display 17pt at 200%, I need to be able to enter 8.5

Windows OS API doesn't support decimal font size:
https://msdn.microsoft.com/en-us/library/windows/desktop/dd145037%28v=vs.85%29.aspx
Comment 14 Roman Dawydkin CLA 2015-08-25 05:49:17 EDT
(In reply to Niraj Modi from comment #13)
> Windows OS API doesn't support decimal font size:
> https://msdn.microsoft.com/en-us/library/windows/desktop/dd145037%28v=vs.85%29.aspx

Ok, "lfHeight" field is integer, but seems it specifies height in pixels, not typographic points, and I'm sure what when I set "height" field of FontData, for example, to 10.0 and to 10.5, I get different looking fonts on screen.
Comment 15 Eclipse Genie CLA 2019-11-30 19:50:26 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.