Using the Text Filter: Difference between revisions

From Scribus Wiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 6: Line 6:
|}
|}


Coming here soon --[[User:Tsoots|Tsoots]] 18:16, 9 Feb 2005 (UTC)
=Introduction=
 
Creating a document with a consistent look can be made easy at least what comes to the text formatting. Secrets are document templates, paragraph styles, text filters and article submitters who don't mind some extra work for public good.
 
=How it works=
 
For your articles create some paragraph styles with describing names. I've here created three which I'm going to use with my articles at least in the next three issues of Tsoots' digest.
 
[[Image:01creating_pstyles.png]]
 
 
After creating all desired paragraph styles I'll save the document as a template so these styles will be there when ever I get more articles from busy writers. File->Save as Template...
It's now guaranteed that my work will have a consistent look between issues cause this is the only template I'm gonna use when making them.
 
 
[[Image:02creating_doc_template.png]]
 
For the first issue I don't have text filter created so that's the next thing to do. Create a text frame and from context menu choose Get Text... You'll get a dialog that will look about this. Notice the red dot. That's the drop down box from where I pick "Text Filters" before hitting ok.
 
 
[[Image:03file_dialog.png]]
 
 
Text filters are simple text filters that can be used to filter text :) It's also possible to apply paragraph styles to paragraphs based on different rules. What I've been thinkin is that writers should prepend every paragraph they make with \P1 and \P2 (P1 for the first paragraphs without indent) and headers with \H1. Once the text filter is created be sure to give it a name to the bottom left largish text field so it will be available whenever you get the next article for laying out.
 
 
 
[[Image:04text_filter.png]]
 
 
And here's how the format for the text file looks like. Notice the red spots again. That's how I want my writers to prepend headers and paragraphs.
 
 
 
[[Image:05article_text.png]]
 
OK, that's about it. Here's what I do when i next time get an article from a writer.
 
* Launch scribus and goto New From Template from where I pick my article doc template which will include the paragraph styles needed
 
[[Image:06nft.png]]
 
* Draw a text frame to the page
 
* use Get Text... from the context menu and from the file dialog that opens I'll choose Text Filters as my importer (of course I'll also select the file where the article is)
 
* Now after Text Filter dialog has opened up I'll choose my saved filter that I called "Article Style" and press ok and the text will be nicely formatted just like I wanted.
 
[[Image:07imported_article.png]]
 
=Final word=
 
Scribus has a simple to use C++ api for building formatted text importers. Text Filter plugin has also been built using it. If you are interested in coding such a plugin please visit page [http://docs.scribus.net/index.php?lang=en&sm=gettexthowto&page=gettexthowto Get Text How-to]
 
--[[User:Tsoots|Tsoots]] 18:16, 9 Feb 2005 (UTC)

Revision as of 19:09, 9 February 2005

This article is part of the HOWTOs series.
Installation Usage PDF issues Other

Introduction

Creating a document with a consistent look can be made easy at least what comes to the text formatting. Secrets are document templates, paragraph styles, text filters and article submitters who don't mind some extra work for public good.

How it works

For your articles create some paragraph styles with describing names. I've here created three which I'm going to use with my articles at least in the next three issues of Tsoots' digest.

01creating pstyles.png


After creating all desired paragraph styles I'll save the document as a template so these styles will be there when ever I get more articles from busy writers. File->Save as Template... It's now guaranteed that my work will have a consistent look between issues cause this is the only template I'm gonna use when making them.


02creating doc template.png

For the first issue I don't have text filter created so that's the next thing to do. Create a text frame and from context menu choose Get Text... You'll get a dialog that will look about this. Notice the red dot. That's the drop down box from where I pick "Text Filters" before hitting ok.


03file dialog.png


Text filters are simple text filters that can be used to filter text :) It's also possible to apply paragraph styles to paragraphs based on different rules. What I've been thinkin is that writers should prepend every paragraph they make with \P1 and \P2 (P1 for the first paragraphs without indent) and headers with \H1. Once the text filter is created be sure to give it a name to the bottom left largish text field so it will be available whenever you get the next article for laying out.


04text filter.png


And here's how the format for the text file looks like. Notice the red spots again. That's how I want my writers to prepend headers and paragraphs.


05article text.png

OK, that's about it. Here's what I do when i next time get an article from a writer.

  • Launch scribus and goto New From Template from where I pick my article doc template which will include the paragraph styles needed

06nft.png

  • Draw a text frame to the page
  • use Get Text... from the context menu and from the file dialog that opens I'll choose Text Filters as my importer (of course I'll also select the file where the article is)
  • Now after Text Filter dialog has opened up I'll choose my saved filter that I called "Article Style" and press ok and the text will be nicely formatted just like I wanted.

07imported article.png

Final word

Scribus has a simple to use C++ api for building formatted text importers. Text Filter plugin has also been built using it. If you are interested in coding such a plugin please visit page Get Text How-to

--Tsoots 18:16, 9 Feb 2005 (UTC)