AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Scribus paragraph styles8/20/2023 In this case, the variables mdash and ndash have been previously assigned the appropriate Unicode characters. You can find the en+emdash.py script on its wiki page. Here is the pertinent assignment strategy: if (char = '-'): Like with typographic quotes, a utility to automatically convert hyphens to en and em dashes would be useful. Many Scribus users compose their text in a text editor outside of Scribus, then import it into a text frame in the Scribus document. These are different from hyphens (-), but are sometimes denoted by two or three hyphens typed together. Many publications specify the use of en (–) and em (-) dashes in their style guide. This also shows how the replaced text tends to take up more space. As you can see, only the alphabetic characters are converted, and occasionally randomization results in the same character, as expected. The top paragraph is the original text, just some sample English text from Scribus, and below is the result after running replacetext.py. In practice, a user could delete characters when necessary for the layout appearance. In practical use, one side effect is that text tends to take up more space, which I presume relates to an increase in the number of wider glyphs than is usual in English. Only a-z and A-Z characters are affected, not numbers and not those outside of ASCII territory (although it wouldn't be hard to extend this).īecause of the randomization function, there is no way to reverse the process, but I still wanted to retain the rough appearance of text with capitalizations and word spacing intact. ![]() This random integer simultaneously creates a random lower case and upper case letter. Then the script tests the original text character to determine whether it's a lower or upper case letter so it can make the appropriate substitution (i.e., to preserve the original character's case). If ((ord(char)>96)and(ord(char)64)and(ord(char)<91)):įor each newly parsed character, a random integer between 1 and 26 is generated. I chose to do this scrambling as follows: alpha = random.randint(1,26) ![]() ![]() The original one operated only on a selected text frame, but then there came a version that converted all text frames on regular pages, another for all text frames including those on master pages, and another version that worked only on the current page of the document. I called the end result replacetext.py, and I eventually ended up with four different versions, as you can see on the wiki page. It seemed to me that the basic parsing section from Autoquote would serve this purpose well. The idea was not to encrypt the document, but simply turn the text into gibberish. The person wanted to post a Scribus document to show a layout, yet hide the text contents of the frames. eBook: An introduction to programming with BashĪfter I created this Autoquote script, someone asked me if I could write one that scrambles the text in a document.Try for free: Red Hat Learning Subscription.
0 Comments
Read More
Leave a Reply. |