Thanks, that sounds more than reasonable. In the mean time, since this is a gated iterative approach, I can still work on things without requiring columns. It just means that sometime in the future I may have to switch to a completely different approach if they require columns and it cannot be done. I’ll burn that bridge when the time comes ;).
Are you building in the ability to track the maximum amount of pages? For example, if I need to display that the user is on page 20 of 250 … will the new update support grabbing the number 250 out of the textfield through a maxPages property, or something of the like?
Again, the user case is to build a simple e-reader (without pictures ;)). From what we’ve spoken about, it sounds like this should be able to support dynamic changing of font size, progressing backwards and forwards through the book based on pages, markup language for visuals, and clicking on specific words. However, do you see any issues with assigning a massive string into the textfield (ie: a book)? Is the page feature meant for smaller-scale strings, or will it work on a larger scale? I don’t mind if it requires a bit of time to re-configure itself … has it been tested against something that large though? It sounds like the columns (which I’m going to ignore until a later date) and the size of the string are the only two real unknowns left … so rest assured, I’ll stop bugging you shortly :).
Sorry for all of the questions. I very much appreciate the amount of time you put into both your product and your support. I would wait until the next update before asking these questions, but I’m actively holding off on the project until then, so I need to inquire into if the update will actually be appropriate for what we’re doing.
Thanks again!
[Edit]
Hey, it also occurs to me: are you able to store the indices of each page in terms of the overall word array? It would be really useful if I could compare a words position in the overall array to the indices of the pages. That way, if I needed to do a search feature, I could simply find all the words that match, and easily grab (a) the surrounding text and (b) the pages they are found on. Just figured I’d throw that out there since your in the middle of working on that right now … no idea if its possible based on how your programming this, but I’d hate to let that slip by just because I didn’t ask!
Is it possible to add a new rich text tag on my end, or is that in your .dll? I want to create a <id=name>text tag, where the tag would store the index and number of words in the tag in a dictionary. That way I could find specific chunks of text at run time by querying ids.
This type of feature potentially goes beyond columns of text as it leads into having text flow from one container to another which can be implemented in various ways. The trick is to find an efficient and elegant method to implement the column type feature sort of paving the way to enable even more functionality down the road.
Tracking and control over displaying pages is a property. TextMeshPro.pageToDisplay(int page); Tracking how many pages we have is already there in the form of TextMeshPro.textInfo.pageCount;
The biggest challenge here is the limit on the number of vertices that an mesh can have which is 65535 which is a Unity limitation which means we can only have about 16000 characters per object. So the column thing and having text flow from one container to the other comes back in focus. The current page feature for dialogue or a few pages should work fine for more complex needs, maybe each page should be in an array of string for each page. Then to display the new page, we simply change the TextMeshPro.text = book[page54];
As per my comments above, we have a definite limitation on the number of vertices / characters per mesh.
Dealing with a massive string would also not be practical. Maybe the content is stored in a file and instead of submitting the text one page at a time, you supply more to provide padding before and after the current page. In the event the font size is reduced, since the current sub string already includes this extra content, using the current page feature to display it should not be an issue. The challenge is find a nice transition point to update this sub string. Basically, I am think that the text object is always showing the middle of the sub string. Assuming the user is looking at page 10. The sub string would actually include page 9, 10 and 11. If the point size is reduced, the user would see a bit of page 9 and page 10. This is handled by the current page feature. If the user turns to page 11 then we need to update the sub string to include page 10, 11 and 12. The text will need to be synced between those page transitions but I am not sure yet how that is going to play out. We will just need to figure what additional information might be required in the textInfo class to manage this.
Questions are good
I think the content should be stored in a text file and searching through the content should be done via whatever method is most efficient for that. The results which contains the matching query would then be supplied to TextMes
This almost sounds like InDesign/PageMaker/FrameMaker for Unity the way features in TextMesh Pro keep coming in.
Do you have an estimate ( best guess) on when you will be doing an official release? Also do you plan on updating the asset store with your current beta versions?
Storing the text in a file is fine, but how does the user know where the page indices are before he’s actually supplied the text to the TextMeshPro? How would he know what chunk of text to supply for pages 9-11, when the page breaks need to be determined by the TextMeshPro to take the dynamic text sizes into account? If there are 300 pages of text total, the user needs to know where all of the split indices are ahead of time in order to determine which part of the text to supply … not to mention how many pages total there are. Until that information is accessible, there’s no way for the user to supply the text in chunks … so an upfront parsing of the entire string is still needed (unless theres a better way thats escaping me). Furthermore, for the search feature: I agree, searching the text would be done outside of the TeshMeshPro. But I would still need to know where the indices of the pages are in order to allow the user to flip to the correct page.
It sounds like the user would need to supply the entire string, and have an array of page indices returned (or the equivalent of). That way he would know up front (a) how many total pages there are, and (b) he could supply only a few pages of text at a time for performance reasons, and (c) whatever other functionality he comes up with. Once the user has the indices of the pages within the entire string, it becomes very easy to implement all sorts of custom functionality on the user’s end without requiring anything further from the TextMeshPro. If its not practical to parse such a huge string for performance reasons, the string could be parsed ahead of time and the indices per font size stored in a lookup table. Additionally, if the user has the page indices, he can simply pass in the amount of text needed for the visible pages (as you mentioned), which could actually allow me to hack around the whole column thing by having two TextMeshPro objects on the screen, and simply supplying the second one with the next page’s text … that way there’s no reliance upon you implementing a column system to go through with this project.
Anyway, thanks for discussing all of this.
[Edit – for the record, I’m just trying to get across my use case properly. I don’t understand your code base properly, so I don’t expect to have an actual back and forth convo about this … just enough to feel confident that if there’s a problem with what I’m assuming is coming down the pike, you’ll let me know.]
I never thought I would be making a word processor / tool like In Design but it is sure kind of heading in the general direction.
The latest beta release is feeling much better with support for all the new UI / Unity 4.6 stuff. These beta releases are available to all registered users of TextMesh Pro via the TextMesh Pro User Forum.
In terms of the AssetStore Package, there are still a few features that I want to add plus I need to wait for Unity to address some of the outstanding issues in Unity 4.6. For instance UI Mask only supports 3 layers right now where it should support 8. So until Unity 4.6 is looking pretty solid with all the features I rely on working, I would rather wait until then before updating the AssetStore Package. I expect that I’ll be releasing a few more Beta Releases on the TextMesh Pro User Forum and during that time, I am adding new features
This is a good discussion as it helps me get a better understanding of the type of functionality that would be required.
Lets take the conversation to PM or email as I need to get a better understanding of your application and how you envision your end users using your application. With that better understanding, I can then figure out the best way to handle this.
Just a few quick note: We don’t really have a choice on storing the text in some file due to its potential size. We also can’t feed the entire text to TextMesh Pro due to the vertices limitation on the Unity side plus if we are only displaying one page of 100, processing the whole text for just one page will be very inefficient.
We need to break up / manage the text file into manageable bit size. If tags like <page=10> can be added to the large text file then you could create a script that would return that page of text from the larger file. Then it could be provided to TextMesh Pro. If that page of text turns out to be larger than the reading area then the current page mode would handle that automatically. In this implementation changing the point size would be fine as TextMesh Pro would redo the page mode for the current supplied page from the text file manager. When the user ends up at the end of that page, then you would fetch a new page from the text file manager.
Since I don’t have a full understanding of your needs yet, a potential issue with this technique is that it would behave like a book. Pages would always started at the top and the sub page could end up with just one line of text on it before a new page is loaded. Meaning the content of Page 1 would never blend into Page 2.
It seems like the auto-sizing feature only works with the TextMeshProUGUI component, is there any way for me to transfer that functionality to the non UGUI component script?
The functionality is the same across both Components with the exception of the support for UI Mask which is specific to the new UI.
The text auto sizing functionality was added back in beta release 0.1.45. The latest beta releases which include many new features are available to all registered user of the product on the TextMesh Pro User Forum.
I have a game title/logo, and the text has been tweaked a lot in Illustrator, then exported as a tga for Unity. Is there any way to use that in TextMesh Pro? I’d love to get some of these effects on it, but it would be hard to recreate all those tweaks in TMP. I am assuming it’s not possible, but figured I might as well ask.
Coming Soon! Rich Text Tag <sprite=xx>
This new rich text tag will enable graphics to be added inline with the text. The sprite xx will reference the # of a sprite contained in a sprite sheet.
Just like any other characters, these graphics will follow word wrapping as well as being affected by character spacing and other text layout controls. This is the first initial implementation so there is still work to be done but this feature now has a pulse
There are a few post in either this thread or the WIP about support for Arabic.
I guess there are two issues. The first is I am not certain the Unity Editor (text field) understands Arabic as pasting those characters in the editor yields different characters. In order to draw the correct results, I need to get from the Unity Editor Text Field the correct unicode.
Second, just like cursive, the outline becomes an issue but you can cheat to get around it by using a duplicate object to produce the outline or effect you are seeking.
The Font Asset Creator offers different modes to define which characters to include. One of those modes is Custom Range(s). So you could for instance request characters from “32-126, 1536-1901” which would include Arabic + supplemental characters.
Amazing!
Yes, we’ve been doing some Arabic work recently. We had to use this plugin to get the Arabic text converted to that Unity could render it correctly:
It wasn’t perfect though. There are some ‘diacritic’ characters that appear above and below some characters and Unity renders slightly offset in the wrong place. I think this may be a fundamental problem with the text rendering library they’re using as I read about quite a few other projects online that had similar issues until they updated their libraries…
The idea of using 2 texts to get the outline working is great.