It is currently Wed Nov 22, 2017 10:34 pm

All times are UTC - 5 hours




 Page 1 of 1 [ 4 posts ] 
Author Message
 Post subject: Shader VMK 89 - Font Manager Update
PostPosted: Sun Jun 14, 2015 6:23 pm 
Site Admin

Joined: Sun Feb 11, 2007 8:59 am
Posts: 1105
Location: Ontario Canada
The FontManager class and all supporting classes are updated in this VMK so that we can now support rendering text in a constrained area. You can either specify to limit just the width, or you can limit the width and the height.


Offline
 Profile  
 
 Post subject: Re: Shader VMK 89 - Font Manager Update
PostPosted: Mon Jun 15, 2015 12:43 am 

Joined: Sat Aug 16, 2008 7:58 am
Posts: 449
Everything works very good. With the video running long for you, the one thing you didn't test was the alignment of the text. I used the alignment for center and right justification and everything still works appropriately. I do not see any apparent bugs at this point. A comment that I would like to add here is I do not know if it would be to complicated to implement with the text area, but what if we were able to have the width of the text area dynamically update to fit the largest possible word width in the vector if the word width is not above a specific bounds. For example, we specify a width of 100 pixels for our box but the largest word requires 120 pixels to render then the widest width would be used and all text would be rendered. The constraint that I think would be good to use is when a word's width is more then double than the size of the text area width that is defined. So if we ask for a width of 100 but a word requires >= 200 pixels in width then it won't render and the ellipsis will be rendered and the specified size will be used and truncation will happen as before. Just something to think about. Or the other option would be to create another class that is a completely dynamic text area that is similar to this class but will accommodate for the largest word size if rendering space is available.


Offline
 Profile  
 
 Post subject: Re: Shader VMK 89 - Font Manager Update
PostPosted: Mon Jun 15, 2015 6:34 am 
Site Admin

Joined: Sun Feb 11, 2007 8:59 am
Posts: 1105
Location: Ontario Canada
That is a good feature that you can easily add to the existing text area class. You can implement this in a few lines of code using the existing architecture.

Add a flag to indicate if you want this object to auto expand.

In the generate function when you create the vector of words, you just have to check if any word is larger than the width, and if it is adjust the width accordingly.


Offline
 Profile  
 
 Post subject: Re: Shader VMK 89 - Font Manager Update
PostPosted: Thu Jun 18, 2015 9:01 am 
Site Admin

Joined: Sun Feb 11, 2007 8:59 am
Posts: 1105
Location: Ontario Canada
I just found a bug with the way that carriage returns are being processed. The fix will show up in VMK93 which I am recording right now.


Offline
 Profile  
 
Display posts from previous:  Sort by  
 Page 1 of 1 [ 4 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Jump to:  

cron