Mmmmm... that is interesting. TextField3D definitely doesn't support that =( So far it's designed to use a single font per TextField3D object. It would also be pretty difficult (and not very precise from a typography point of view) to remove shapes from a word and replace them with another word using a different font. The TextField3D uses a penPosition object for paragraph construction and it takes into consideration the dimensions of the space character in the typo. The way I would do it would be to create some sort of array or dictionary object in TextField3D to hold references to different fonts and word index positions in the field. Then alter the generateText() method to swap fonts having reached the indexes.
You can have a go, I'll give it a try when I have time. I've just got too many things to do now... I'd be nice to have a little help too :D If you want to try the word swapping thing, the TextField3D object now has a word getter which returns a bunch of shapes corresponding to that word. If you read the first vertex of the first word of that you can get the coordinates of the word inside the textfield, remove the shape and use this point to place your new word. Also, you would have to use a dummy textfield as a source of the injected words. Anyway, this just made me think of doing a wishlist for the textfields branch so I can go tackling points while I have some free time. What do you think would be the best way to use a wishlist? All I can think of is using a post in this group... There must be something better. Nice to see you using the branch in such depth cheers! On Mon, Jan 12, 2009 at 10:42 PM, G. <[email protected]> wrote: > > Hi there, > > Still on the same project, based mostly on typo, I'm trying to get > some words from the same text in another font. (more precisely: > highlighting some words with a bold font) The first thing that came to > my mind was to have the main text on a first TextField3D object with > the regular font and then find the index of each word I want in a bold > font and create as TextField3D as there are words and then place those > words at the coordinate of the word in regular font. The thing is > Shape3D doesn't implement x, y and z so I cant get a single char > position in the object. I've tryied using the TextField3D.letters and > get each char's first vertex' coordinates but the result is not really > precise. > > The only thing that works well is to remove the chars from one > TextField3D to add them in the new TextField3D, but with this solution > I can't chose the font. So I tried to outline the chars in the new > TextField to get a bold effect but I could'nt succeed making the > outline property of either the Shape3D or the TextField3D work (I also > tried the basic way using a WireFrame Material, but that doesn"'t give > the result I need, I also tried mixing the WireFrame Material with a > ColorMaterial in a Composite Material but Composite Material doesn't > accept WireFrame Materials) > > So here's my question:what is the appropriate way to place some chars/ > a TextField3D depending on chars in another TextField3D's position??
