Re: Font differences between IDL 5.6 and IDL 6.0 [message #38227] |
Fri, 27 February 2004 10:11  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Lynn writes:
> I found the reference.... in IDL help...Under Visual Enhancements.
>
> "IDL 6.0 incorporates the FreeType Library for improved rendering
> of Object Graphics fonts. Previously, characters in an IDLgrText object
> were rendered by tessellating each glyph outline into a set of small
> triangles. IDL 6.0 renders an entire IDLgrText string as a high quality
> bitmap, which is texture mapped onto a single polygon.
> This technique allows for clearer characters at any size, easier
> manipulations, background colors, kerning, and blending.
> For information on the FreeType Project, visit http://www.freetype.org."
Humm, yes. Just browsing those pages for a few minutes brings
back my graduate school nightmare of contouring protein surfaces.
There are LOTS of ways to do it. None exactly right, and none
exactly wrong, either. Choose your poison and then live with it. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
Re: Font differences between IDL 5.6 and IDL 6.0 [message #38228 is a reply to message #38227] |
Fri, 27 February 2004 09:47   |
Lynn
Messages: 3 Registered: February 2004
|
Junior Member |
|
|
David writes,
> .... I would guess this is not RSI's fault, but the
> fault of the folks who built the font library. This was
> obtained from one of the Open Source libraries, but I can't
> seem to find the reference now. Does anyone know it? Perhaps
> we can ask the designers about the problem.
David,
I found the reference.... in IDL help...Under Visual Enhancements.
"IDL 6.0 incorporates the FreeType Library for improved rendering
of Object Graphics fonts. Previously, characters in an IDLgrText object
were rendered by tessellating each glyph outline into a set of small
triangles. IDL 6.0 renders an entire IDLgrText string as a high quality
bitmap, which is texture mapped onto a single polygon.
This technique allows for clearer characters at any size, easier
manipulations, background colors, kerning, and blending.
For information on the FreeType Project, visit http://www.freetype.org."
oText[i+j]=OBJ_NEW('IDLgrText',STRING=str[i], FONT=oFont[k],/RENDER_METHOD)
Using the /RENDER_METHOD property for an IDLgrText object
and reverting back to the "triangle" method fixes the squashing of the
numbers
in window output.
I still do not like the alignment though. Any further input would be
appreciated.
Thanks for your help,
Lynn
|
|
|
|
Re: Font differences between IDL 5.6 and IDL 6.0 [message #38236 is a reply to message #38235] |
Fri, 27 February 2004 08:22   |
Karl Schultz
Messages: 341 Registered: October 1999
|
Senior Member |
|
|
"Lynn" <lwhanigan@hotmail.com> wrote in message
news:ef2dfe4c.0402270632.5a50ff99@posting.google.com...
> There seems to be a difference in which IDL5.6 and 6.0 handles fonts.
> IDL6.0 does not appear to be consistant when displaying characters in
> size and alignment. For me, new lines do not always line up
> vertically. In addition, lines with only text, (i.e. no numbers),
> seem to appear smaller than do lines with text and numbers. Has
> anyone else encountered this? And if so, have you found a way to fix
> these problems? Or maybe know what IDL is doing differently? I've
> appended a small test program which illustrates my problem.
IDL 6.0 uses the Freetype library to render text glyphs for Object Graphics.
One of the techniques Freetype uses to improve glyph appearance is called
"hinting" or grid-fitting. Sometimes the library may jiggle the position of
a glyph slightly in order to position it better on the pixel grid for better
appearance, and this may be causing the alignment issues you are noticing.
In most cases, the result is much better than the triangle rendering used
before 6.0.
You can revert back to the triangle rendering if you really want to by using
RENDER_METHOD=1 on IDLgrText. I noticed that your test is making printer
output. On a printer device, which has a LOT of resolution, the text
rendered with triangles can look really good, so that may not be a bad
choice when printing.
Karl
|
|
|
|
Re: Font differences between IDL 5.6 and IDL 6.0 [message #38240 is a reply to message #38238] |
Fri, 27 February 2004 08:09   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Lynn writes:
> My main contention is that numbers, especially, do not look nice.
> This is more apparent at smaller fonts for example, courier 8 and 10.
> "2", "4", "5" and "7" seem squashed, when viewing in an object
> window.
>
> str[1]='0123456789'
> str[2]='0123456789xxxxxx0123456789'
> str[3]='xxxxxx0123456789'
>
> Additionally, alignment really looks ugly when beginning new lines.
> Lines beginning with characters of slim width, as in the case of "I",
> look like the character is right justified rather than left justified with
> respect to the edge, thus creating slight indentations of lines.
>
> str[1]='Image'
> str[2]='Will not align with'
> str[3]='Other lines'
>
> Do you see this too?
Oh, yes. I see what you are talking about now, although
I only notice it in the window output, not on the printer
output. I would guess this is not RSI's fault, but the
fault of the folks who built the font library. This was
obtained from one of the Open Source libraries, but I can't
seem to find the reference now. Does anyone know it? Perhaps
we can ask the designers about the problem.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
Re: Font differences between IDL 5.6 and IDL 6.0 [message #38241 is a reply to message #38240] |
Fri, 27 February 2004 07:49   |
Lynn
Messages: 3 Registered: February 2004
|
Junior Member |
|
|
David,
Thank you for the quick responses.
My main contention is that numbers, especially, do not look nice.
This is more apparent at smaller fonts for example, courier 8 and 10.
"2", "4", "5" and "7" seem squashed, when viewing in an object
window.
str[1]='0123456789'
str[2]='0123456789xxxxxx0123456789'
str[3]='xxxxxx0123456789'
Additionally, alignment really looks ugly when beginning new lines.
Lines beginning with characters of slim width, as in the case of "I",
look like the character is right justified rather than left justified with
respect to the edge, thus creating slight indentations of lines.
str[1]='Image'
str[2]='Will not align with'
str[3]='Other lines'
Do you see this too?
Lynn
"David Fanning" <david@dfanning.com> wrote in message
news:MPG.1aa90a099b0201239896b1@news.frii.com...
> Lynn writes:
>
>> There seems to be a difference in which IDL5.6 and 6.0 handles fonts.
>
> I'm not sure your test was a fair one. You contend, do you
> not, that a line of text that has numbers in it will be
> larger than one that does not?
>
> Then, I think the lines you should use to compare are these:
>
> str[0]='Test of '+fontstr[j]+' of size '+ $
> strtrim(string(fontsize[k]),1)
> str[1]='Image Type :JPEG-lines seem to not'+$
> ' line up vertically in IDL 6.0'
> str[2]='Image Type :JPEG-lines seem to not'+$
> ' line up vertically in IDL XXX'
> str[3]='Lines with numbers/text seem larger'+$
> ' in font size text only'
>
> With this comparison, I find the lines to look identical.
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
Re: Font differences between IDL 5.6 and IDL 6.0 [message #38243 is a reply to message #38241] |
Fri, 27 February 2004 07:44   |
Michael Wallace
Messages: 409 Registered: December 2003
|
Senior Member |
|
|
> Yes, IDL object graphics uses a completely new font library in
> IDL 6.0 than they did in IDL 5.6. Perhaps there is a trade-off in
> font size consistency with readability. I *greatly* prefer the
> readability of the new fonts and *desperately* would like them
> available in direct graphics, where they would be useful to
> the 95% of us who use object graphics only infrequently. :-)
While we're talking about fonts, why are fonts used in the Z buffer
bigger than fonts used in the 'X' device? Is there some magic to make
the Z buffer fonts appear the same as the 'X' fonts or vice versa?
; create a plot in 'X'
set_plot, 'X'
window, XSIZE=640, YSIZE=512
plot, findgen(11), TITLE='Title', XTITLE='Index', YTITLE='Value'
image1 = tvrd()
; create a plot in 'Z'
set_plot, 'Z'
device, SET_RESOLUTION=[640, 512]
plot, findgen(11), TITLE='Title', XTITLE='Index', YTITLE='Value'
image2 = tvrd()
; image1 and image2 are very different images! Why?
-Mike
|
|
|
|
|
Re: Font differences between IDL 5.6 and IDL 6.0 [message #38301 is a reply to message #38243] |
Mon, 01 March 2004 09:52  |
Liam Gumley
Messages: 473 Registered: November 1994
|
Senior Member |
|
|
"Michael Wallace" <mwallace.removethismunge@swri.edu.invalid> wrote in
message news:103upet5npii528@corp.supernews.com...
>> Yes, IDL object graphics uses a completely new font library in
>> IDL 6.0 than they did in IDL 5.6. Perhaps there is a trade-off in
>> font size consistency with readability. I *greatly* prefer the
>> readability of the new fonts and *desperately* would like them
>> available in direct graphics, where they would be useful to
>> the 95% of us who use object graphics only infrequently. :-)
>
> While we're talking about fonts, why are fonts used in the Z buffer
> bigger than fonts used in the 'X' device? Is there some magic to make
> the Z buffer fonts appear the same as the 'X' fonts or vice versa?
>
> ; create a plot in 'X'
> set_plot, 'X'
> window, XSIZE=640, YSIZE=512
> plot, findgen(11), TITLE='Title', XTITLE='Index', YTITLE='Value'
> image1 = tvrd()
>
> ; create a plot in 'Z'
> set_plot, 'Z'
> device, SET_RESOLUTION=[640, 512]
> plot, findgen(11), TITLE='Title', XTITLE='Index', YTITLE='Value'
> image2 = tvrd()
>
> ; image1 and image2 are very different images! Why?
You need to explicitly set the font size for both devices, e.g.
device, set_character_size=[10, 12]
Then the font sizes should match.
Cheers,
Liam.
Practical IDL Programming
http://www.gumley.com/
|
|
|