[sword-devel] Sword front-ends, the clipboard and social media
David Haslam
dfhdfh at protonmail.com
Sun May 5 11:08:51 MST 2019
FYI. Here's the clipboard copy of my TextPipe filter:
The PCRE replace list filter that does the digits character conversion uses UTF-8 byte codes in the replace column.
TextPipe Single User Edition 10.7
Purchased by: David Haslam, David Haslam
Filter Title: T:\Convert\Convert numerals to Unicode superscripts.fll
Filter List
-----------
Filter options
| [X] Log to file
| [ ] Append to logfile
| Log filename: .\textpipe.log
| Threshold 500
| [X] Log comment filters
|
|--Input from file(s)
| [ ] Confirm before processing each file
| [ ] Confirm before processing read/only files
| [ ] Delete input files after processing
| [ ] Process inside compressed files
| Process binary files
|
|--Comment...
| | Convert numerals to Unicode superscripts
| |
| | Function:
| | - Input = Bible passage copied from SWORD front-end app
| | - Output = Bible passage with superscripted verse tags
| |
| | Purpose:
| | - For sharing copied Bible passage to social media, etc.
| |
| | Assumes:
| | - Verse text contains no numerals (cf. some translations do)
| | - Headings (if included) contain no numerals
| |
| +--Perl pattern [\d+$] and Send non-matching to subfilter
| | [X] Match case
| | [ ] Whole words only
| | [ ] Case sensitive replace
| | [ ] Prompt on replace
| | [ ] Skip prompt if identical
| | [ ] First only
| | [ ] Extract matches
| | Maximum text buffer size 4096
| | [X] Maximum match (greedy)
| | [ ] Allow comments
| | [ ] '.' matches newline
| | [X] UTF-8 Support
| |
| +--Perl pattern [[0-9]+] and Send to subfilter
| | [X] Match case
| | [ ] Whole words only
| | [ ] Case sensitive replace
| | [ ] Prompt on replace
| | [ ] Skip prompt if identical
| | [ ] First only
| | [ ] Extract matches
| | Maximum text buffer size 4096
| | [X] Maximum match (greedy)
| | [ ] Allow comments
| | [ ] '.' matches newline
| | [X] UTF-8 Support
| |
| +--Perl pattern [0] with [\xE2\x81\xB0]
| [X] Match case
| [ ] Whole words only
| [ ] Case sensitive replace
| [ ] Prompt on replace
| [ ] Skip prompt if identical
| [ ] First only
| [ ] Extract matches
| Maximum text buffer size 4096
| [ ] Maximum match (greedy)
| [ ] Allow comments
| [ ] '.' matches newline
| [X] UTF-8 Support
| [ ] Process longest strings first
| [ ] Simultaneous search
| [ ] Log summary only
| Further search/replace list phrases (CSV format):
| 1,\xC2\xB9
| 2,\xC2\xB2
| 3,\xC2\xB3
| 4,\xE2\x81\xB4
| 5,\xE2\x81\xB5
| 6,\xE2\x81\xB6
| 7,\xE2\x81\xB7
| 8,\xE2\x81\xB8
| 9,\xE2\x81\xB9
|
+--Output to file(s)
[ ] Only update date on changed files
[ ] Append mode
[ ] Change extension to: .txt
[ ] Open output file
Only output modified files
Test mode
[ ] Remove empty output files
Files List
----------
The only purpose in sharing this is to show how simple such a filter might be.
The real challenge is to adapt each front-end such that this modified copy is one of the share options in the UI.
IMHO, a similar filter could be easily added to our API, and then it's up to each front-end developer to choose whether or not to take advantage of it.
Best regards,
David
Sent with [ProtonMail](https://protonmail.com) Secure Email.
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Sunday, May 5, 2019 7:00 PM, David Haslam <dfhdfh at protonmail.com> wrote:
> FYI. I have just posted to [my facebook](https://www.facebook.com/david.f.haslam) an example of the result of using my filter.
>
> The passage was copied from Xiphos, which inserts two spaces before each verse tag, and one space before the start of verse text.
>
> Other front-ends such as PocketSword have no space between verse tag and verse text, as well as none before the verse tag.
>
> Exceptions are in poetry format.
>
> Best regards,
>
> David
>
> Sent with [ProtonMail](https://protonmail.com) Secure Email.
>
> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
> On Sunday, May 5, 2019 6:38 PM, David Haslam <dfhdfh at protonmail.com> wrote:
>
>> The context is that when I’m posting to (eg) Facebook, all text formatting is simply squished, even when what was pasted to the clipboard had (eg) HTML styling.
>>
>> AFAICT, only Facebook Notes permit some rudimentary text styles and layout formats.
>>
>> So the response by Michael Hart, interesting as it may be, does not really address the issue in focus.
>>
>> Best regards,
>>
>> David
>>
>> Sent from ProtonMail Mobile
>>
>> On Sun, May 5, 2019 at 18:32, Michael H <cmahte at gmail.com> wrote:
>>
>>> I like the plan to improve copy functions over plain text. However, it might be more feasible and productive to copy a (possibly simplified) html snippet to the clipboard rather than producing presentation glyphs that may or may not render in many apps where fallback fonts may or may not be available.
>>>
>>> That is, when I copy-paste a web page into Office, I have to choose whether to import the formatted html, or just the plain text. However, when I paste the same clipboard item into a simple text editor, the formatted option isn't present. A similar approach for sword front ends would fit the user expectation of a rich copy, but also be more likely to succeed in all cases.
>>>
>>> Is there already a sword front end that already has this rich copy enabled (even for a subset of the allowable markups?)
>>>
>>> (And related to the implied reason why this capability is missing:)
>>>
>>> In addition to improving the functionality of the text rendering for copy/paste, the configuration files should probably be improved to include a "copy-allowed" item (and "print-allowed" if/where applicable.) That is, be able to restrict the copy function when the license provided doesn't include even limited copying. This will help to undo the risk of pass-through copying en-mass.
>>>
>>> On Sun, May 5, 2019 at 11:00 AM David Haslam <dfhdfh at protonmail.com> wrote:
>>>
>>>> When pasting a Bible passage from the clipboard to Social media, text styles are usually squished.
>>>>
>>>> This often means that superscripted verse tags just become ordinary numbers.
>>>> Some front-ends even leave no space between the verse tag and the start of verse text.
>>>> The result in social media is a tad ugly.
>>>>
>>>> Surely we could do better?
>>>>
>>>> One bright idea implemented externally by one of our members is simple enough for us to consider adding as a new filter in the SWORD API.
>>>>
>>>> Convert verse number digits to Unicode superscript digits, ⁰¹²³⁴⁵⁶⁷⁸⁹
>>>>
>>>> NB. These special 10 characters are not in a continuous block.
>>>>
>>>> How front-ends might include the filter such that copying a passage to the clipboard would automatically make use of these special characters is yet to be determined, but if the idea is not yet discussed, we’ll not make any progress.
>>>>
>>>> Aside: I made my own TextPipe filter to convert digits to these special characters.
>>>> I included a restriction to avoid converting chapter numbers.
>>>> I did not yet consider what to do about digits that are part of verse text (such as 144,000).
>>>>
>>>> Even so, how do software developers feel about the concept ?
>>>>
>>>> Best regards,
>>>>
>>>> David
>>>>
>>>> Sent from ProtonMail Mobile
>>>> _______________________________________________
>>>> sword-devel mailing list: sword-devel at crosswire.org
>>>> http://www.crosswire.org/mailman/listinfo/sword-devel
>>>> Instructions to unsubscribe/change your settings at above page
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/sword-devel/attachments/20190505/461ae8e7/attachment-0001.html>
More information about the sword-devel
mailing list