Zero width fonts or zero fontsize

Previous topic - Next topic

michaelu

I am expanding a template many times, and then I want to have a table of content. For this purpose, I prepend each expansion with a special marker text, that encodes an ID of the data that was used for expansion. It would be nice if the font of this marker had zero width. Unfortunately, on Windows 10 you can no longer install zero width fonts, e.g. AdobeBlank (https://github.com/adobe-fonts/adobe-blank). There have been security issues with such fonts. And Scribus does not allow font sizes < 1pt, and not less than 10% horizontal scaling. I use these settings, and set additionally the colour to None. This works quite nicely, still I wonder why Scribus does not allow fontsize 0 or horizontal scaling 0.

a.l.e

i don't think that you will be able to create a table of contents from python (if your text is in chained text frames).

but you're welcome to join my effort to create a real table of contents for scribus...

adapting the existing code for creating a table of contents that suits your needs should probably be rather easy.

ping me if you're interested in an introduction in the TOC code.

michaelu

I am producing a toc, but not in the Scribus sense, with annotations. I go through all pages, through all textframes, get the text with getText, that returns only the text of this textframe. This works also for linked frames, as opposed to getAllText, that returns on each linked textframe the concatenated text of all textframes before and after this frame. Now I can search in the text of this page for something I like to appear in the toc, and I know the page number too.
But then I have a special case: I do not want some piece of text, like a header1, to appear in the toc, but some text I derive from the dataset that produced the text. Therefore I "hide" an id of the dataset with 1 point font, no colour, in the text, and have a special button, that deletes the ids when the toc is finished. Before the ids are removed, you can only see that there is some little space where the id is hidden, but with a zero width font this little space would go away completely.
From the id I retrieve the dataset, produce some text from the dataset, and put it together with the page number into a new textframe, that then becomes the toc.
I still wonder why Scribus stops at 1 point and 10% horizontal scaling.
Btw: I just watched a tutorial from Affinity Publisher. There, they use styles for the toc. Each text with a selectable style, e.g. header1 or header2, is put into the toc.

a.l.e

the goal is to have a style based toc in scribus too...