I'm attempting to render content both in a UILabel as well as in a WKWebView containing Urdu text. For display Noto Nastalique is used. However, it seems iOS has issues computing the correct spacing/ligature.
Using text from http://behdad.org/urdu/ as a test subject UILabel renders
while WKWebView renders (notice the glyphs overlapping)
In this small example the problems are most obvious in WebKit, but there are similar issues when wrapping text in UILabel. I'm hoping someone has faced and solved similar issues, or could point to information on best-practices for displaying Urdu content.
Example project can be found on github
I believe it is a problem with "Google Noto Nastaleeq" font on iPhone. Apple did try to implement in iOS 9. They had the similar problem.
Have you try to implement Jamil Noori Nastaleeq? Read my guide there I noticed Jamil Noori Nastleeq typeface don't have that kind of rendering issue.
For a reference please read my article that how I was able to make it so. https://medium.com/#mmudassir/nastleeq-and-ios-8-love-story-bit-broken-7cc2311fc784?source=linkShare-563fcf255dda-1461862616
Related
I would like to highlight a part of text in a UITextView like Pages for iOS or Safari for iOS do. I search the documentation but I can't find a way to do it, maybe because I'm a beginner in iOS development and I miss some crucial info. Somebody can help me?
Screenshot of Pages for iOS:
Screenshot of Safari for iOS:
If you only need to highlight a single, contiguous block of text you can set the selection programmatically. Your examples show multiple discontinuous parts however. For that you are going to need to use an attributed string. There is no other system-provided highlighting function. (There might be a third party library that offers this though - you'll have to search.)
I am looking to create an emoji keyboard, which works similar to the native one on iPhone.
Currently all apps that provide a keyboard, do not let you insert an emoji inline with the text.. rather they provide you the ability to 'paste' it in like an image.
In addition to this, if an emoji is sent to a user that doesnt have the app installed, will they see the 'emoji' or will it display as a bunch of random characters?
I was hoping someone could point me in the right direction, as I cannot find the detail I am looking for.
Thanks
As for creating custom keyboards, you should get started by reading Apple's official documentation on the subject.
To answer your question about displaying Emoji: Any platform that supports Emoji will see them as an Emoji. A good source to see which platforms support it is CanIEmoji.com. Any other platforms will likely display it as an empty square, since it is not a supported character.
Any custom emoji keyboard you create will show up like a picture attachment, iOS especially doesn't allow custom inline emojis. Check out these two articles they might help with even more info:
https://www.bluecloudsolutions.com/blog/emoji-apps/
https://medium.com/#mantia/so-you-want-to-build-an-emoji-keyboard-26450ba5136a
One of the most common problem faced by iOS developers is to change the font of all the UI elements in one go.
With the introduction of UIAppearance Protocol setting the font did become very convenient, since then I've been using appearance to achieve this.
I was going through this tutorial trying to understand Text Kit introduced in iOS 7. The tutorial uses subclass of NSTextStorage to beautifully format the text.
Now I was just wondering if it is possible to change the font of UI elements by subclassing the NSTextStorage. I spend few hours trying to figure out where to start from but couldn't achieve anything so far. I appreciate if any one can give me a hint to where to start from and some tips to get this done.
I welcome all your suggestions and views on this.
I'm working on an iOS app in which I need to implement a basic text view with these requirements:
Rich text
Font emphasis (bold, italics).
Inline images for hyperlink-like actions.
Scrolling
Getting and setting the scroll offset (for remembering the previous scroll position).
Text selection
Getting the selected text character range.
Scrolling the view when selecting text, if needed.
I believe I could achieve this with UIWebView but the problem with this is that it provides very little control and is somewhat slow and shows a blank screen while loading. I was wondering if this could be achieved with Core Text but regarding the text selection I'm not sure. I'm hoping to achieve as iOS-native behaviour as possible.
What I'd need is pretty much like Instapaper's text view.
OmniGroup have done something like this by creating a text editor much like UITextView which draws the text using Core Text but also has all the editing features of UITextView as well as Rich text features from Core Text.
You can find it here.
There are some answers about this in StackOverflow, for example: Core text tutorial
However the best tutorial I ever read about Core Text in iOS is not listed in any answer I've found: How to create a simple magazine app with core text
Please notice that CoreText is only available for iOS 3.2 or superior.
Working on an app that needs to take a large amount of text, paginate it based on user selected font size, etc., and display it with styles. Getting UIWebView to paginate a document has proven extremely troublesome. I have seen a wrapper for Core Text that apparently, takes care of layout, but my understanding is that core text cannot be selected.
Looking to do something similar to the books available through the app "eReader", or the app made for the book "The Adderall Diaries". Anyone know how they accomplished this? I had assumed it was UIWebView.
Normally I'd say using UILabel with NSAttributedString, however since you also need to select text, things get a bit more complicated. Head over to the Apple Dev Forums and check out the changes in iOS 6 to attributed strings (it's under NDA).