问题
I have to create a custom keyboard which support American Sign Language. For that I have to convert English language keyboard's keys symbols to American Sign language hand symbols keys. So how to translate (English Alphabets) to ASL- (Hand Sign) on iOS Keyboard.
Look This: How to simulate a sign language keyboard in IOS?
We have to do opposite of this. i.e Hand Signs on Keyboard. And when user press hand sign keys alphabets it's respected alphabet will show up in text editor.
Hint: Sign Language support fonts. And i am using "Gallaudet-Regular" font to draw hand symbols on keyboard key. But not able to do the same.
Note- Below is the code for creating the custom keyboard extension in iOS. When you use the below code, it will create a keyboard button with Hand Symbol on key but when i use to tap the keyboard key it gives 'a' as text but i want hand symbol when i tap.
Code: Step 1: // Creating a custom button
self.testingButton = UIButton.buttonWithType(.System) as UIButton
self.testingButton.setTitle(NSLocalizedString("a", comment: "Title for 'First Keyboard' button"), forState: .Normal)
self.testingButton.sizeToFit()
self.testingButton.titleLabel?.font = UIFont(name: "Gallaudet-Regular", size: 50)
self.testingButton.backgroundColor = UIColor.redColor()
self.testingButton.setTranslatesAutoresizingMaskIntoConstraints(false)
self.testingButton.addTarget(self, action: "tapKeyboardButton:", forControlEvents: .TouchUpInside)
self.view.addSubview(self.testingButton)
Step 2: // Performing action on button selector
func tapKeyboardButton(sender:UIButton) {
let title = sender.titleForState(UIControlState.Normal)
var proxy = textDocumentProxy as UITextDocumentProxy
proxy.insertText(title!)
}
I want button title to be a hand sign in text editor.
回答1:
You should try to install http://www.lifeprint.com/asl101/pages-layout/gallaudettruetypefont.htm font and change the font settings to Gallaudettruetype
font. This should resolve the problem.
Although I'm not an iOS developer but can help you in understanding the logic
Update:
If you can install that font in your device(iPhone, iPad) then you should be able to change the input type too(keyboard). This would completely resolve your problem. I'm not sure how would you do this but this should be the logic and you should go ahead in this direction.
来源:https://stackoverflow.com/questions/28695240/how-to-show-american-sign-language-hand-signs-on-ios-keyboard-keys