Text Objects are text files that you can add as a layer or within objects. They can be named like any other Oomph files but with a .txt extension e.g. P1-1.txt or S1-1.txt. The special thing about Oomph Text Objects is that the contents text files will be automatically converted to HTML. Specifically the application automatically converts your paragraphs and lines into HTML div elements which allows the option of using css stylesheets to control the look and feel of the rendered content.
You can add text objects directly to your content and the text from the .txt file will appear on your page with a default font and size. You may want to style using css. We have included a basic sample css file which you can use to change the default font and font size used. See 'Basic Styling a Text Object' for information.
Example
The first sentence of the body.
This is sentence two in the first paragraph.
This is the third sentence.
Some more text follows here.
This file can be added to your PDF just like you would any other object. You will now have a section with your PDF that contains a page link (hotspot) to the folder containing the above text file. Your folder structure look like the following:
Styling a Text Object
At this point, if you sideload the above example you should see the original text file loaded into a blank PDF. The text appears with a default size, colour etc. To change how this look you can add a .css (stylesheet) file within your folders.
The following example changes the default text to Times New Roman, a font size of 24px. You can download the example, open in any text editor and modify to suit your need:
.StoryName1 {
font-family: "Times New Roman", Times, serif;
font-size: 24px;
}
Now the resulting folder structure should look something like:
If you use a different folder name in place of the StoryName1 folder in the above example, you will need to change the .StoryName1 element in your .css file i.e. if your folder name changes to Body1, you should change the .css file to
.Body1 {
/*Change the default size of all the text, and change the default font style*/
font-family: "Times New Roman", Times, serif;
font-size: 24px;
}
Stylesheets can be placed anywhere that content files are located such as in shared layers, in section folders and in object folders.
For example:
Shared/Layers/Default/style-1.css
Shared/Layers/Feature/style-1.css
10-Nature/style-1.css
10-Nature/Birds/style-1.css
NOTE: They are applied in order of precedence from shared layers or objects first, then the local section folder, then the local object folder. This precedence is independent of the file numbering order.
If you want to apply multiple styles in one text object please read the advanced text styling page.
Comments
0 comments
Article is closed for comments.