How to style individual cell text in jspdf - jspdf

I'm using jsPDF to build a simple information table but I need some cells to be italic or bold.
I was wondering if it's even possible to style them or should I just draw rectangles around the text and simply put regular text modules inside it.
I'm not usign AutoTable. This is simply the regular table.
http://raw.githack.com/MrRio/jsPDF/master/docs/module-cell.html
The only option I see is using the table func and setting the fontSize config there, but there's no option for font style and setting doc.setFont('Roboto', 'bold') doesn't affect the table.

Related

How to test jspdf autotable empty cells?

I'm trying to make a PDF version of crossword puzzles. Is there a way to test cells content ( cells with empty strings or cells with just nothing ) in order to paint them black?
You can use the createdCell hook to dynamically change styles of cells depending on there content.

Editable UITextView with multiple columns

I need to develop a text editor (UITextView) that will have multiple columns. I'm currently trying to accomplish this using Text Kit. Unfortunately, we can only use one TextContainer in UITextView (textContainer property).
I've seen a lot of implementation rendering text UITextView with multiple columns bit our requirement is different since it has to be editable. Multiple UITextViews does not work since we need to properly adjust the text position and cursor to overflow from/to the previous/next column.
Has anyone achieved this already?

RichText label or 'flow' layout for text in iOS (Xamarin/MonoTouch)

I am trying to repduce a similar sort of layout as in the screenshot below from the Digg app..
Notice that each list entry has a title in bold followed by the source, posted time and finally if there is enough space the start of the description line.
The question is what is the best way to achieve this in iOS? With some posts having longer titles than others I cannot simply say that the title label is 40px high and then place the Source label at 45 as the title will sometimes be longer and sometimes shorter.
Do I have to calculate the height of the label based on its contents before arranging the layout or is there some better way of doing this in iOS so that the views 'below' are automatically moved down?
Another alternative would be some sort of rich text label that I could add all the text to and have it automatically wrap round moving the later text down but I cannot find any sort of control in standard iOS / Xamarin (MonoTouch).
Any pointers would be greatly appreciated?
If you are using a storyboard the simplest way to achieve this result is to define different prototype cells. For example, you could define four different prototype cells, each one with a different layout like those shown in the example picture you provided. You can dequeue the appropriate cell based on the content you want to display so there is no need to adjust the layout in the code.
If you are doing everything in code, it's a lot more complicated since you have to build your own "layout engine" to adjust size and position of the views in your cell. You can have a look at XibFree or use MonoTouch.Dialog as suggested in the comments.

SmartGWT - How to have editable and non-editable text together in the same text area?

Please let me know how to approach this problem, I am naive to smartGWT.
The requirement is that:
I have to display a text area which has some pre-populated text.
Part of this pre-populated text should be editable and the part of this pre-populated text should be non-editable.
The editable text should be rendered in black color while the non-editable text should be rendered in gray color.
I am currently using com.smartgwt.client.widgets.form.fields.TextAreaItem class but I am open to change my class if this usecase is supported by some other widget.
Details:
Suppose the below lines displays the upper and lower boundary of my text area.
[Editable text] (This text should be editable and should have black color)
[Non editable text] (This text should be non editable and should have gray color)
[Editable text] (This text should be editable and should have black color)
The TextAreaItem is rendered as a HTML textArea so just good for input not for formatting .
Perhaps you could use the RichTextItem which allow to format a text with different font and attribute.
But it is no quite sure you can customize it (to remove the tool for example) and just play with the events.
I don't think it will be so easy
Do you have a random number of line?
If not you can design your own with a canvasItem including editable element (TextItem), non editable elements (could be TextItem with setDisabled(true) but watch the style)and assign css for the style

Is there a way to make use both italic and bold in a textview in XCode 4.3.2?

I am including some text in a textview and want both regular font and some italicized words. Is this possible to do this or no? If so can someone show me how to do this? I know you can either set the whole text in the textview to either be bold or italic or regular but was wondering if you could mix it up as well?
Thanks
Quoted from the UITextView Class Reference:
This class does not support multiple styles for text. The font, color,
and text alignment attributes you specify always apply to the entire
contents of the text view. To display more complex styling in your
application, you need to use a UIWebView object and render your
content using HTML.
So it looks like what you want to do is not natively supported.

Resources