|
Author |
Topic: noSmooth doesn't apply to text? (Read 529 times) |
|
mattgilbert
|
noSmooth doesn't apply to text?
« on: Nov 29th, 2004, 6:49pm » |
|
hi, Is noSmooth() also supposed to make the text bitmapped? When I load Verdana at 14 pt, and try to draw it to the screen at 14 pt, with noSmooth() allready called, it still smooths it. Here's the code: Code: BFont verdana; void setup(){ background(0); noSmooth(); verdana = loadFont("Verdana.vlw"); textFont(verdana, 14); text("word", 15, 50); } |
| Verdana is drawn properly bitmapped in the preview window when I'm creating it. One odd thing: In the sketch window it seems to be drawing smaller than it is in in the preview. Is there a way to render bitmapped fonts that I don't know about? matt
|
|
|
|
mattgilbert
|
Re: noSmooth doesn't apply to text?
« Reply #1 on: Dec 11th, 2004, 11:42am » |
|
any work-arounds? some other way to get bitmapped text? matt
|
|
|
|
fjen
|
Re: noSmooth doesn't apply to text?
« Reply #2 on: Dec 11th, 2004, 2:00pm » |
|
try calling noSmooth() after textFont() ... /F
|
|
|
|
fry
|
Re: noSmooth doesn't apply to text?
« Reply #3 on: Dec 11th, 2004, 6:00pm » |
|
you have to use textSpace(SCREEN_SPACE) to turn off the text smoothing. that will draw it at the exact size at which it was created.
|
|
|
|
fjen
|
Re: noSmooth doesn't apply to text?
« Reply #4 on: Dec 11th, 2004, 6:41pm » |
|
what is up with me? think before posting! anyway, use textSpace(SCREEN_SPACE) _after_ textFont() ... that's what i wanted to say. /F
|
|
|
|
mattgilbert
|
Re: noSmooth doesn't apply to text?
« Reply #5 on: Dec 11th, 2004, 10:50pm » |
|
ok, now trying: Code: BFont verdana12; void setup(){ background(0); noSmooth(); verdana12 = loadFont("Verdana12.vlw"); textFont(verdana12, 12); textSpace(SCREEN_SPACE); text("word", 15, 50); } |
| with "Verdana12.vlw" being created at 12 points with the "Smooth" checkbox unchecked. This looks better, but it still isn't bitmapped, the way it previews in the Create Font window. ? matt
|
|
|
|
fjen
|
Re: noSmooth doesn't apply to text?
« Reply #6 on: Dec 11th, 2004, 11:45pm » |
|
that's because the 'create-font' tool sometimes seems to ignore the 'no-smooth' setting. here's a little test that shows that the verdana 12 generated by create-font with no-smooth _IS_ smoothed: Code: BFont font; int fheight=20, fwidth=15; char[] somechars = (new String(" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~")).toCharArray(); BGraphics pg; void setup() { size( somechars.length*fwidth, fheight ); //| //| the vlw font was created using size 12, no smoothing. //| (same for versions .68 and .72 / mac) font = loadFont("Verdana-12.vlw"); framerate(5); pg = new BGraphics( fwidth, fheight ); pg.format = RGB; } void loop() { background(255); pg.background(255); pg.fill(0); pg.textFont(font); pg.textSpace(SCREEN_SPACE); //image(font.images[ci], 10, 10); ci++; int ci = 0; for(int xx=0; ci<somechars.length; xx++) { pg.background(255); //| //| the actual character-images from inside BFont pg.image(font.images[ci], 1, 1); //| //| write one char //pg.text(String.valueOf(somechars[ci]), 1, fheight); image(pg, xx*fwidth, 0); stroke(200); line(xx*fwidth,0,xx*fwidth,fheight); ci++; } } |
| don't know how to work around this ... /F
|
|
|
|
fjen
|
Re: noSmooth doesn't apply to text?
« Reply #7 on: Dec 11th, 2004, 11:57pm » |
|
this made me wondering a little, in fact i can't create ANY not-smoothed fonts with the create-font-tool ... /F
|
|
|
|
mattgilbert
|
Re: noSmooth doesn't apply to text?
« Reply #8 on: Dec 12th, 2004, 3:25am » |
|
bummer. oh well. what is a .vlw font, anyway? are there other ways to create them that might work? matt
|
« Last Edit: Dec 12th, 2004, 3:26am by mattgilbert » |
|
|
|
|
fry
|
Re: noSmooth doesn't apply to text?
« Reply #9 on: Dec 12th, 2004, 6:26am » |
|
on Dec 11th, 2004, 11:57pm, fjen wrote:this made me wondering a little, in fact i can't create ANY not-smoothed fonts with the create-font-tool ... |
| in your case, this is a macosx-only bug, thanks to apple, who doesn't seem to want to honor text anti-aliasing being shut off in java. it works fine on windows.
|
|
|
|
fry
|
Re: noSmooth doesn't apply to text?
« Reply #10 on: Dec 12th, 2004, 6:27am » |
|
on Dec 11th, 2004, 10:50pm, mattgilbert wrote: with "Verdana12.vlw" being created at 12 points with the "Smooth" checkbox unchecked. This looks better, but it still isn't bitmapped, the way it previews in the Create Font window. |
| textSpace(SCREEN_SPACE) should be producing identical results to whatever you see in the "Create Font" window. if not, could you send a screenshot of what's happening the create font window and an image from your applet that's fuzzy
|
|
|
|
|