How to display a lot of read only text in GWT? - gwt

I have a requirement to display a somewhat large amount of text, read only to the user. It can be up to a maximum of 500 characters, which isn't excessive, but it's still a lot. Since it's read only I was thinking of a label a versus text area box, if it can handle that much. Is there a better way to do this than I'm not aware of?
Thanks,
James

Label works fine. Just remember that the default css for white-space collapses whitespace rather aggressively. If your text includes line breaks you may want to switch to pre or pre-wrap.
The most straightforward (if not necessarily most correct) way to do that is:
Label myLabel = new Label();
myLabel.getElement().getStyle().setProperty("whiteSpace", "pre");
Note the Camel Case on the CSS attribute.

Either a Label or a TextBox will definitely be able to handle 500 characters.
Think of all the blog posts, Wikipedia articles, Stack Overflow questions, longer than that that have been written. They were all composed in a text box and displayed in a div. You'll be fine.

500 chars is no big deal so it will be ok. Label is ultimately calling element.innerHTML = text which is a browser-native Javacript function that can handle any amount of text.

Related

Expandable text fields in PDF Forms, with Adobe Acrobat

I think this should be a relatively straightforward question to answer: is it possible in Adobe Acrobat only (not LiveCycle) to create text fields/boxes which automatically expand with their text? Scrollbars are not what we're looking for; the box itself must expand so that all the text is printable, as well as be saveable, printable and accessible.
Thank you.
Adobe Propaganda would say, this is not possible, and you will need XFA/LiveCycle Designer to do it.
It is possible, and I had it in practical use in some forms (not anymore, because they completely changed their forms system). It is "a little bit messy", and it only works with growing, but not with shrinking (although there may be some more fiddling needed to make it possible).
There is another alternative, which could work, if some tolerance is given to the precision. In this alternative, we count characters and line breaks, and change the size of the field accordingly.
Finally, the cheapass solution would be setting the font size to automatic, and let it change so that the contents fits into the field.

Star symbol too small in a dialer-like view

I'm trying to create a dialer-like application:
I'm using [UIFont systemFontOfSize:33]. The problem is that the Asterisk symbol is too small in comparison to the numbers and '#'.
I printed 123*# in all 61 available iOS6 fonts and the star is smaller than other chars in all of them.
Does somebody have an idea how to solve this?
One thing I tried is changing font size only for * button. That works, but when I hit this button it appears small [off course] in the input above...
Hope my Question is clear.
Thanks.
Use a different character for the display. In Xcode, click on the Edit menu and select Special Characters. When the character viewer appears, type "asterisk" into the search field. Try one of the many other related symbols.
Depending on how you do this, you may need to replace the used symbol with a proper asterisk internally to use the result in a tel URL.
You can use attributedString and change the font size to big enough of all asterisks

LED Display simulation Xcode

I have been very long looking for the answer to my question on the web, but I didn't found anything helpful so I decided to ask you.
Basically I want to Programm a app like how this video shows. Another big deal for me is - how can I change the text size ?
For each character I should make a array of boolean to determine if the led pin should be on or off. I think this is the smartest way for displaying text in fix text size.
Do I have to make an array for every character in every text size I want to get this function working ?
Essentially you are making a Font Map for each font you wish to display on your large LED display. Just like fonts on a regular display, Im afraid the answer is YES, you will have to make essentially a map file for every font you wish to support.
It may not have to be true booleans however, you may be able to get away with a much more compact version of the booleans by storing multiple boolean bits in a single byte, short, or int, etc...

How to prevent line breaks with jasper-reports HTML export when using textfield truncation?

Using iReport 4.5.0, I'm setting these two properties and values:
net.sf.jasperreports.text.truncate.at.char=true
net.sf.jasperreports.text.truncate.suffix=...
The intent is to add "..." to the end of textfields whenever they must be truncated, and that the truncation determination happens at the character level, rather than at the word level. This works as expected when exporting to PDF. However, when exporting to HTML, the last truncated token (with the suffix appended) will often, though not always, wrap incorrectly. (It does this even though StretchType is set to No Stretch.) Example:
If I change net.sf.jasperreports.text.truncate.at.char=false (so that it breaks on words instead of characters) it seems to work more often, but only because word breaks usually leave more space for the suffix. The unexpected line wrapping still occurs with word breaks, especially if I increase the length of the given suffix.
My best guess is that the HTML exporter measurement isn't precisely calculating the width required by the given suffix (if it's calculating it at all).
Can anyone confirm?
Any suggestions as to a workaround?
It seems like with StretchType set to No Stretch, that the HTML exporter should probably also set white-space:nowrap. However, although that would prevent the line from wrapping, the end of the suffix would be partially hidden (due to overflow:hidden styling).
"My best guess is that the HTML exporter measurement isn't precisely calculating the width required by the given suffix (if it's calculating it at all)."
I confirm that this is surely the reason.
But there's not really a simple workaround. Your PDF is good, so you're doing something right. Well... you're doing lots of things right. ;-)
In HTML you don't know--in a very fundamental way--the precise details of the font that will render the text. You can certainly specify the font. But the client machine might not have it. Or it might have one that is the same... but not quite the same. Or the client might choose to use a different font or different size via various client-side override mechanisms.
If you try different fonts, you should notice slightly different results. You may be able to find one that works better more often. (Clearly, this isn't 100% perfect.)
If you aren't using Font Extensions, then you should. If you are using Font Extensions, then you can specify the list of fonts in descending preference that ought to be used in the HTML. This should give you enough control to get behavior that is good in a large number of cases. Often you can make it perfect in all of the cases that you care about.

How can we set an equal spacing between two labels where contents dynamically loaded in iphone SDK

In my iphone app, i have a requirement for quote of the day.
I want to display the quote in the manner as quote and its author name.
I want that no matter how big or how small the quote is the author name should come below the quote leaving one blank line.
I tried using the two labels but it works well for bigger quotes but for small quotes the author name seems too far away from the quote.
I want equal spacing between quote and author name no matter how big or small the quote is.
What should I do?
Please Help and suggest.
Your suggestions are most welcome
Thanks
Why don't you size the text dynamically using size and constraint and depending on them create/set the two frames needed for the two labels? See this basic example:
http://www.cimgf.com/2009/09/23/uitableviewcell-dynamic-height/