Our effort reminds of the legend about three blind men and an elephant. It is suggested we put the whole animal in the closet and just consider a small but the same part. I will comment on this one and then post another email with a very simple solution.
--- Eric Iverson <[EMAIL PROTECTED]> wrote: > Oleg (and other font fanatics), > I think the problem of font sizes is nastier than you think. I would > love to have you prove me wrong. See the summary and proposal at the > end. > > Experience with various applications/platforms/screen sizes/DPI/font > faces/font sizes shows there is a lot of 'uncontrollable variation' on > the physical appearance of text at various point sizes. For screens, > point size is just a vague hint of pixel height. To clarify: 1pt (point) is 1/72 of 1in (inch), a typographical convention to express font sizes. Devices such as printers and screens use dots or pixels with varying density, which is expressed as DPI (dots per inch). The goal is that on all platforms and screens, a selection of font (e.g. "Lucida Sans 10pt") in J will have the same size. The meaning of "same size" is that it will maintain proportion with geometry used in gl2 operations. If we draw a rectangle around the text, and make screenshots from all platforms and put them together, the rectangles will be the same size, so should be the height of lowercase glyphs of Latin text. The above is the minimum ground-zero. Example of further requirements: line height should be the same (from top of rectangle to baseline). Still more advanced requirement: be sensitive to host environment DPI, but then, shouldn't DPI also be reflected in geometry to maintain proportion (like grid zoom); the same applies to sizes of UI controls. These are different parts of the elephant, which can be dealt with later. > It is possible to tweak J so that a PARTICULAR comparison looks good. > For example 10pt on the same screen on Windows and Mac. But then looking > at 9pt through 15pt will show there is considerable variation and things > matched only at one place on the spectrum. That's not what I see. In http://www.jsoftware.com/jwiki/System/Beta/Font_Size There is a Win-Mac comparison of Arial at different sizes from 2 to 15 and they all match. If you have a different result, please share a screenshot. > Comparing by eye a single line in different environments is not useful. > What is critical is the height of the physical font in pixels and you > can't tell this from one line. With J you can get the font height. For > more general comparisons it is necessary to compare columns of 20 to 30 > lines to detect differences. This is a different part of the elephant, called line height: the distance between two adjacent baselines of the same font with default parameters. It is a more complicated thing dependent on many factors: informaiton in the font itself, choices of particular environment and adjustments. This particular attribute is related to paragraph formation and is outside of line formation. In can also depend on mixture of scripts on a line, etc. So it could be dealt with later, when we at least get the sizes of glyphs right. > The suggested use of browsers for comparisons is interesting, but less > useful than one might think. Browsers are strongly oriented towards user > choice of default fonts and size given in pixels (not points) and then > using adjustments from that base (smaller or larger). Html can't even > give point size. You have to use css. I know there used to be strong > advice againts screen points and that points should only be used for > printer css and assume this is still the case. What was meant in browser comparison is modern browsers, and the provided example used CSS and the sizes in points and pixels, not relative sizes. While in general, in HTML font can be specified relatively for user adjustment, the solution for treatment of fixed point and pixel sizes on different platforms is a good example of consistency. > The most useful comparisons are made with the same screen at the same > resolution. Screen shots between systems with different resolutions > obscure and distort the problem. But that's the goal: to achieve consistency of fonts and geometry between systems and across different resolutions. Another such successful and most widely used example is Adobe Acrobat PDF: they achieve it by stating that all their units are points=1/72 inch both for fonts and geometry. Then they have zoom to adjust for different resoltiions. J cannot in general zoom geometry or UI controls (like grid), so we need to tie the fonts size to geometry (which would be equivalent for grid at 100%). > Do the following comparison using the size.htm file at the end: > > On my win 1280*1024 screen: notepad, wordpad, word, IE6, Jwdw, and > Mozilla all have the same height for the column of 10pt text. But change > to 12pt and Mozilla is quite different while the others are the still > the same. Jwdp is the same as Jwdw etc at 12pt, but is a bit smaller at > 10pt. You can trace the difference over differnent point sizes. Mozilla > just happens to match at 10pt, but doesn't match at other sizes. > > On my mac 1280*1024 screen: Safari with size.htm in various point sizes > is very different from TextEdit at the same size. J column heights at > the same point size fall roughly between them. > > The same kind of resuls on my Linux system. > > Changing the screen resolution changes these comparisons all over. They > may get closer, they may get further apart, and where they match, if at > all, will be at a > different point size. I agree with all these arguments, but they consider the line height factor, which was suggested to be of a larger scope. On the other hand, if we only consider a single line, across different fonts sizes, we see that between Windows and Windows Java, and between Windows and Mac there is a perfect match as of the latest beta, as shown at http://www.jsoftware.com/jwiki/System/Beta/Font_Size > Your J sizes look good to you on your Mac, but wrong on your Linux. At > what point sizes? On my systems they looks equally good on my Mac and > Linux system. Any tweak I did to make it look better on your Linux would > make it look worse on mine. What are our Linux and Mac screen size and > dpi? On my system they are: > (0 1{".wd'qm'),4 5{".wd'qscreen' NB. Mac (72 jammed to 96) > 1280 1024 96 96 > > (0 1{".wd'qm'),4 5{".wd'qscreen' NB. Linux > 1280 1024 100 100 First of all, if I run this statement on Linux, I get DPI of 74, I cannot imagine where such odd figure would come from. (0 1{".wd'qm'),4 5{".wd'qscreen' NB. Linux 1024 768 74 74 My Desktop Preferences|Fonts|Font Rendering Details are set to 96. If I even set it to 120, then re-run J, it will still show 74. So this method is only confusing. It was said in a separate mail, that Java has a bug, treating all fonts at 72 DPI (that how you arrive at smaller fonts on Windows with native 96 DPI; and that's why on Linux Selection tool matched J display). But I think it's a blessing, that they have fixed their font sizes independent of host resolution, like PDF does. J can use this to its advantage, by employing the browser method of deriving (pixel) font size as 4%3 of the point size. > Summary: I don't see how I can improve the current overall situation and > think adjustments for a particular situation will just squeeze the > problem around. I think we just have to accept that that physical > appearance of point sizes on the screen is arbitrary and varies greatly > across applications/platforms/resolutions/etc. Yes, there is a multitude of factors that can easily make things confusing, such as trying to accommodate the host resulution in the calculation of font size. The current matches on Windows and Mac show that the correct approach was used there. The only place to adjust is the Linux part, as it would be shown in the separate email. > Proposal: Perhaps a minor addition to the J fontspec would solve the > problem where what you want is a pixel size rather than an arbitrary > pixel size from a point size. Depending on feedback I will consider > adding a pixel style to fontspec for 601 so that it gives you a font > with exactly the requested pixel height. This is trivial in Java as its > fonts are actually requested in pixel size and J needs to fiddle point > size to pick a pixel size. It is more complicated in windows (need to > iterate fractional point sizes until you get a font that has the > requested height in pixels). I think it is better to have one simple consistent predictable choice, than two choices, which are still not garanteed to be such. In previous J versions, there was inconsistency between windows system fonts and J Windows fonts, between Windows and Java, etc. Now we have consistency everywhere, except Linux (plus selection tool to be fixed). So we are very close, and I'd rather recommend making that small step to fix Linux and get to the more complicated issues later. > *** size.htm > <style> p {font: 10pt "arial"} </style> > <p> > 0<br> > 1<br> > 2<br> > 3<br> > 4<br> > 5<br> > 6<br> > 7<br> > 8<br> > 9<br> > 10<br> > 11<br> > 12<br> > 13<br> > 14<br> > 15<br> > 16<br> > 17<br> > 18<br> > 19<br> > 20<br> > 21<br> > 22<br> > 23<br> > 24<br> > 25<br> > 26<br> > 27<br> > 28<br> > 29<br> > </p> > *** > ----- Original Message ----- > From: "Oleg Kobchenko" <[EMAIL PROTECTED]> > To: "Beta forum" <[email protected]> > Sent: Friday, September 01, 2006 6:44 PM > Subject: Re: [Jbeta] Font sizes for Linux > > > >I will need to rerun the new beta w, but here is > > quick comments on the methodlogy of approach itself. > > > > The idea about relationship between point sizes > > and physical monitor inches and in terms of DPI is > > not considered relevant. > > > > Instead, the measure of platform consistency is determined > > by collecting raster screeshots from different platforms > > and matching them on the same screen. Because vector graphics > > (e.g. a box around a text output) will be the same pixel size, > > so should be the font sizes. > > > > To achive this, it was observed how point sizes are rendered > > and the choices made in the most widely used and proven > > cross-platform media: the web browsers. Besides the > > authority claim, there is a practical consideration: > > both the browsers and J UI need to maintain proportion > > between raster images represented in pixels (web graphics) > > and the font sizes, which are specified in points in > > a platform-neutral way. (Also with sizes of UI controls, > > typically in pixels.) > > > > It was established that all modern web browsers on > > different plaforms, for platform neutrality, > > relate font point sizes to raster pixels, regardless > > of native platform DPI. For example, on Mac with 72 DPI > > in the TextEdit app text in Arial 12pt has the size of > > Arial 9pt on Windows (96 DPI); but the same text at > > Arial 12pt in Safari will be the same size as on Windows. > > > > To better understand this, here is an experiment. > > - While on Windows, Open this URL in a web browser: > > > > http://www.jsoftware.com/jwiki/OlegKobchenko?action=AttachFile&do=get&target=font_linux.png > > > > - Then run wordpad.exe, Type the text "Focus 0. font 10pt Arial" > > and make sure it's in font Arial 10pt. > > > > - Now line-up the baseline of the Linux screenshot > > and the text in Wordpad > > > > - Take full screen shot, run Paint and paste. > > > > - Now continue the lines from the linux over the > > Wordpad area -- they give a perfect match. > > > > http://www.jsoftware.com/jwiki/OlegKobchenko?action=AttachFile&do=get&target=font_lin-win.png > > > > But this "Arial 10pt" is true 10pt on Mozzilla, > > while in J on Linux you now need to set it to 13pt > > to get the size. The idea is to set 10pt in J and > > get that size. > > > > Note 1: beta v on Mac worked correctly in accordance with > > this approach. > > > > Note 2: the font selection tool should display the > > fonts in correct sizes and the same as they end > > up in J forms. > > > > > > --- Eric Iverson <[EMAIL PROTECTED]> wrote: > > > >> I've had yet another look at screen font sizes on all platforms. As > >> far > >> as I can tell the current behavior (in wbeta, probably not changed > >> since > >> vbeta) is the best I can do at this time. > >> > >> I've run win, win64, linux, linux64, and mac with the same screen > >> switched between them at 1280*1024 (LCD 19 real inches diagonal). > >> > >> Here are the isigraph pixel heights for each point size on each > >> platform: > >> > >> 09 10 11 12 13 14 15 - point size > >> 15 16 17 18 19 22 23 - win jwdw > >> 14 15 16 18 20 21 23 - win jwdp (java 1.4) > >> 14 15 16 18 20 21 23 - win64 jwdp (java 1.5) > >> 14 15 17 19 21 22 23 - linux (java 1.4) > >> 14 15 17 19 21 22 23 - linux64 (java 1.5) > >> 12 13 14 16 17 18 20 - mac (java 1.4) > >> > >> Comparisons with 45 lines on windows with notepad are exact at 12pt > >> and > >> vary a little bit over the range. > >> > >> At least in my test environment the linux results look OK. Comparing > >> with various linux text editors show quite a range in ideas of 12pt > >> though generally they are a bit larger than J. > >> > >> The mac results are a bit small. But compared to other text apps on > >> the > >> Mac they tend to be about right or even a bit large. > >> > >> The screen rendered size is somewhat arbitrary and is stated to not > >> be > >> exact. Everyone has there own ideas. In general Mac favors small, > >> Windows medium, and Linux large. > >> > >> Examples and insight welcome. Note that comparisons with other than > >> 1280*1024 on a roughly similar size screen introduce too many > >> variables > >> to be usefull in doing any tweaking. > >> > >> ----- Original Message ----- > >> From: "Oleg Kobchenko" <[EMAIL PROTECTED]> > >> To: "Beta forum" <[email protected]> > >> Sent: Wednesday, August 30, 2006 2:47 AM > >> Subject: [Jbeta] Font sizes for Linux > >> > >> > >> >I had a look at Linux with beta v and it > >> > seems like it has the same font size problem > >> > that is now fixed for Mac. > >> > > >> > See the screenshot, which compares fonts in > >> > J session, a font sampler and Mozilla, etc. browsers. > >> > http://www.jsoftware.com/jwiki/OlegKobchenko?action=AttachFile&do=get&target=font_linux.png > >> > > >> > If the same phenomenon is visible on other systems > >> > (that J fonts at size 13 look like 10pt in a browser), > >> > then its the same problem as was fixed for Mac. > >> > > >> > On Windows, the fonts in Java are OK. > >> > > >> > > >> > --- Oleg Kobchenko <[EMAIL PROTECTED]> wrote: > >> > > >> >> j601 t beta issues > >> > ... > >> >> * Mac fonts are smaller than Windows fonts, to be exact > >> >> The ratio reflects 96/72 DPI between Windows and Mac > >> >> As a result, fonts are disproportional to geometry > >> >> as shown in Plot demo. Grid uses some magic so > >> >> that fonts fit, but that may be non-standard ... > >> > > >> > <html><head></head> > >> > <body> > >> > <p>Open in Mozilla (Firefox, Epiphany) and compare with J font > >> > sizes</p> > >> > <hr /> > >> > > >> > <div style="font:10pt Arial"> > >> > Focus 0. font:10pt Arial > >> > </div> > >> > > >> > <div style="font:10px Arial"> > >> > Focus 0. font:10px Arial > >> > </div> > >> > <hr /> > >> > > >> > <p>15*4%3 = 20</p> > >> > > >> > <div style="font:15pt Arial"> > >> > Focus 0. font:15pt Arial > >> > </div> > >> > > >> > <div style="font:20px Arial"> > >> > Focus 0. font:20px Arial > >> > </div> > >> > </body> > >> > </html> __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
