If you load your file into a Image, you can paint it onto a component. Once you get the Graphics object for the component, you can clip the portion of it that you want to display. Something like:
Of course you may would want to use different clip logic for each part that you want displayed.
"JavaRanch, where the deer and the Certified play" - David O'Meara
posted 16 years ago
Mmmmm, I don't think that this would work. You see, distances between letters are not known at compile time. That's why there is a pink line at the top - to indicate gaps between letters. A smart program (none of the programs I have written ) would recognise the pink line and then set the clip. Anyway, I found a more weird way to implement my font loader. I use batik to take a .ttf file, convert it to .svg then load the svg, add the desired text to it and finally display it OK, I admit it this is a 2:00am idea but at least I get something on screen... Tom. [ September 08, 2003: Message edited by: Tom Diamond ]
I do some of my very best work in water. Like this tiny ad:
professionally read, modify and write PDF files from Java