I've tried entering the small pointing right triangle and the right arrow characters, both are converted by iOS into rectangular icons with a right triangle and a right arrow, respectively. Can I declare a different font to stop this from happening? Or is there a default setting I need to turn off?
All a want is a black small pointing right triangle:
Decimal Hex
▸ 9656 ▸ 25B8
Here is the Code:
NSString *title = [NSString stringWithFormat:@"%d payments of %@ ➡ ▶", duration, [Utils formatPrice:payment]];
[button setTitle: title forState: UIControlStateNormal];
Any suggestions would be appreciated.
This is not about changing font, but about unicode variation. On Unicode 6.1, one unicode code point can have multiple glyphs, and you can choose those using Variation Selectors.
For about emoji, you can use U+FE0E(@"\U0000FE0E") to choose text style graph. (And, U+FE0F(@"\U0000FE0F") is for Apple Color Emoji).
For example, LEFT-POINTING TRIANGLE's unicode code point is U+25C0(@"\U000025C0"), and you can specify not to use Apple Color Emoji but non-color symbol like @"\U000025C0\U0000FE0E".
Also, there is some difference between iOS emulator(for iOS6 on Mountain Lion) and actual device(iOS6) about Variation Selector handling, probably because Mountain Lion have more support for Unicode 6.1, I guess.
For example, if I don't specify the selectors, I see non-color triangle on iOS6 device, but Apple Color triangle on iOS6 simulator(on Mountain Lion), for UIBarButton.
So, it is nice to check both simulator and actual device, but it looks more safe to use Unicode Variation Selectors always anyway.
It was kind of challenging to force the Browser to render the HTML Entity on iPads/iPhones, but I managed to find the solution, and here's the trick.
Instead of using HTML entities directly:
◀ <!-- ◀ BLACK LEFT-POINTING TRIANGLE -->
▶ <!-- ▶ BLACK RIGHT-POINTING TRIANGLE -->
I created supportive elements in HTML, with the classes:
<span class="left-pointing-triangle"> </span>
<span class="right-pointing-triangle"> </span>
With the use of CSS ::after pseudo-element made the override of the content:
.left-pointing-triangle::after {
content: "\25C0 \FE0E";
}
.right-pointing-triangle::after {
content: "\25B6 \FE0E";
}
The important part is to use content: "\25C0 \FE0E"
, instead of just symbol itself content: "\25C0"
. It works flawlessly on both iPads and iPhones of different iOS versions.
I use these unicode characters to stop iOS from fiddling:
Right-triangle: ► (►)
Left-triangle: ◄ (◄)
If further triangles are what you seek:
Up-triangle: ▲ (▲)
Down-triangle: ▼ (▼)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With