.Net Reflector Red and green squares - disassembly

What are the green and red squares? Are these variable names and strings being obfuscated purposely? Is there a 'deobfuscator'?

At a glance I would say it's unicode characters which don't have a printable representation

What you are seeing is probably the result of an obfuscator. The characters are appearing as boxes because the font you are using in Reflector does not have a glyph for the character being shown.
I think Dotfuscator does this type of obfuscation. You can check by looking at the attributes of the assembly for a Dotfuscator attribute.

Related

Is there some standards for character bitmaps?

I have tried to solve this graphical character problem several days.
I use AVR chip and st7789 240x240 tft screen. And I dont want use the comprehensive Adafruit-GFX library or similar functionality, the font constants are still welcome. I use C.
I found the ASCII organized font from:
https://courses.cs.washington.edu/courses/cse457/98a/tech/OpenGL/font.c
The problem is the character sizing, its 7x13 and it is too small.
- If I will try e.g double the size, the accuracy and the character aspect ratio is not good.
- I have tried to find some resources about the sizing kind of this simple character bitmaps, but find not any.
I read some resources the notation as adafruit-GFX font oranizations can fit more flexible sizes.
- But the problem is the usage of those font resources when it includes Bitmaps and Glyphs in different arrays.
For example: https://github.com/adafruit/Adafruit-GFX-Library/blob/master/Fonts/FreeMonoBold24pt7b.h
If you have more skills to handling graphical fonts, would you give me tips or resources?
the best option is: write your own char display function. Then you will not tight to the adafruit fonts.
Then you can generate the font you want https://www.angelcode.com/products/bmfont/

Best framework for new application which handle text(fonts,characters)

I need to create application, using which user can handle text in graphical interface.
User can move text objects inside parent panel/canvas or something, change fonts, change size of characters (height, width), spacing between characters and so on.
Target of application:
in the end of handling text (or while handling) user will get a position of every character, height and width of characters, distance between characters (spacing). And all those measures must be in same unit of measure (pixels, points).
So question is: What kind of framework (.NET, Silverlight, XNA, Flash, Java, HTML 5, Javascript and so on) can be used for this.
I am “sold my soul” to Microsoft (worked before only with .NET), but have some experience in Flash, HTML, Javascript, Java. So all proposals are welcome
Trying to approach with Silverlight, but only problem was with spacing (dynamically change), when trying used Glyphs it worked in some way,
only problem was: when with Glyphs spacing was changed(same for all characters), in visual spacing was different for all characters. So spacing problem is biggest for right now.
Another approach can be a handle text as a collection of characters, and calculate by myself distance between characters. But in application every user can use own custom fonts (here my knowledge not enough). So i afraid that we will need to create (draw) every character of font before can use custom fonts.
I found in Internet some applications which doing almost same thing (done in Javascript), but before start want to get more information about other possibilities.
With nobody give some advices about this,I decide to answer own question, because found already a solution how will approach to this project.
So I found a new(for me at least) version of Silverlight hav a new Property CharachterSpacing for Elements which handling with text(TextBox, Label and so on). Using this property I can change dynamically a text spacing.
Documents tell us that this property use as a unit integer which is 1000s of font's em unit. About em:
"Em size is a typographical measure that specifies the approximate width of the capital letter "M" in the Roman alphabet, measured in the units that are prevalent in a particular technology. Silverlight em sizes are given in pixels. The apparent visual size of the em size varies per font.”
So this give a very good basement for counting a real distance between charachters.

How to highlight portion of a Rich TextBox WPF control if there are more than 2 spaces?

I have a richtextbox control in my WPF 4.0 application. Now suppose I have a text like
"hello how [space][space] r u? [space][space] I am fine"
As can be noticed that there are two gaps between how and r as well as between ? and I.
When this will happen then the portion will be highlighted with green e.g. how ..r and from ? to I will be highlighted with green color.
i.e. if the space between two words are more than 2 then that will be highlighted with green.
Is it possible to do in WPF RichTextbox control? If so, please help me in writing so. As of now what I have done is that I have only able to find out the distance of spaces between two words.
Note:~ [Space] means the white spaces. Since the gap was not prominent(as it was not coming in the editor), that's the reason I made it like so.
Thanks
WPF4.0/ C#4.0
http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/7c9a622a-4e3b-451e-bc4c-ab9d011447e0
Here is a progressive scenario featuring RichTextBox highlighting multiple ranges, it may lead you on the right path.
He ends up getting it to work, but you will have to modify it to recognize white space perhaps.

Symbols, Special character display issue in wpf

In WPF text block, I want to display special characters like diamond (♦) etc. It is displaying fine in some systems and in some systems, it is displaying a plain box instead of the symbol.
Can somebody help me to resolve this issue.
Thanks in Advance.
-Elangovan.
When you want "special characters" you should probably use images instead of depending on fonts. For one thing, you have no guarantee that the user will have the font you use.

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