[scribus] Script for (french) thin typographic spaces

ZASKE Martin zm at revue-gugu.org
Tue Jun 2 16:19:55 UTC 2020


I totally see the need. End of April I wrote a hack, because the thin
non-breaking space is too clunky for my taste in many fonts. We need
this for French and for one African language.

This is just a hack to avoid doing all that click-work manually. It is
not automagic and needs proof-reading afterwards to catch where targets
have jumped at the end of a line or where other bad side-effects have
happened. Also I only do this to documents, where I know from the
work-flow that nobody else has already done any "treatment" for the
punctuation-spacing.




My hack is simulating the "manual tracking" of Scribus, as offered
normally in Text Properties > Advanced Settings. We shift the target
characters by tiny amounts away from the last word-forming character.

I did not find a handle for this in the Scribus Scripter API (but then
it was probably because I am rather a beginner in scripting Scribus).

So I run a regex over a closed Scribus .sla file, because this was the
least painful to write and gave me some help towards what I needed.

There is lookaround so I only treat text inside what Scribus considers
<StoryText>.

I do not need to run the regex manually, I use a commercial power editor
to do that for me. Much better than manually clicking through entire
documents in Scribus. And I get immediate visual highlighting for all
"hits" at once - if I wish - so if I ever hit some "special text" where
an author had fun typing rows of :::::::: or whatever, then I would be
visually alerted.




My regex might look like this, for search for simple documents:


(?<=<StoryText>.*) (!|\?|:|;)(?=.*</StoryText>)


And would then use this for replace:


"/>
                <ITEXT KERN="7" CH="${1}"/>
                <ITEXT CH="


Please do not just copy this to your setup, this is syntax which works
in my context with my tools. Just to share how crude a hack this is. And
still it saved me a lot of work already.


I remember writing some notes to myself that day and now cannot find
them. (So your question JLuc comes just at the right time. My explorer
is presently searching through all my work from that day in April.)

JLuc, please keep us posted on your progress, I am cheering for you. Thanks.


Martin



On 02.06.2020 12:33, JLuc wrote:
> Has somebody writtend a script to add thin typographic spaces where
> required for french ?
> 
> (Before and/or after » « : ; ! etc)
> 
> I've been planning to write a rough version of such a script someday
> (adapting the autoquote2 script)
> but it'd be great when it exists allready.
> 
> JLuc
> 
> 
> 
> ___
> Scribus Mailing List: scribus at lists.scribus.net
> Edit your options or unsubscribe:
> http://lists.scribus.net/mailman/listinfo/scribus
> See also:
> http://wiki.scribus.net
> http://forums.scribus.net


-- 
ZASKE Martin
responsable GʊGʊ
BP 50 - Bassila - Bénin
tel GʊGʊ 66.66.11.11
tel pers 97.44.62.95



More information about the scribus mailing list