Bullets and Numbering in Silverlight - silverlight

I'm looking for some comprehensive library for Silverlight on bullets/numbering. I've found a few, like Vector Light's RTB control, but most are lacking extended features of bullets/numbering that word processing programs have, like having the First Line Indent of a great value than the Hanging Indent (e.g. first line indent is 1 inch and hanging indent is .5 inch). Another example is customizing the size of the bullet/number Anyone know of good libaries for this for Silverlight?

Check out the ordered/unordered list controls explained in this link. You can extend its functionality to acheive what you intend to do. I have used it to show hierarchical data using nested lists and found it fairly easy to modify it to my needs.

that implementation works for read-only content only.
What if you need to apply bullets/numbering/indent to selected-text in a RichTextBox?
You have to programmatically find Paragraph elements inside selected-text and insert the corresponding character (bullet or number of tab) at the start of each Paragraph element.
Check out here for detailed explanation: http://www.codeding.com/?article=22

Related

ExtJS 4.x: How to disable the red mark BUT only in runtime

I can't find solution. I want to leave "red corner" when user update grid cell (and to remove red corner now is quite easy - in afretedit call data.record.commit()) but I don't know how to do it in runtime. I meke some loops to calculate something (sum of raw e.g.) and this value I want to write in one, special cell but WITHOUT RED MARK.
Be so kind to prompt me how.
Sorry guys, I found proper soolution. Good way is to read manual, I just commited store of this grid after described above loops:
store.commitChanges()

Bounding Box using c in opencv

I am trying to create a bounding box around each character in an image. I have converted the image to binary and thresholded it but I don't understand how to create a bounding box despite reading the manual.
There are a few options for the bounding box technique, but I think you'll get a great result combining these two:
First, use the technique demonstrated here to detect a large portion of text and put a bounding rectangle around it so you crop the image to this area;
Second, experiment with the technique recently presented by OpenCV, also demonstrated here. It could be used to locate/extract individual characters on the resulting image of the first step.
I suppose you are trying to implement the OCR mechanism yourself instead of relying on great APIs such as Tesseract.
If you are looking for more information on how to do digit/text recognition, check this answer.
As said before "rudely", I encourage you to rewrite your question with more detail on what you already did. We didn't understand what you would like to do. If character recognition is what you want, have a look at this.

Increasing the size of a WPF application

I've just created my first WPF application (3 calculators inside 3 different tabs).
The entire application has been built using widths/margins/paddings as static values, since I originally didn't know that dynamic values can be used by just putting an asterix after the value.
The client has come back to me though and has asked me to increase the size of the app, that includes form fields, tabs, font-sizes, grids etc...
What would be the easiest (and/or quickest) way to do this? I'd hate to go value by value resizing every single element since there are quite a few.
I can provide code but there is lots of it and I'm not sure of how much help it would be.
Appreciate your help,
Marko
Put it all in one ViewBox, play with viewbox size to change the app size
Write an XSLT transform to take your XAML as input and spit out appropriate modified XAML, which you put back in your app.

Silverlight 3 - Control over wrapping in TextBox

Ok I have the following problem in Silverlight. I have a control with 2 columns. On the left is a stack panel with line numbers and on the right is a textBox.
So when I write in textBox without wrapping turned on I can simply create the right count of numbers on the left, because I'm searching for '\r' in text.
But when I turn on wrapping I have no control over the count of lines in textBox.
Is there a way to get to that count? Or a way to know which line in textBox is going to wrap?
I hope you can understand what I'm trying to do.
There's one way to do this. You can simulate the word wrap operation in the background using a TextBlock. Here is a good link of the complete solution to this problem.
Extended TextBox control with MaxLines property
Is it not possible to create your items in code before they are passed to the view. This would enable you to bind a list of items to a listview and style them as you wish.
You need to user a value converter to count the number of char / lines and then trim that number if you wish to. Unless you use fixed width, you can't really count or calculte in advancet the size, since each application might be displayed differently (due to different sizing option).
There are two great sample chapters on Windows Phone and Silverlight for Windows Phone on the LearningWindosPhone.com site. There is great Windows Phone Trainng material , and dont forget the Windows Phone Develoeprs Blog
Yes there is a way to get the number of lines occupied by the text in the textbox. It's not that simple though 'coz you have to simulate the behavior of the word wrap in order to count/predict the number of lines generated as a result of a word wrap. I have the solution described here in detail.

Detect whether a font supports variants (like superscript and subscript)

WPF has the Typography.Variants attached property that lets you do superscript and subscript. However, it only works for some fonts. For other fonts, the variant is utterly ignored, and the text is shown normally. (Code sample and screenshot here)
Since it silently falls back to a no-op, I have no idea that anything went wrong; but my user will see lousy behavior.
Is there any way that I can programmatically detect whether a given font supports Typography.Variants? If so, I could provide more meaningful behavior if the user selected a non-variant-supporting font for something that needs superscripts/subscripts.
I looked at GlyphTypeface, since it's the one you use to query whether a font can be embedded, but I didn't see anything there about variants. I also didn't see anything obvious on FontFamily, and the only thing I could find on Typography was the Variants attached property itself (and its getters and setters).
As far as I can tell, WPF provides no information about the available GSUB tables (which tell you this information). Everything is hidden deep within private classes of PresentationCore.
One way would be to use the advanced text services of WPF to create a TextFormatter, and then retrieve the GlyphRuns created by a piece of text with the variants on, and one with the variants off, and then compare the glyph indexes used.
Another way would be to physically examine a font's data through GlyphTypeFace.GetFontStream(). The TrueType font format is not very complicated, so you'll probably find some information on the net on how to parse the binary font data to find information on the GSUB tables.
Note that simply asking wither a variant is supported is also a little ambiguous. A font can say it supports a variant, but nothing requires it to actually provide any meaningful substitutions. Most Adobe fonts provide only a few alphabetical lowercase characters for things like superscript and subscript (not even the entire Latin alphabet, mind you). Which is pretty useless, IMHO, since you can't ask WPF to fake subscripts or superscripts like Word and other word processors do.
Still, it would have been nice if you could simply ask TypeFace.GetSupportedOpenTypeFeatures().

Resources