Re: VoiceOver and text attachments
Re: VoiceOver and text attachments
- Subject: Re: VoiceOver and text attachments
- From: Charlie Powell <email@hidden>
- Date: Thu, 29 Sep 2016 15:13:06 +0000
- Thread-topic: VoiceOver and text attachments
I would also love to see a generic attribute added to the list the VoiceOver supports so that apps could add whatever attributes they wanted. That requires more localization on the part of the app, but at least we wouldn’t be blocked by the API.
Tim, your approach of using a text attachment should work, though I’d be curious what users would actually think of that experience. I’ve had mild success using text attachments in my app previously, but for actual inline objects as opposed to attributes like this. Here’s how I’ve been able to get it to work, maybe it helps:
1. Ensure that the string contains the Unicode object replacement character (0xFFFC) where you want the attachment to be read by VoiceOver
2. Apply the NSAccessibilityAttachmentTextAttribute to the range of the string for *just* that object replacement character
3. The value of the attribute should be an accessibility element that lives as a child of the element containing the text being read by VO
a. You may also need to set this child element’s subrole to NSAccessibilityTextAttachmentSubrole
4. Set the label of this child element to be what you want VO to read
Then when you navigate to the part of the text containing the object replacement character, VO should read the label you set in step 4. I’ve seen rumbling where supposedly you should be able to just give an NSData object as the value for the attribute, but I’ve never actually experimented with that.
--Charlie
----------------------------------------------------------------------
Message: 1
Date: Wed, 28 Sep 2016 16:22:13 +0100
From: Tim Burgess <email@hidden>
To: Apple <email@hidden>
Subject: VoiceOver and text attachments
Message-ID: <email@hidden>
Content-Type: text/plain; charset=utf-8
Hi,
I was hoping to use custom attributes with an NSMutableAttributedString to provide additional formatting information to VoiceOver users of our application. However, responses on this list indicated that VoiceOver’s support for attributed text was limited to those attributes defined in NSAccessibilityConstants.h. This information allowed me to provide spoken attribute information for the supported attributes, but this is not sufficient for our needs. I tried to work around the issue by using a text attachment and encoding a UTF8 string within an NSData structure as the attachment. However, VoiceOver failed to announce the attachment contents, presumably because it has no mechanism to understand how to unpack the NSData. Our application is a Braille translation package, so we need to support a large number of styles that do not exist in “normal” text
. Can anybody suggest an alternative approach that could expand what I can report back from an NSAttributedString? I considered setting the accessibilityHelp property to
the value of a custom attribute, but this feels rather ugly and may fall foul of VoiceOver preferences set by the user.
Best wishes.
Tim Burgess
------------------------------
Message: 2
Date: Wed, 28 Sep 2016 11:43:40 -0400
From: Bill Cheeseman <email@hidden>
To: accessibility-dev <email@hidden>
Subject: Re: VoiceOver and text attachments
Message-ID: <email@hidden>
Content-Type: text/plain; charset="utf-8"
> On Sep 28, 2016, at 11:22 AM, Tim Burgess <email@hidden <mailto:email@hidden>> wrote:
> I was hoping to use custom attributes with an NSMutableAttributedString to provide additional formatting information to VoiceOver users of our application. However, responses on this list indicated that VoiceOver’s support for attributed text was limited to those attributes defined in NSAccessibilityConstants.h. This information allowed me to provide spoken attribute information for the supported attributes, but this is not sufficient for our needs. I tried to work around the issue by using a text attachment and encoding a UTF8 string within an NSData structure as the attachment. However, VoiceOver failed to announce the attachment contents, presumably because it has no mechanism to understand how to unpack the NSData. Our application is a Braille translation package, so we need to support a large number of styles that do not exist in “normal” text
My PFAssistive framework <https://na01.safelinks.protection.outlook.com/?url=http://pfiddlesoft.com/frameworks&data=01|01|email@hidden|0119e675aa554032d08308d3e7d1ab7e|72f988bf86f141af91ab2d7cd011db47|1&sdata=xfmM54Bwpuz4t66dWO/Box4qJdPEtVWD3yhYtgYZLAI=&reserved=0 <https://na01.safelinks.protection.outlook.com/?url=http://pfiddlesoft.com/frameworks&data=01|01|email@hidden|0119e675aa554032d08308d3e7d1ab7e|72f988bf86f141af91ab2d7cd011db47|1&sdata=xfmM54Bwpuz4t66dWO/Box4qJdPEtVWD3yhYtgYZLAI=&reserved=0>> contains some methods that translate between accessibility attributed string attributes and standard Cocoa attributed string attributes. This isn't what you're looking for, exactly, but you could look at the headers and documentation, and they might give you some ideas.
--
Bill Cheeseman - email@hidden <mailto:email@hidden>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Accessibility-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden