View Issue Details

IDProjectCategoryView StatusLast Update
0016380ScribusScripterpublic2020-12-10 22:23
ReporterJLuc Assigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
Status newResolutionopen 
PlatformLinuxOSUbuntu OS Version20.10
Product Version 
Target VersionFixed in Version 
Summary0016380: Merge new version of autoquotes
Descriptionautoquote2 has been improved and should be merged int

It now behaves more smartly, specialy for french. It manages various sorts of quotes and guillemets. It recognises urls, that include ":" but should not be altered by spaces.

As a consequence, it requires more options to be set first. In the uploaded version of the script, all variables have been set by editing the source, so as to fit my workflow (which is fit for french langage, hyphenation, narrow non breaking spaces...).

In case the user wants to change these options s-he has to edit the file and
- either change do_ask to True : in such a case, a dialog will popup and ask for all variable settings. But all these dialogs are tiedous in everyday life so i dont think it's the good way to use that script.
- or edit the file so as to change every variable's value according to his choices. Comments make this easy. Setting these userpleasing defaults options in the code makes the script easy to use for every langage and usecase.


==============================
Included documentation :

FEATURES
# - replaces " with « and » as required
# - warns when « and » dont match or for other such issues
# - adds choosen spaces after « and before »
# - applies some heuristics (some would call that AI) to best deal with ' and "
# - replace multiple following spaces with just one
# - when langages is french, does more typography job :
# - - replaces or adds the choosen space before ! ? ; : and …
# - - doesnt mess urls = doesnt change http://scribus.net
# - - only adds one choosen space before a set of double signs as !!!?!
# - provides a just-go-ahead-dont-ask-for-options mode for geeks : juste change do_ask value to False in script

LIMITS
# - recognizes urls with "p:/" or "ww." patterns (=> possible false positive)
# - same choosen space for « » ; ! ; : …
# - space is added or replaced with absolutely no local-font awareness
# - only manages selected frame and doesnt follow links accross linked text frames <-- PR wanted

INPUTS
# - choose a text frame, launch script
# - choose langage
# - choose sort of space to add for typography : default is thin nonbreakable space.
# - choose whether existing spaces should be replaced or not
# - choose whether set of spaces should be merged into one

====================================
Choosen default values for the options in the uploaded version of the script are :

- lang='fr'

- space_character=non_breaking_thin_space
# possible choices are non_breaking_space, non_breaking_thin_space, thin_space"

- space_len=1
# in case specified_character is more than one char long

- replace_existing=True
# also apply typo space choice to existing spaces

- merge_spaces=True
# avoid multiple spaces sequences

- do_hyphenate=True
# apply scribus hyphenation on text

- with_feedback=False
# should script display number of changes done ? No

 - do_ask=False
# script does not open any dialog but use default values
# When do_ask=True, 2 of the default values are different :
# * do_hyphenate=False
# * with_feedback=True

TagsNo tags attached.
PatchNo

Activities

JLuc

2020-12-07 19:40

developer  

²_autotypo.py (17,419 bytes)

jghali

2020-12-07 20:18

administrator   ~0048535

Question: has this script been tested with latest 1.5.6.1 and Python 3? Asking because there has been a few behavior changes in scripting related to text handling

JLuc

2020-12-08 08:39

developer   ~0048538

Last edited: 2020-12-08 08:40

View 2 revisions

I've been using it for several months now and I've only used it a couple of time with the new scribus 1.5.6.1 running python 3.6.9 and until now everything has been OK.

I've added more documentation on features and possible settings in the report.

JLuc

2020-12-10 22:23

developer   ~0048544

Updated report.

Issue History

Date Modified Username Field Change
2020-12-07 19:40 JLuc New Issue
2020-12-07 19:40 JLuc File Added: ²_autotypo.py
2020-12-07 20:18 jghali Note Added: 0048535
2020-12-07 21:15 JLuc Description Updated View Revisions
2020-12-07 21:27 JLuc Description Updated View Revisions
2020-12-07 21:29 JLuc Description Updated View Revisions
2020-12-07 21:30 JLuc Description Updated View Revisions
2020-12-07 21:31 JLuc Description Updated View Revisions
2020-12-07 21:32 JLuc Description Updated View Revisions
2020-12-08 08:39 JLuc Note Added: 0048538
2020-12-08 08:40 JLuc Note Edited: 0048538 View Revisions
2020-12-08 08:42 JLuc Description Updated View Revisions
2020-12-08 08:46 JLuc Description Updated View Revisions
2020-12-10 22:23 JLuc Description Updated View Revisions
2020-12-10 22:23 JLuc Note Added: 0048544