I need to insert the ® character as a superscript into the title bar of an app for the iPad. How can this be done in XCode?
As of iOS 5.x, you can't set text attributes like bold, superscript, etc. on individual characters within a label's text. (This includes the builtin labels of navigation bars.)
You can just insert the ® character in your string (you can type it on a US Mac keyboard with option-R, or use the escape code as in Jessedc's answer). Whether it appears small and superscript depends on the font used for the label -- some fonts make that symbol appear as such already, others make it larger and baseline-aligned.
Grab the unicode character
put it in a string
NSString *string = #"\u00AE"; //this is your (r)
Nearly a duplicate of How do I escape a Unicode character in my Objective-C source code?
Related
If I set the text of the Button whose font is FontAwesome to something like "Download" - it interprets 'down' as an font from FA as well as 'ad'
e.g. Open = it'll display O and then a pen icon from FA.
Very weird - how can I stop this.
I'd like the button text to contain both FA icons (specified with unicode escape codes) and regular text.
I haven't used FontAwesome recently, I recall they use to denote icons by character code so there were no issues in combining text along with icons, not sure if that's changed now.
As a workaround you can use formattedText instead of text. You will be able to use different fonts within Button with 2 different FormattedString definitions, one for icon and another for text.
I want to add TM symbol as a superscript to button text. Like "DemoTM" text and TM should be superscript of Demo text.
Any Solution would be great help.
Thanks
The Unicode superscript trademark is U2122 so
Button.Caption = "Demo" & ChrW$(&H2122)
You must obviously use a font that contains this glyph, for example MS Sans Serif does not, Segoe UI does.
No need to do this at run time.
Choose a Command button font that supports this symbol. Then in the Properties pane you can directly paste Demo™ for the Caption property's value.
If need be you can copy the character from the Character Map applet.
You can also paste this value into a source String literal if you want to do it at run time:
Command1.Caption = "Demo™"
No need for further gyrations.
I want the user to have easy access to Emoji icons in a small chat I am making for the company I'm working at.
Therefore, I want to make a panel which shows the available Emoji icons. To do this, I am using an NSCollectionView. Now, I need to pass a string which is shown in an NSTextField. This string must contain one Emoji icon.
I can't figure out how to write this Emoji icon in unicode in a string. Everything I have tried just shows a strange symbol instead of the icon.
Can anyone tell me, how I can put an Emoji icon into an NSString?
📱 You want emoji 😄?
🐷🐻🐨🐸 They're in Unicode now 🐸🐨🐻🐷
If you open up the 💻Character Viewer💻 you can actually paste them directly into your source code. If you'd rather, you can encode them in hexadecimal (\U0001F431 for cat face) by looking them up in the Unicode code charts (especially the chart for the U+1F300 block).
If you want to make sure they appear in color, you'll need to select the "Apple Color Emoji" font for the Emoji. You can use NSAttributedString to set the font on a per-character basis.
I get some text string from service, which contains Unicode control characters
(i.e \u202B or \u202A and others for Arabic language support).
But while debugging I can't see them in default text visualizer. So I need to enable display for such characters to determine which of them my text consists of. There is checkbox in text visualizer "show all characters", but it doesn't work as I expect.
Any suggestions?
Thanks in advance
Those are codes for explicit RLE and LRE order, ie if in RLE something should be displayed in LRE order.
http://unicode.org/reports/tr9/#Directional_Formatting_Codes
I can use VIM to input these color control chars by "Ctrl-V, Esc" then it will show me ^[ as a special leading char for color control chars sequence.
How could I do this in Textmate?
Thanks
You can select those from the character viewer (Menu Edit -> Special Characters, then search for 'escape'), but I think you'd be better off using an escaped form of that character, e.g. \033 in Bash or \x1b in PHP. That, of course, would depend on what kind of document you're editing.